diff options
author | Balint Reczey <balint@balintreczey.hu> | 2022-08-20 18:17:16 +0200 |
---|---|---|
committer | Balint Reczey <balint@balintreczey.hu> | 2022-08-20 18:17:16 +0200 |
commit | 675b462b64b213647d0f5c56b1e8440be5890c8a (patch) | |
tree | 1cd63eec7594d03a622575136c61d8c813f59503 /libsubid | |
parent | 0c04b92a9afe5e09a20307d8a5ec98d97ed00f47 (diff) | |
download | shadow-675b462b64b213647d0f5c56b1e8440be5890c8a.tar.gz |
New upstream version 4.12.2+dfsg1
Diffstat (limited to 'libsubid')
-rw-r--r-- | libsubid/Makefile.in | 27 | ||||
-rw-r--r-- | libsubid/api.c | 25 | ||||
-rw-r--r-- | libsubid/subid.h | 22 | ||||
-rw-r--r-- | libsubid/subid.h.in | 22 |
4 files changed, 29 insertions, 67 deletions
diff --git a/libsubid/Makefile.in b/libsubid/Makefile.in index 8d11b158..ed8dc949 100644 --- a/libsubid/Makefile.in +++ b/libsubid/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -92,13 +92,14 @@ host_triplet = @host@ subdir = libsubid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \ @@ -214,8 +215,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/subid.h.in \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -232,6 +231,8 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -243,8 +244,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ECONF_CPPFLAGS = @ECONF_CPPFLAGS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ @@ -318,6 +321,7 @@ VENDORDIR = @VENDORDIR@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ @@ -593,7 +597,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/libsubid/api.c b/libsubid/api.c index 00da74f6..0c8c451a 100644 --- a/libsubid/api.c +++ b/libsubid/api.c @@ -17,31 +17,6 @@ #include "subid.h" #include "shadowlog.h" -bool subid_init(const char *progname, FILE * logfd) -{ - FILE *shadow_logfd; - if (progname) { - progname = strdup(progname); - if (!progname) - return false; - log_set_progname(progname); - } else { - log_set_progname("(libsubid)"); - } - - if (logfd) { - log_set_logfd(logfd); - return true; - } - shadow_logfd = fopen("/dev/null", "w"); - if (!shadow_logfd) { - log_set_logfd(stderr); - return false; - } - log_set_logfd(shadow_logfd); - return true; -} - static int get_subid_ranges(const char *owner, enum subid_type id_type, struct subid_range **ranges) { diff --git a/libsubid/subid.h b/libsubid/subid.h index 01476713..e8dbdecc 100644 --- a/libsubid/subid.h +++ b/libsubid/subid.h @@ -35,21 +35,9 @@ enum subid_status { SUBID_STATUS_ERROR = 3, }; -/* - * subid_init: initialize libsubid - * - * @progname: Name to display as program. If NULL, then "(libsubid)" will be - * shown in error messages. - * @logfd: Open file pointer to pass error messages to. If NULL, then - * /dev/null will be opened and messages will be sent there. The - * default if libsubid_init() is not called is stderr (2). - * - * This function does not need to be called. If not called, then the defaults - * will be used. - * - * Returns false if an error occurred. - */ -bool subid_init(const char *progname, FILE *logfd); +#ifdef __cplusplus +extern "C" { +#endif /* * subid_get_uid_ranges: return a list of UID ranges for a user @@ -151,5 +139,9 @@ bool subid_ungrant_uid_range(struct subordinate_range *range); */ bool subid_ungrant_gid_range(struct subordinate_range *range); +#ifdef __cplusplus +} +#endif + #define SUBID_NFIELDS 3 #endif diff --git a/libsubid/subid.h.in b/libsubid/subid.h.in index 21b22a26..c8d9273f 100644 --- a/libsubid/subid.h.in +++ b/libsubid/subid.h.in @@ -35,21 +35,9 @@ enum subid_status { SUBID_STATUS_ERROR = 3, }; -/* - * subid_init: initialize libsubid - * - * @progname: Name to display as program. If NULL, then "(libsubid)" will be - * shown in error messages. - * @logfd: Open file pointer to pass error messages to. If NULL, then - * /dev/null will be opened and messages will be sent there. The - * default if libsubid_init() is not called is stderr (2). - * - * This function does not need to be called. If not called, then the defaults - * will be used. - * - * Returns false if an error occurred. - */ -bool subid_init(const char *progname, FILE *logfd); +#ifdef __cplusplus +extern "C" { +#endif /* * subid_get_uid_ranges: return a list of UID ranges for a user @@ -151,5 +139,9 @@ bool subid_ungrant_uid_range(struct subordinate_range *range); */ bool subid_ungrant_gid_range(struct subordinate_range *range); +#ifdef __cplusplus +} +#endif + #define SUBID_NFIELDS 3 #endif |