diff options
author | Balint Reczey <balint@balintreczey.hu> | 2022-01-21 23:41:15 +0100 |
---|---|---|
committer | Balint Reczey <balint@balintreczey.hu> | 2022-01-21 23:41:15 +0100 |
commit | 0c04b92a9afe5e09a20307d8a5ec98d97ed00f47 (patch) | |
tree | 27f51b8f32e23b65d2ef2bbbae00c19fd036e81d /lib | |
parent | 749c1780621163ca5108f164861324bafa9e0ae8 (diff) | |
download | shadow-0c04b92a9afe5e09a20307d8a5ec98d97ed00f47.tar.gz |
New upstream version 4.11.1+dfsg1upstream/4.11.1+dfsg1
Diffstat (limited to 'lib')
54 files changed, 582 insertions, 1335 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index ecf3ee25..3a50b465 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = 1.0 foreign -DEFS = +DEFS = noinst_LTLIBRARIES = libshadow.la @@ -10,6 +10,8 @@ if HAVE_VENDORDIR libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\" endif +libshadow_la_CPPFLAGS += -I$(top_srcdir) + libshadow_la_SOURCES = \ commonio.c \ commonio.h \ @@ -34,6 +36,9 @@ libshadow_la_SOURCES = \ nss.c \ nscd.c \ nscd.h \ + shadowlog.c \ + shadowlog.h \ + shadowlog_internal.h \ sssd.c \ sssd.h \ pam_defs.h \ diff --git a/lib/Makefile.in b/lib/Makefile.in index 3e6486d5..c93fd73c 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -113,12 +113,12 @@ am__libshadow_la_SOURCES_DIST = commonio.c commonio.h defines.h \ encrypt.c exitcodes.h faillog.h fields.c fputsx.c getdef.c \ getdef.h get_gid.c getlong.c get_pid.c get_uid.c getulong.c \ groupio.c groupmem.c groupio.h gshadow.c lockpw.c nss.c nscd.c \ - nscd.h sssd.c sssd.h pam_defs.h port.c port.h prototypes.h \ - pwauth.c pwauth.h pwio.c pwio.h pwmem.c run_part.h run_part.c \ - subordinateio.h subordinateio.c selinux.c semanage.c \ - sgetgrent.c sgetpwent.c sgetspent.c sgroupio.c sgroupio.h \ - shadow.c shadowio.c shadowio.h shadowmem.c spawn.c utent.c \ - tcbfuncs.c tcbfuncs.h + nscd.h shadowlog.c shadowlog.h shadowlog_internal.h sssd.c \ + sssd.h pam_defs.h port.c port.h prototypes.h pwauth.c pwauth.h \ + pwio.c pwio.h pwmem.c run_part.h run_part.c subordinateio.h \ + subordinateio.c selinux.c semanage.c sgetgrent.c sgetpwent.c \ + sgetspent.c sgroupio.c sgroupio.h shadow.c shadowio.c \ + shadowio.h shadowmem.c spawn.c utent.c tcbfuncs.c tcbfuncs.h @WITH_TCB_TRUE@am__objects_1 = libshadow_la-tcbfuncs.lo am_libshadow_la_OBJECTS = libshadow_la-commonio.lo \ libshadow_la-encrypt.lo libshadow_la-fields.lo \ @@ -128,7 +128,8 @@ am_libshadow_la_OBJECTS = libshadow_la-commonio.lo \ libshadow_la-getulong.lo libshadow_la-groupio.lo \ libshadow_la-groupmem.lo libshadow_la-gshadow.lo \ libshadow_la-lockpw.lo libshadow_la-nss.lo \ - libshadow_la-nscd.lo libshadow_la-sssd.lo libshadow_la-port.lo \ + libshadow_la-nscd.lo libshadow_la-shadowlog.lo \ + libshadow_la-sssd.lo libshadow_la-port.lo \ libshadow_la-pwauth.lo libshadow_la-pwio.lo \ libshadow_la-pwmem.lo libshadow_la-run_part.lo \ libshadow_la-subordinateio.lo libshadow_la-selinux.lo \ @@ -156,7 +157,43 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libshadow_la-commonio.Plo \ + ./$(DEPDIR)/libshadow_la-encrypt.Plo \ + ./$(DEPDIR)/libshadow_la-fields.Plo \ + ./$(DEPDIR)/libshadow_la-fputsx.Plo \ + ./$(DEPDIR)/libshadow_la-get_gid.Plo \ + ./$(DEPDIR)/libshadow_la-get_pid.Plo \ + ./$(DEPDIR)/libshadow_la-get_uid.Plo \ + ./$(DEPDIR)/libshadow_la-getdef.Plo \ + ./$(DEPDIR)/libshadow_la-getlong.Plo \ + ./$(DEPDIR)/libshadow_la-getulong.Plo \ + ./$(DEPDIR)/libshadow_la-groupio.Plo \ + ./$(DEPDIR)/libshadow_la-groupmem.Plo \ + ./$(DEPDIR)/libshadow_la-gshadow.Plo \ + ./$(DEPDIR)/libshadow_la-lockpw.Plo \ + ./$(DEPDIR)/libshadow_la-nscd.Plo \ + ./$(DEPDIR)/libshadow_la-nss.Plo \ + ./$(DEPDIR)/libshadow_la-port.Plo \ + ./$(DEPDIR)/libshadow_la-pwauth.Plo \ + ./$(DEPDIR)/libshadow_la-pwio.Plo \ + ./$(DEPDIR)/libshadow_la-pwmem.Plo \ + ./$(DEPDIR)/libshadow_la-run_part.Plo \ + ./$(DEPDIR)/libshadow_la-selinux.Plo \ + ./$(DEPDIR)/libshadow_la-semanage.Plo \ + ./$(DEPDIR)/libshadow_la-sgetgrent.Plo \ + ./$(DEPDIR)/libshadow_la-sgetpwent.Plo \ + ./$(DEPDIR)/libshadow_la-sgetspent.Plo \ + ./$(DEPDIR)/libshadow_la-sgroupio.Plo \ + ./$(DEPDIR)/libshadow_la-shadow.Plo \ + ./$(DEPDIR)/libshadow_la-shadowio.Plo \ + ./$(DEPDIR)/libshadow_la-shadowlog.Plo \ + ./$(DEPDIR)/libshadow_la-shadowmem.Plo \ + ./$(DEPDIR)/libshadow_la-spawn.Plo \ + ./$(DEPDIR)/libshadow_la-sssd.Plo \ + ./$(DEPDIR)/libshadow_la-subordinateio.Plo \ + ./$(DEPDIR)/libshadow_la-tcbfuncs.Plo \ + ./$(DEPDIR)/libshadow_la-utent.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -364,17 +401,18 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.0 foreign noinst_LTLIBRARIES = libshadow.la -libshadow_la_CPPFLAGS = $(ECONF_CPPFLAGS) $(am__append_1) +libshadow_la_CPPFLAGS = $(ECONF_CPPFLAGS) $(am__append_1) \ + -I$(top_srcdir) libshadow_la_SOURCES = commonio.c commonio.h defines.h encrypt.c \ exitcodes.h faillog.h fields.c fputsx.c getdef.c getdef.h \ get_gid.c getlong.c get_pid.c get_uid.c getulong.c groupio.c \ groupmem.c groupio.h gshadow.c lockpw.c nss.c nscd.c nscd.h \ - sssd.c sssd.h pam_defs.h port.c port.h prototypes.h pwauth.c \ - pwauth.h pwio.c pwio.h pwmem.c run_part.h run_part.c \ - subordinateio.h subordinateio.c selinux.c semanage.c \ - sgetgrent.c sgetpwent.c sgetspent.c sgroupio.c sgroupio.h \ - shadow.c shadowio.c shadowio.h shadowmem.c spawn.c utent.c \ - $(am__append_2) + shadowlog.c shadowlog.h shadowlog_internal.h sssd.c sssd.h \ + pam_defs.h port.c port.h prototypes.h pwauth.c pwauth.h pwio.c \ + pwio.h pwmem.c run_part.h run_part.c subordinateio.h \ + subordinateio.c selinux.c semanage.c sgetgrent.c sgetpwent.c \ + sgetspent.c sgroupio.c sgroupio.h shadow.c shadowio.c \ + shadowio.h shadowmem.c spawn.c utent.c $(am__append_2) # These files are unneeded for some reason, listed in # order of appearance: @@ -405,8 +443,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -438,41 +476,48 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-commonio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-encrypt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-fields.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-fputsx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-get_gid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-get_pid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-get_uid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-getdef.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-getlong.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-getulong.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-groupio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-groupmem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-gshadow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-lockpw.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-nscd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-nss.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-port.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-pwauth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-pwio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-pwmem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-run_part.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-selinux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-semanage.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgetgrent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgetpwent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgetspent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgroupio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadowio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadowmem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-spawn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sssd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-subordinateio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-tcbfuncs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-utent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-commonio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-encrypt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-fields.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-fputsx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-get_gid.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-get_pid.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-get_uid.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-getdef.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-getlong.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-getulong.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-groupio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-groupmem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-gshadow.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-lockpw.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-nscd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-nss.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-port.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-pwauth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-pwio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-pwmem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-run_part.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-selinux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-semanage.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgetgrent.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgetpwent.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgetspent.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sgroupio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadow.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadowio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadowlog.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-shadowmem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-spawn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-sssd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-subordinateio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-tcbfuncs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshadow_la-utent.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -607,6 +652,13 @@ libshadow_la-nscd.lo: nscd.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshadow_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libshadow_la-nscd.lo `test -f 'nscd.c' || echo '$(srcdir)/'`nscd.c +libshadow_la-shadowlog.lo: shadowlog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshadow_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libshadow_la-shadowlog.lo -MD -MP -MF $(DEPDIR)/libshadow_la-shadowlog.Tpo -c -o libshadow_la-shadowlog.lo `test -f 'shadowlog.c' || echo '$(srcdir)/'`shadowlog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libshadow_la-shadowlog.Tpo $(DEPDIR)/libshadow_la-shadowlog.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shadowlog.c' object='libshadow_la-shadowlog.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshadow_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libshadow_la-shadowlog.lo `test -f 'shadowlog.c' || echo '$(srcdir)/'`shadowlog.c + libshadow_la-sssd.lo: sssd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshadow_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libshadow_la-sssd.lo -MD -MP -MF $(DEPDIR)/libshadow_la-sssd.Tpo -c -o libshadow_la-sssd.lo `test -f 'sssd.c' || echo '$(srcdir)/'`sssd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libshadow_la-sssd.Tpo $(DEPDIR)/libshadow_la-sssd.Plo @@ -798,7 +850,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -868,7 +923,42 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libshadow_la-commonio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-encrypt.Plo + -rm -f ./$(DEPDIR)/libshadow_la-fields.Plo + -rm -f ./$(DEPDIR)/libshadow_la-fputsx.Plo + -rm -f ./$(DEPDIR)/libshadow_la-get_gid.Plo + -rm -f ./$(DEPDIR)/libshadow_la-get_pid.Plo + -rm -f ./$(DEPDIR)/libshadow_la-get_uid.Plo + -rm -f ./$(DEPDIR)/libshadow_la-getdef.Plo + -rm -f ./$(DEPDIR)/libshadow_la-getlong.Plo + -rm -f ./$(DEPDIR)/libshadow_la-getulong.Plo + -rm -f ./$(DEPDIR)/libshadow_la-groupio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-groupmem.Plo + -rm -f ./$(DEPDIR)/libshadow_la-gshadow.Plo + -rm -f ./$(DEPDIR)/libshadow_la-lockpw.Plo + -rm -f ./$(DEPDIR)/libshadow_la-nscd.Plo + -rm -f ./$(DEPDIR)/libshadow_la-nss.Plo + -rm -f ./$(DEPDIR)/libshadow_la-port.Plo + -rm -f ./$(DEPDIR)/libshadow_la-pwauth.Plo + -rm -f ./$(DEPDIR)/libshadow_la-pwio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-pwmem.Plo + -rm -f ./$(DEPDIR)/libshadow_la-run_part.Plo + -rm -f ./$(DEPDIR)/libshadow_la-selinux.Plo + -rm -f ./$(DEPDIR)/libshadow_la-semanage.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgetgrent.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgetpwent.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgetspent.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgroupio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadow.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadowio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadowlog.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadowmem.Plo + -rm -f ./$(DEPDIR)/libshadow_la-spawn.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sssd.Plo + -rm -f ./$(DEPDIR)/libshadow_la-subordinateio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-tcbfuncs.Plo + -rm -f ./$(DEPDIR)/libshadow_la-utent.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -914,7 +1004,42 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libshadow_la-commonio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-encrypt.Plo + -rm -f ./$(DEPDIR)/libshadow_la-fields.Plo + -rm -f ./$(DEPDIR)/libshadow_la-fputsx.Plo + -rm -f ./$(DEPDIR)/libshadow_la-get_gid.Plo + -rm -f ./$(DEPDIR)/libshadow_la-get_pid.Plo + -rm -f ./$(DEPDIR)/libshadow_la-get_uid.Plo + -rm -f ./$(DEPDIR)/libshadow_la-getdef.Plo + -rm -f ./$(DEPDIR)/libshadow_la-getlong.Plo + -rm -f ./$(DEPDIR)/libshadow_la-getulong.Plo + -rm -f ./$(DEPDIR)/libshadow_la-groupio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-groupmem.Plo + -rm -f ./$(DEPDIR)/libshadow_la-gshadow.Plo + -rm -f ./$(DEPDIR)/libshadow_la-lockpw.Plo + -rm -f ./$(DEPDIR)/libshadow_la-nscd.Plo + -rm -f ./$(DEPDIR)/libshadow_la-nss.Plo + -rm -f ./$(DEPDIR)/libshadow_la-port.Plo + -rm -f ./$(DEPDIR)/libshadow_la-pwauth.Plo + -rm -f ./$(DEPDIR)/libshadow_la-pwio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-pwmem.Plo + -rm -f ./$(DEPDIR)/libshadow_la-run_part.Plo + -rm -f ./$(DEPDIR)/libshadow_la-selinux.Plo + -rm -f ./$(DEPDIR)/libshadow_la-semanage.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgetgrent.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgetpwent.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgetspent.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sgroupio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadow.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadowio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadowlog.Plo + -rm -f ./$(DEPDIR)/libshadow_la-shadowmem.Plo + -rm -f ./$(DEPDIR)/libshadow_la-spawn.Plo + -rm -f ./$(DEPDIR)/libshadow_la-sssd.Plo + -rm -f ./$(DEPDIR)/libshadow_la-subordinateio.Plo + -rm -f ./$(DEPDIR)/libshadow_la-tcbfuncs.Plo + -rm -f ./$(DEPDIR)/libshadow_la-utent.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -935,16 +1060,16 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am diff --git a/lib/commonio.c b/lib/commonio.c index cef404b9..9e0fde60 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2001, Marek Michałkiewicz - * Copyright (c) 2001 - 2006, Tomasz Kłoczko - * Copyright (c) 2007 - 2011, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2001, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2011, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -51,6 +28,7 @@ #endif /* WITH_TCB */ #include "prototypes.h" #include "commonio.h" +#include "shadowlog_internal.h" /* local function prototypes */ static int lrename (const char *, const char *); @@ -146,7 +124,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: %s: %s\n", - Prog, file, strerror (errno)); + shadow_progname, file, strerror (errno)); } return 0; } @@ -158,7 +136,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: %s file write error: %s\n", - Prog, file, strerror (errno)); + shadow_progname, file, strerror (errno)); } (void) close (fd); unlink (file); @@ -168,7 +146,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: %s file sync error: %s\n", - Prog, file, strerror (errno)); + shadow_progname, file, strerror (errno)); } (void) close (fd); unlink (file); @@ -181,7 +159,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if ((0==retval) && log) { (void) fprintf (shadow_logfd, "%s: %s: lock file already used\n", - Prog, file); + shadow_progname, file); } unlink (file); return retval; @@ -192,7 +170,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: %s: %s\n", - Prog, lock, strerror (errno)); + shadow_progname, lock, strerror (errno)); } unlink (file); errno = EINVAL; @@ -204,7 +182,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: existing lock file %s without a PID\n", - Prog, lock); + shadow_progname, lock); } unlink (file); errno = EINVAL; @@ -215,7 +193,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: existing lock file %s with an invalid PID '%s'\n", - Prog, lock, buf); + shadow_progname, lock, buf); } unlink (file); errno = EINVAL; @@ -225,7 +203,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: lock %s already used by PID %lu\n", - Prog, lock, (unsigned long) pid); + shadow_progname, lock, (unsigned long) pid); } unlink (file); errno = EEXIST; @@ -235,7 +213,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) if (log) { (void) fprintf (shadow_logfd, "%s: cannot get lock %s: %s\n", - Prog, lock, strerror (errno)); + shadow_progname, lock, strerror (errno)); } unlink (file); return 0; @@ -247,13 +225,13 @@ static int do_lock_file (const char *file, const char *lock, bool log) if ((0==retval) && log) { (void) fprintf (shadow_logfd, "%s: %s: lock file already used\n", - Prog, file); + shadow_progname, file); } } else { if (log) { (void) fprintf (shadow_logfd, "%s: cannot get lock %s: %s\n", - Prog, lock, strerror (errno)); + shadow_progname, lock, strerror (errno)); } } @@ -403,11 +381,11 @@ int commonio_lock_nowait (struct commonio_db *db, bool log) file_len = strlen(db->filename) + 11;/* %lu max size */ lock_file_len = strlen(db->filename) + 6; /* sizeof ".lock" */ file = (char*)malloc(file_len); - if(file == NULL) { + if (file == NULL) { goto cleanup_ENOMEM; } lock = (char*)malloc(lock_file_len); - if(lock == NULL) { + if (lock == NULL) { goto cleanup_ENOMEM; } snprintf (file, file_len, "%s.%lu", @@ -419,9 +397,9 @@ int commonio_lock_nowait (struct commonio_db *db, bool log) err = 1; } cleanup_ENOMEM: - if(file) + if (file) free(file); - if(lock) + if (lock) free(lock); return err; } @@ -448,7 +426,7 @@ int commonio_lock (struct commonio_db *db) if (geteuid () != 0) { (void) fprintf (shadow_logfd, "%s: Permission denied.\n", - Prog); + shadow_progname); } return 0; /* failure */ } @@ -483,7 +461,7 @@ int commonio_lock (struct commonio_db *db) /* no unnecessary retries on "permission denied" errors */ if (geteuid () != 0) { (void) fprintf (shadow_logfd, "%s: Permission denied.\n", - Prog); + shadow_progname); return 0; } } diff --git a/lib/commonio.h b/lib/commonio.h index 2bad47a5..e63c5b4d 100644 --- a/lib/commonio.h +++ b/lib/commonio.h @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 - 2005, Tomasz Kłoczko - * Copyright (c) 2007 - 2010, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* $Id$ */ diff --git a/lib/defines.h b/lib/defines.h index e1500a76..fc1521cb 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -70,10 +70,6 @@ extern char * textdomain (const char * domainname); # define strrchr rindex # endif char *strchr (), *strrchr (), *strtok (); - -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy((s), (d), (n)) -# endif #endif /* not STDC_HEADERS */ #if HAVE_ERRNO_H @@ -115,11 +111,7 @@ char *strchr (), *strrchr (), *strtok (); # endif #endif /* not TIME_WITH_SYS_TIME */ -#ifdef HAVE_MEMSET -# define memzero(ptr, size) memset((void *)(ptr), 0, (size)) -#else -# define memzero(ptr, size) bzero((char *)(ptr), (size)) -#endif +#define memzero(ptr, size) memset((void *)(ptr), 0, (size)) #define strzero(s) memzero(s, strlen(s)) /* warning: evaluates twice */ #ifdef HAVE_DIRENT_H /* DIR_SYSV */ diff --git a/lib/encrypt.c b/lib/encrypt.c index 66c52f2d..c84a2552 100644 --- a/lib/encrypt.c +++ b/lib/encrypt.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1993, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2007 - 2010, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1993, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -39,6 +16,7 @@ #include "prototypes.h" #include "defines.h" +#include "shadowlog_internal.h" /*@exposed@*//*@null@*/char *pw_encrypt (const char *clear, const char *salt) { diff --git a/lib/exitcodes.h b/lib/exitcodes.h index 96b2340b..7dbe340e 100644 --- a/lib/exitcodes.h +++ b/lib/exitcodes.h @@ -1,30 +1,7 @@ /* - * Copyright (c) 2005 - 2006, Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 2005 - 2006, Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* $Id$ */ diff --git a/lib/faillog.h b/lib/faillog.h index a0a95b34..38476ea6 100644 --- a/lib/faillog.h +++ b/lib/faillog.h @@ -1,32 +1,9 @@ /* - * Copyright (c) 1989 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1997, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* @@ -45,8 +22,8 @@ struct faillog { short fail_cnt; /* failures since last success */ short fail_max; /* failures before turning account off */ - char fail_line[12]; /* last failure occured here */ - time_t fail_time; /* last failure occured then */ + char fail_line[12]; /* last failure occurred here */ + time_t fail_time; /* last failure occurred then */ /* * If nonzero, the account will be re-enabled if there are no * failures for fail_locktime seconds since last failure. diff --git a/lib/fields.c b/lib/fields.c index 649fae17..8a560352 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 , Julianne Frances Haugh - * Copyright (c) 1996 - 1997, Marek Michałkiewicz - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2007 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 , Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/fputsx.c b/lib/fputsx.c index c42b40bd..bb71ab2a 100644 --- a/lib/fputsx.c +++ b/lib/fputsx.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1999, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1999, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/get_gid.c b/lib/get_gid.c index 6fb31ffe..cbcd6f4b 100644 --- a/lib/get_gid.c +++ b/lib/get_gid.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2009 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 2009 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/get_pid.c b/lib/get_pid.c index e2b47ce5..383eb695 100644 --- a/lib/get_pid.c +++ b/lib/get_pid.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2009 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 2009 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/get_uid.c b/lib/get_uid.c index ac0f2df3..50f99225 100644 --- a/lib/get_uid.c +++ b/lib/get_uid.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2009 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 2009 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/getdef.c b/lib/getdef.c index 80eb18c4..fbaea2e1 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1991 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2002 - 2006, Tomasz Kłoczko - * Copyright (c) 2007 - 2008, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2002 - 2006, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2008, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -44,6 +21,7 @@ #include <libeconf.h> #endif #include "getdef.h" +#include "shadowlog_internal.h" /* * A configuration item definition. */ diff --git a/lib/getdef.h b/lib/getdef.h index 46346d8e..2bd3fc5f 100644 --- a/lib/getdef.h +++ b/lib/getdef.h @@ -1,33 +1,10 @@ /* - * Copyright (c) 1991 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2002 - 2006, Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2002 - 2006, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _GETDEF_H #define _GETDEF_H diff --git a/lib/getlong.c b/lib/getlong.c index 47c3a605..ec4aa54d 100644 --- a/lib/getlong.c +++ b/lib/getlong.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2007 - 2009, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/getulong.c b/lib/getulong.c index 08d2c1a8..33250e3a 100644 --- a/lib/getulong.c +++ b/lib/getulong.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2007 - 2009, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/groupio.c b/lib/groupio.c index bffb06e0..54af36e3 100644 --- a/lib/groupio.c +++ b/lib/groupio.c @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2007 - 2010, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/groupio.h b/lib/groupio.h index e1f1b029..2014de0c 100644 --- a/lib/groupio.h +++ b/lib/groupio.h @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* $Id$ */ diff --git a/lib/groupmem.c b/lib/groupmem.c index 2060d03b..c18b5c64 100644 --- a/lib/groupmem.c +++ b/lib/groupmem.c @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2007 - 2013, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/gshadow.c b/lib/gshadow.c index e5a0f61e..2e129230 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 - 2009, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/gshadow_.h b/lib/gshadow_.h index 7959c5a1..68a0bb67 100644 --- a/lib/gshadow_.h +++ b/lib/gshadow_.h @@ -1,32 +1,9 @@ /* - * Copyright (c) 1988 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1997, Marek Michałkiewicz - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 1988 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* diff --git a/lib/lockpw.c b/lib/lockpw.c index 0bcf1955..aaa317fd 100644 --- a/lib/lockpw.c +++ b/lib/lockpw.c @@ -1,32 +1,9 @@ /* - * Copyright (c) 1992 , Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 1992 , Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -10,6 +10,7 @@ #include "defines.h" #include "prototypes.h" #include "nscd.h" +#include "shadowlog_internal.h" #define MSG_NSCD_FLUSH_CACHE_FAILED "%s: Failed to flush the nscd cache.\n" @@ -25,7 +26,7 @@ int nscd_flush_cache (const char *service) if (run_command (cmd, spawnedArgs, spawnedEnv, &status) != 0) { /* run_command writes its own more detailed message. */ - (void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog); + (void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), shadow_progname); return -1; } @@ -33,7 +34,7 @@ int nscd_flush_cache (const char *service) if (!WIFEXITED (status)) { (void) fprintf (shadow_logfd, _("%s: nscd did not terminate normally (signal %d)\n"), - Prog, WTERMSIG (status)); + shadow_progname, WTERMSIG (status)); return -1; } else if (code == E_CMD_NOTFOUND) { /* nscd is not installed, or it is installed but uses an @@ -44,8 +45,8 @@ int nscd_flush_cache (const char *service) return 0; } else if (code != 0) { (void) fprintf (shadow_logfd, _("%s: nscd exited with status %d\n"), - Prog, code); - (void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog); + shadow_progname, code); + (void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), shadow_progname); return -1; } @@ -8,6 +8,7 @@ #include <stdatomic.h> #include "prototypes.h" #include "../libsubid/subid.h" +#include "shadowlog_internal.h" #define NSSWITCH "/etc/nsswitch.conf" diff --git a/lib/pam_defs.h b/lib/pam_defs.h index 343fbb45..2dcda3cd 100644 --- a/lib/pam_defs.h +++ b/lib/pam_defs.h @@ -1,31 +1,8 @@ /* - * Copyright (c) 1999 , Marek Michałkiewicz - * Copyright (c) 2001 - 2005, Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 1999 , Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -1,33 +1,10 @@ /* - * Copyright (c) 1989 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1997, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -1,32 +1,9 @@ /* - * Copyright (c) 1989 - 1991, Julianne Frances Haugh - * Copyright (c) 1996 - 1997, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 1989 - 1991, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* diff --git a/lib/prototypes.h b/lib/prototypes.h index 1d1586d4..6f80df82 100644 --- a/lib/prototypes.h +++ b/lib/prototypes.h @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2003 - 2006, Tomasz Kłoczko - * Copyright (c) 2007 - 2010, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* @@ -59,9 +36,6 @@ #include "defines.h" #include "commonio.h" -extern /*@observer@*/ const char *Prog; /* Program name showed in error messages */ -extern FILE *shadow_logfd; /* file descripter to which error messages are printed */ - /* addgrps.c */ #if defined (HAVE_SETGROUPS) && ! defined (USE_PAM) extern int add_groups (const char *); @@ -134,6 +108,9 @@ extern int copy_tree (const char *src_root, const char *dst_root, uid_t old_uid, uid_t new_uid, gid_t old_gid, gid_t new_gid); +/* date_to_str.c */ +extern void date_to_str (size_t size, char buf[size], long date); + /* encrypt.c */ extern /*@exposed@*//*@null@*/char *pw_encrypt (const char *, const char *); @@ -392,6 +369,7 @@ extern /*@observer@*/const char *crypt_make_salt (/*@null@*//*@observer@*/const /* selinux.c */ #ifdef WITH_SELINUX extern int set_selinux_file_context (const char *dst_name, mode_t mode); +extern void reset_selinux_handle (void); extern int reset_selinux_file_context (void); extern int check_selinux_permit (const char *perm_name); #endif diff --git a/lib/pwauth.c b/lib/pwauth.c index 9e24fbf2..62de4723 100644 --- a/lib/pwauth.c +++ b/lib/pwauth.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1992 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2003 - 2006, Tomasz Kłoczko - * Copyright (c) 2008 - 2009, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1992 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -127,7 +104,7 @@ int pw_auth (const char *cipher, #ifdef SKEY /* * If the user has an S/KEY entry show them the pertinent info - * and then we can try validating the created cyphertext and the SKEY. + * and then we can try validating the created ciphertext and the SKEY. * If there is no SKEY information we default to not using SKEY. */ diff --git a/lib/pwauth.h b/lib/pwauth.h index d6c71dda..fb205b71 100644 --- a/lib/pwauth.h +++ b/lib/pwauth.h @@ -1,33 +1,10 @@ /* - * Copyright (c) 1992 - 1993, Julianne Frances Haugh - * Copyright (c) 1996 - 1997, Marek Michałkiewicz - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2009 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1992 - 1993, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2009 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2007 - 2009, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2005 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* $Id$ */ diff --git a/lib/pwmem.c b/lib/pwmem.c index 17d2eb21..f6aadb85 100644 --- a/lib/pwmem.c +++ b/lib/pwmem.c @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2007 - 2013, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -93,14 +70,16 @@ void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent) { - free (pwent->pw_name); - if (pwent->pw_passwd) { - memzero (pwent->pw_passwd, strlen (pwent->pw_passwd)); - free (pwent->pw_passwd); + if (pwent != NULL) { + free (pwent->pw_name); + if (pwent->pw_passwd) { + memzero (pwent->pw_passwd, strlen (pwent->pw_passwd)); + free (pwent->pw_passwd); + } + free (pwent->pw_gecos); + free (pwent->pw_dir); + free (pwent->pw_shell); + free (pwent); } - free (pwent->pw_gecos); - free (pwent->pw_dir); - free (pwent->pw_shell); - free (pwent); } diff --git a/lib/run_part.c b/lib/run_part.c index 03d1d675..1ce06be0 100644 --- a/lib/run_part.c +++ b/lib/run_part.c @@ -8,6 +8,7 @@ #include <sys/wait.h> #include <unistd.h> #include <lib/prototypes.h> +#include "shadowlog_internal.h" int run_part (char *script_path, char *name, char *action) { @@ -17,7 +18,7 @@ int run_part (char *script_path, char *name, char *action) char *args[] = { script_path, NULL }; pid=fork(); - if (pid==-1){ + if (pid==-1) { perror ("Could not fork"); return 1; } diff --git a/lib/selinux.c b/lib/selinux.c index c83545f9..f97b1fe5 100644 --- a/lib/selinux.c +++ b/lib/selinux.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2011 , Peter Vrabec <pvrabec@redhat.com> - * All rights reserved. + * SPDX-FileCopyrightText: 2011 , Peter Vrabec <pvrabec@redhat.com> * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -38,6 +15,8 @@ #include <selinux/label.h> #include "prototypes.h" +#include "shadowlog_internal.h" + static bool selinux_checked = false; static bool selinux_enabled; static /*@null@*/struct selabel_handle *selabel_hnd = NULL; @@ -50,6 +29,11 @@ static void cleanup(void) } } +void reset_selinux_handle (void) +{ + cleanup(); +} + /* * set_selinux_file_context - Set the security context before any file or * directory creation. @@ -209,7 +193,7 @@ int check_selinux_permit (const char *perm_name) if (getprevcon_raw (&user_context_raw) != 0) { fprintf (shadow_logfd, _("%s: can not get previous SELinux process context: %s\n"), - Prog, strerror (errno)); + shadow_progname, strerror (errno)); SYSLOG ((LOG_WARN, "can not get previous SELinux process context: %s", strerror (errno))); diff --git a/lib/semanage.c b/lib/semanage.c index 766ad6d0..12401608 100644 --- a/lib/semanage.c +++ b/lib/semanage.c @@ -1,31 +1,8 @@ /* - * Copyright (c) 2010 , Jakub Hrozek <jhrozek@redhat.com> - * Copyright (c) 2011 , Peter Vrabec <pvrabec@redhat.com> - * All rights reserved. + * SPDX-FileCopyrightText: 2010 , Jakub Hrozek <jhrozek@redhat.com> + * SPDX-FileCopyrightText: 2011 , Peter Vrabec <pvrabec@redhat.com> * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -43,6 +20,7 @@ #include <semanage/semanage.h> #include "prototypes.h" +#include "shadowlog_internal.h" #ifndef DEFAULT_SERANGE #define DEFAULT_SERANGE "s0" @@ -293,6 +271,7 @@ int set_seuser (const char *login_name, const char *seuser_name) } ret = 0; + reset_selinux_handle(); done: semanage_seuser_key_free (key); @@ -331,7 +310,7 @@ int del_seuser (const char *login_name) if (0 == exists) { fprintf (shadow_logfd, - _("Login mapping for %s is not defined, OK if default mapping was used\n"), + _("Login mapping for %s is not defined, OK if default mapping was used\n"), login_name); ret = 0; /* probably default mapping */ goto done; @@ -346,7 +325,7 @@ int del_seuser (const char *login_name) if (0 == exists) { fprintf (shadow_logfd, - _("Login mapping for %s is defined in policy, cannot be deleted\n"), + _("Login mapping for %s is defined in policy, cannot be deleted\n"), login_name); ret = 0; /* Login mapping defined in policy can't be deleted */ goto done; diff --git a/lib/sgetgrent.c b/lib/sgetgrent.c index a951be42..1ed3aa11 100644 --- a/lib/sgetgrent.c +++ b/lib/sgetgrent.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/sgetpwent.c b/lib/sgetpwent.c index befdd916..84a653d7 100644 --- a/lib/sgetpwent.c +++ b/lib/sgetpwent.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1989 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -91,7 +68,7 @@ struct passwd *sgetpwent (const char *buf) } /* something at the end, columns over shot */ - if( cp != NULL ) { + if ( cp != NULL ) { return( NULL ); } diff --git a/lib/sgetspent.c b/lib/sgetspent.c index 8251a561..a35b6759 100644 --- a/lib/sgetspent.c +++ b/lib/sgetspent.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1989 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2009 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2009 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/sgroupio.c b/lib/sgroupio.c index ffbdb263..cf01de7b 100644 --- a/lib/sgroupio.c +++ b/lib/sgroupio.c @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2007 - 2013, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/sgroupio.h b/lib/sgroupio.h index 163243a4..3474a985 100644 --- a/lib/sgroupio.h +++ b/lib/sgroupio.h @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* $Id$ */ diff --git a/lib/shadow.c b/lib/shadow.c index e743b2ce..9e86b908 100644 --- a/lib/shadow.c +++ b/lib/shadow.c @@ -1,33 +1,10 @@ /* - * Copyright (c) 1989 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2009 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2009 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/shadowio.c b/lib/shadowio.c index 676b1f1a..34076040 100644 --- a/lib/shadowio.c +++ b/lib/shadowio.c @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2007 - 2009, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> diff --git a/lib/shadowio.h b/lib/shadowio.h index 5384b1dd..4dbeb6d6 100644 --- a/lib/shadowio.h +++ b/lib/shadowio.h @@ -1,33 +1,10 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 - 2005, Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko + * SPDX-FileCopyrightText: 2008 , Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* $Id$ */ diff --git a/lib/shadowlog.c b/lib/shadowlog.c new file mode 100644 index 00000000..7bcc63ca --- /dev/null +++ b/lib/shadowlog.c @@ -0,0 +1,31 @@ +#include "shadowlog.h" + +#include "lib/shadowlog_internal.h" + +const char *shadow_progname = "libshadow"; +FILE *shadow_logfd = NULL; + +void log_set_progname(const char *progname) +{ + shadow_progname = progname; +} + +const char *log_get_progname(void) +{ + return shadow_progname; +} + +void log_set_logfd(FILE *fd) +{ + if (NULL != fd) + shadow_logfd = fd; + else + shadow_logfd = stderr; +} + +FILE *log_get_logfd(void) +{ + if (shadow_logfd != NULL) + return shadow_logfd; + return stderr; +} diff --git a/lib/shadowlog.h b/lib/shadowlog.h new file mode 100644 index 00000000..bf8be855 --- /dev/null +++ b/lib/shadowlog.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 , Serge Hallyn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the copyright holders or contributors may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* $Id$ */ +#ifndef _LOG_H +#define _LOG_H +#include <stdio.h> + +extern void log_set_progname(const char *); +extern const char *log_get_progname(void); +extern void log_set_logfd(FILE *fd); +extern FILE *log_get_logfd(void); +extern void log_dolog(char *, ...); + +#endif diff --git a/lib/shadowlog_internal.h b/lib/shadowlog_internal.h new file mode 100644 index 00000000..7f25407b --- /dev/null +++ b/lib/shadowlog_internal.h @@ -0,0 +1,2 @@ +extern const char *shadow_progname; /* Program name showed in error messages */ +extern FILE *shadow_logfd; /* file descripter to which error messages are printed */ diff --git a/lib/shadowmem.c b/lib/shadowmem.c index 8989598f..757d6026 100644 --- a/lib/shadowmem.c +++ b/lib/shadowmem.c @@ -1,34 +1,11 @@ /* - * Copyright (c) 1990 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 2000, Marek Michałkiewicz - * Copyright (c) 2001 , Michał Moskal - * Copyright (c) 2005 , Tomasz Kłoczko - * Copyright (c) 2007 - 2013, Nicolas François - * All rights reserved. + * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2001 , Michał Moskal + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko + * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -79,11 +56,13 @@ void spw_free (/*@out@*/ /*@only@*/struct spwd *spent) { - free (spent->sp_namp); - if (NULL != spent->sp_pwdp) { - memzero (spent->sp_pwdp, strlen (spent->sp_pwdp)); - free (spent->sp_pwdp); + if (spent != NULL) { + free (spent->sp_namp); + if (NULL != spent->sp_pwdp) { + memzero (spent->sp_pwdp, strlen (spent->sp_pwdp)); + free (spent->sp_pwdp); + } + free (spent); } - free (spent); } diff --git a/lib/spawn.c b/lib/spawn.c index c53742cc..ce1a97db 100644 --- a/lib/spawn.c +++ b/lib/spawn.c @@ -1,30 +1,7 @@ /* - * Copyright (c) 2011 , Jonathan Nieder - * All rights reserved. + * SPDX-FileCopyrightText: 2011 , Jonathan Nieder * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> @@ -38,6 +15,8 @@ #include "exitcodes.h" #include "prototypes.h" +#include "shadowlog_internal.h" + int run_command (const char *cmd, const char *argv[], /*@null@*/const char *envp[], /*@out@*/int *status) { @@ -58,11 +37,11 @@ int run_command (const char *cmd, const char *argv[], exit (E_CMD_NOTFOUND); } fprintf (shadow_logfd, "%s: cannot execute %s: %s\n", - Prog, cmd, strerror (errno)); + shadow_progname, cmd, strerror (errno)); exit (E_CMD_NOEXEC); } else if ((pid_t)-1 == pid) { fprintf (shadow_logfd, "%s: cannot execute %s: %s\n", - Prog, cmd, strerror (errno)); + shadow_progname, cmd, strerror (errno)); return -1; } @@ -75,7 +54,7 @@ int run_command (const char *cmd, const char *argv[], if ((pid_t)-1 == wpid) { fprintf (shadow_logfd, "%s: waitpid (status: %d): %s\n", - Prog, *status, strerror (errno)); + shadow_progname, *status, strerror (errno)); return -1; } @@ -11,6 +11,8 @@ #include "prototypes.h" #include "sssd.h" +#include "shadowlog_internal.h" + #define MSG_SSSD_FLUSH_CACHE_FAILED "%s: Failed to flush the sssd cache." int sssd_flush_cache (int dbflags) @@ -46,22 +48,22 @@ int sssd_flush_cache (int dbflags) free(sss_cache_args); if (rv != 0) { /* run_command writes its own more detailed message. */ - SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, Prog)); + SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, shadow_progname)); return -1; } code = WEXITSTATUS (status); if (!WIFEXITED (status)) { SYSLOG ((LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)", - Prog, WTERMSIG (status))); + shadow_progname, WTERMSIG (status))); return -1; } else if (code == E_CMD_NOTFOUND) { /* sss_cache is not installed, or it is installed but uses an interpreter that is missing. Probably the former. */ return 0; } else if (code != 0) { - SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", Prog, code)); - SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, Prog)); + SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", shadow_progname, code)); + SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, shadow_progname)); return -1; } diff --git a/lib/subordinateio.c b/lib/subordinateio.c index fbff3eae..9ca70b8b 100644 --- a/lib/subordinateio.c +++ b/lib/subordinateio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 - Eric Biederman + * SPDX-FileCopyrightText: 2012 - Eric Biederman */ #include <config.h> @@ -53,7 +53,7 @@ static /*@null@*/ /*@only@*/void *subordinate_dup (const void *ent) static void subordinate_free (/*@out@*/ /*@only@*/void *ent) { struct subordinate_range *rangeent = ent; - + free ((void *)(rangeent->owner)); free (rangeent); } @@ -224,7 +224,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db, /* Get UID of the username we are looking for */ pwd = getpwnam(owner); if (NULL == pwd) { - /* Username not defined in /etc/passwd, or error occured during lookup */ + /* Username not defined in /etc/passwd, or error occurred during lookup */ return NULL; } owner_uid = pwd->pw_uid; @@ -296,7 +296,7 @@ static bool have_range(struct commonio_db *db, end = start + count - 1; range = find_range (db, owner, start); while (range) { - unsigned long last; + unsigned long last; last = range->start + range->count - 1; if (last >= (start + count - 1)) @@ -847,7 +847,7 @@ static int append_uids(uid_t **uids, const char *owner, int n) } else { struct passwd *pwd = getpwnam(owner); if (NULL == pwd) { - /* Username not defined in /etc/passwd, or error occured during lookup */ + /* Username not defined in /etc/passwd, or error occurred during lookup */ free(*uids); *uids = NULL; return -1; diff --git a/lib/tcbfuncs.c b/lib/tcbfuncs.c index e9496cdf..80838c51 100644 --- a/lib/tcbfuncs.c +++ b/lib/tcbfuncs.c @@ -1,21 +1,6 @@ /* - * Copyright (c) 2001 Rafal Wojtczuk, Solar Designer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-FileCopyrightText: 2001 Rafal Wojtczuk, Solar Designer + * SPDX-License-Identifier: 0BSD */ #define _GNU_SOURCE @@ -38,6 +23,8 @@ #include "shadowio.h" #include "tcbfuncs.h" +#include "shadowlog_internal.h" + #define SHADOWTCB_HASH_BY 1000 #define SHADOWTCB_LOCK_SUFFIX ".lock" @@ -72,7 +59,7 @@ shadowtcb_status shadowtcb_gain_priv (void) * to exit soon. */ #define OUT_OF_MEMORY do { \ - fprintf (shadow_logfd, _("%s: out of memory\n"), Prog); \ + fprintf (shadow_logfd, _("%s: out of memory\n"), shadow_progname); \ (void) fflush (shadow_logfd); \ } while (false) @@ -118,7 +105,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name) if (lstat (path, &st) != 0) { fprintf (shadow_logfd, _("%s: Cannot stat %s: %s\n"), - Prog, path, strerror (errno)); + shadow_progname, path, strerror (errno)); free (path); return NULL; } @@ -134,7 +121,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name) if (!S_ISLNK (st.st_mode)) { fprintf (shadow_logfd, _("%s: %s is neither a directory, nor a symlink.\n"), - Prog, path); + shadow_progname, path); free (path); return NULL; } @@ -142,7 +129,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name) if (-1 == ret) { fprintf (shadow_logfd, _("%s: Cannot read symbolic link %s: %s\n"), - Prog, path, strerror (errno)); + shadow_progname, path, strerror (errno)); free (path); return NULL; } @@ -151,7 +138,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name) link[sizeof(link) - 1] = '\0'; fprintf (shadow_logfd, _("%s: Suspiciously long symlink: %s\n"), - Prog, link); + shadow_progname, link); return NULL; } link[(size_t)ret] = '\0'; @@ -209,7 +196,7 @@ static shadowtcb_status mkdir_leading (const char *name, uid_t uid) if (stat (TCB_DIR, &st) != 0) { fprintf (shadow_logfd, _("%s: Cannot stat %s: %s\n"), - Prog, TCB_DIR, strerror (errno)); + shadow_progname, TCB_DIR, strerror (errno)); goto out_free_path; } while ((ind = strchr (ptr, '/'))) { @@ -221,19 +208,19 @@ static shadowtcb_status mkdir_leading (const char *name, uid_t uid) if ((mkdir (dir, 0700) != 0) && (errno != EEXIST)) { fprintf (shadow_logfd, _("%s: Cannot create directory %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); goto out_free_dir; } if (chown (dir, 0, st.st_gid) != 0) { fprintf (shadow_logfd, _("%s: Cannot change owner of %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); goto out_free_dir; } if (chmod (dir, 0711) != 0) { fprintf (shadow_logfd, _("%s: Cannot change mode of %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); goto out_free_dir; } free (dir); @@ -263,7 +250,7 @@ static shadowtcb_status unlink_suffs (const char *user) if ((unlink (tmp) != 0) && (errno != ENOENT)) { fprintf (shadow_logfd, _("%s: unlink: %s: %s\n"), - Prog, tmp, strerror (errno)); + shadow_progname, tmp, strerror (errno)); free (tmp); return SHADOWTCB_FAILURE; } @@ -288,7 +275,7 @@ static shadowtcb_status rmdir_leading (char *path) if (errno != ENOTEMPTY) { fprintf (shadow_logfd, _("%s: Cannot remove directory %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); ret = SHADOWTCB_FAILURE; } free (dir); @@ -317,7 +304,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid) if (stat (olddir, &oldmode) != 0) { fprintf (shadow_logfd, _("%s: Cannot stat %s: %s\n"), - Prog, olddir, strerror (errno)); + shadow_progname, olddir, strerror (errno)); goto out_free; } old_uid = oldmode.st_uid; @@ -344,7 +331,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid) if (rename (real_old_dir, real_new_dir) != 0) { fprintf (shadow_logfd, _("%s: Cannot rename %s to %s: %s\n"), - Prog, real_old_dir, real_new_dir, strerror (errno)); + shadow_progname, real_old_dir, real_new_dir, strerror (errno)); goto out_free; } if (rmdir_leading (real_old_dir_rel) == SHADOWTCB_FAILURE) { @@ -353,7 +340,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid) if ((unlink (olddir) != 0) && (errno != ENOENT)) { fprintf (shadow_logfd, _("%s: Cannot remove %s: %s\n"), - Prog, olddir, strerror (errno)); + shadow_progname, olddir, strerror (errno)); goto out_free; } if (asprintf (&newdir, TCB_DIR "/%s", user_newname) == -1) { @@ -367,7 +354,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid) && (symlink (real_new_dir_rel, newdir) != 0)) { fprintf (shadow_logfd, _("%s: Cannot create symbolic link %s: %s\n"), - Prog, real_new_dir_rel, strerror (errno)); + shadow_progname, real_new_dir_rel, strerror (errno)); goto out_free; } ret = SHADOWTCB_SUCCESS; @@ -466,31 +453,31 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_ if (stat (tcbdir, &dirmode) != 0) { fprintf (shadow_logfd, _("%s: Cannot stat %s: %s\n"), - Prog, tcbdir, strerror (errno)); + shadow_progname, tcbdir, strerror (errno)); goto out_free; } if (chown (tcbdir, 0, 0) != 0) { fprintf (shadow_logfd, _("%s: Cannot change owners of %s: %s\n"), - Prog, tcbdir, strerror (errno)); + shadow_progname, tcbdir, strerror (errno)); goto out_free; } if (chmod (tcbdir, 0700) != 0) { fprintf (shadow_logfd, _("%s: Cannot change mode of %s: %s\n"), - Prog, tcbdir, strerror (errno)); + shadow_progname, tcbdir, strerror (errno)); goto out_free; } if (lstat (shadow, &filemode) != 0) { if (errno != ENOENT) { fprintf (shadow_logfd, _("%s: Cannot lstat %s: %s\n"), - Prog, shadow, strerror (errno)); + shadow_progname, shadow, strerror (errno)); goto out_free; } fprintf (shadow_logfd, _("%s: Warning, user %s has no tcb shadow file.\n"), - Prog, user_newname); + shadow_progname, user_newname); } else { if (!S_ISREG (filemode.st_mode) || filemode.st_nlink != 1) { @@ -498,19 +485,19 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_ _("%s: Emergency: %s's tcb shadow is not a " "regular file with st_nlink=1.\n" "The account is left locked.\n"), - Prog, user_newname); + shadow_progname, user_newname); goto out_free; } if (chown (shadow, user_newid, filemode.st_gid) != 0) { fprintf (shadow_logfd, _("%s: Cannot change owner of %s: %s\n"), - Prog, shadow, strerror (errno)); + shadow_progname, shadow, strerror (errno)); goto out_free; } if (chmod (shadow, filemode.st_mode & 07777) != 0) { fprintf (shadow_logfd, _("%s: Cannot change mode of %s: %s\n"), - Prog, shadow, strerror (errno)); + shadow_progname, shadow, strerror (errno)); goto out_free; } } @@ -520,7 +507,13 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_ if (chown (tcbdir, user_newid, dirmode.st_gid) != 0) { fprintf (shadow_logfd, _("%s: Cannot change owner of %s: %s\n"), - Prog, tcbdir, strerror (errno)); + shadow_progname, tcbdir, strerror (errno)); + goto out_free; + } + if (chmod (tcbdir, dirmode.st_mode & 07777) != 0) { + fprintf (shadow_logfd, + _("%s: Cannot change mode of %s: %s\n"), + shadow_progname, tcbdir, strerror (errno)); goto out_free; } ret = SHADOWTCB_SUCCESS; @@ -545,7 +538,7 @@ shadowtcb_status shadowtcb_create (const char *name, uid_t uid) if (stat (TCB_DIR, &tcbdir_stat) != 0) { fprintf (shadow_logfd, _("%s: Cannot stat %s: %s\n"), - Prog, TCB_DIR, strerror (errno)); + shadow_progname, TCB_DIR, strerror (errno)); return SHADOWTCB_FAILURE; } shadowgid = tcbdir_stat.st_gid; @@ -565,39 +558,39 @@ shadowtcb_status shadowtcb_create (const char *name, uid_t uid) if (mkdir (dir, 0700) != 0) { fprintf (shadow_logfd, _("%s: mkdir: %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); goto out_free; } fd = open (shadow, O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd < 0) { fprintf (shadow_logfd, _("%s: Cannot open %s: %s\n"), - Prog, shadow, strerror (errno)); + shadow_progname, shadow, strerror (errno)); goto out_free; } close (fd); if (chown (shadow, 0, authgid) != 0) { fprintf (shadow_logfd, _("%s: Cannot change owner of %s: %s\n"), - Prog, shadow, strerror (errno)); + shadow_progname, shadow, strerror (errno)); goto out_free; } if (chmod (shadow, (mode_t) ((authgid == shadowgid) ? 0600 : 0640)) != 0) { fprintf (shadow_logfd, _("%s: Cannot change mode of %s: %s\n"), - Prog, shadow, strerror (errno)); + shadow_progname, shadow, strerror (errno)); goto out_free; } if (chown (dir, 0, authgid) != 0) { fprintf (shadow_logfd, _("%s: Cannot change owner of %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); goto out_free; } if (chmod (dir, (mode_t) ((authgid == shadowgid) ? 02700 : 02710)) != 0) { fprintf (shadow_logfd, _("%s: Cannot change mode of %s: %s\n"), - Prog, dir, strerror (errno)); + shadow_progname, dir, strerror (errno)); goto out_free; } if ( (shadowtcb_set_user (name) == SHADOWTCB_FAILURE) diff --git a/lib/utent.c b/lib/utent.c index 45af2607..d5e6daea 100644 --- a/lib/utent.c +++ b/lib/utent.c @@ -1,32 +1,9 @@ /* - * Copyright (c) 1993 - 1994, Julianne Frances Haugh - * Copyright (c) 1996 - 1998, Marek Michałkiewicz - * Copyright (c) 2005 , Tomasz Kłoczko - * All rights reserved. + * SPDX-FileCopyrightText: 1993 - 1994, Julianne Frances Haugh + * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz + * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the copyright holders or contributors may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #include <config.h> |