summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBalint Reczey <balint@balintreczey.hu>2016-11-30 02:36:06 +0100
committerBalint Reczey <balint@balintreczey.hu>2016-11-30 02:36:06 +0100
commit365658d0f3a51814626afbb70aa2dd7b5e82ac36 (patch)
tree7218fb9147359258fda0f9a43da5a29b2d20e85b /src
parentbfaa59229d61adb7fa0c570f0d94fd324c6e05aa (diff)
downloadshadow-365658d0f3a51814626afbb70aa2dd7b5e82ac36.tar.gz
Imported Upstream version 4.4upstream/4.4
Diffstat (limited to 'src')
-rw-r--r--src/.gitignore35
-rw-r--r--src/Makefile.am6
-rw-r--r--src/Makefile.in1239
-rw-r--r--src/chage.c4
-rw-r--r--src/chfn.c2
-rw-r--r--src/chgpasswd.c4
-rw-r--r--src/chpasswd.c4
-rw-r--r--src/chsh.c2
-rw-r--r--src/expiry.c2
-rw-r--r--src/gpasswd.c9
-rw-r--r--src/groupadd.c4
-rw-r--r--src/groupdel.c15
-rw-r--r--src/groupmems.c4
-rw-r--r--src/groupmod.c6
-rw-r--r--src/grpck.c4
-rw-r--r--src/grpconv.c2
-rw-r--r--src/grpunconv.c2
-rw-r--r--src/lastlog.c115
-rw-r--r--src/login.c11
-rw-r--r--src/newgidmap.c13
-rw-r--r--src/newgrp.c9
-rw-r--r--src/newuidmap.c13
-rw-r--r--src/newusers.c16
-rw-r--r--src/passwd.c4
-rw-r--r--src/pwck.c6
-rw-r--r--src/pwconv.c5
-rw-r--r--src/pwunconv.c2
-rw-r--r--src/su.c21
-rw-r--r--src/sulogin.c2
-rw-r--r--src/useradd.c20
-rw-r--r--src/userdel.c12
-rw-r--r--src/usermod.c128
32 files changed, 327 insertions, 1394 deletions
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 00000000..d5716b98
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,35 @@
+/chage
+/chfn
+/chgpasswd
+/chpasswd
+/chsh
+/expiry
+/faillog
+/gpasswd
+/groupadd
+/groupdel
+/groupmems
+/groupmod
+/groups
+/grpck
+/grpconv
+/grpunconv
+/id
+/lastlog
+/login
+/logoutd
+/newgrp
+/newgidmap
+/newuidmap
+/newusers
+/nologin
+/passwd
+/pwck
+/pwconv
+/pwunconv
+/su
+/sulogin
+/useradd
+/userdel
+/usermod
+/vipw
diff --git a/src/Makefile.am b/src/Makefile.am
index 25e288d3..dc520b5d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,10 +52,13 @@ usbin_PROGRAMS = \
noinst_PROGRAMS = id sulogin
suidbins = su
-suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
+suidubins = chage chfn chsh expiry gpasswd newgrp passwd
if ACCT_TOOLS_SETUID
suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
endif
+if ENABLE_SUBIDS
+ suidubins += newgidmap newuidmap
+endif
if WITH_TCB
suidubins -= passwd
@@ -95,6 +98,7 @@ groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
grpck_LDADD = $(LDADD) $(LIBSELINUX)
grpconv_LDADD = $(LDADD) $(LIBSELINUX)
grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
+lastlog_LDADD = $(LDADD) $(LIBAUDIT)
login_SOURCES = \
login.c \
login_nopam.c
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644
index d846ea9d..00000000
--- a/src/Makefile.in
+++ /dev/null
@@ -1,1239 +0,0 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = groups$(EXEEXT) login$(EXEEXT) su$(EXEEXT)
-sbin_PROGRAMS = nologin$(EXEEXT)
-ubin_PROGRAMS = faillog$(EXEEXT) lastlog$(EXEEXT) chage$(EXEEXT) \
- chfn$(EXEEXT) chsh$(EXEEXT) expiry$(EXEEXT) gpasswd$(EXEEXT) \
- newgrp$(EXEEXT) passwd$(EXEEXT) $(am__EXEEXT_1)
-@ENABLE_SUBIDS_TRUE@am__append_1 = newgidmap newuidmap
-usbin_PROGRAMS = chgpasswd$(EXEEXT) chpasswd$(EXEEXT) \
- groupadd$(EXEEXT) groupdel$(EXEEXT) groupmems$(EXEEXT) \
- groupmod$(EXEEXT) grpck$(EXEEXT) grpconv$(EXEEXT) \
- grpunconv$(EXEEXT) logoutd$(EXEEXT) newusers$(EXEEXT) \
- pwck$(EXEEXT) pwconv$(EXEEXT) pwunconv$(EXEEXT) \
- useradd$(EXEEXT) userdel$(EXEEXT) usermod$(EXEEXT) \
- vipw$(EXEEXT)
-noinst_PROGRAMS = id$(EXEEXT) sulogin$(EXEEXT)
-subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \
- "$(DESTDIR)$(ubindir)" "$(DESTDIR)$(usbindir)"
-@ENABLE_SUBIDS_TRUE@am__EXEEXT_1 = newgidmap$(EXEEXT) \
-@ENABLE_SUBIDS_TRUE@ newuidmap$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) \
- $(ubin_PROGRAMS) $(usbin_PROGRAMS)
-chage_SOURCES = chage.c
-chage_OBJECTS = chage.$(OBJEXT)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-@ACCT_TOOLS_SETUID_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
-chage_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-chfn_SOURCES = chfn.c
-chfn_OBJECTS = chfn.$(OBJEXT)
-@USE_PAM_FALSE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1)
-chfn_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-chgpasswd_SOURCES = chgpasswd.c
-chgpasswd_OBJECTS = chgpasswd.$(OBJEXT)
-chgpasswd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-chpasswd_SOURCES = chpasswd.c
-chpasswd_OBJECTS = chpasswd.$(OBJEXT)
-chpasswd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-chsh_SOURCES = chsh.c
-chsh_OBJECTS = chsh.$(OBJEXT)
-chsh_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-expiry_SOURCES = expiry.c
-expiry_OBJECTS = expiry.$(OBJEXT)
-expiry_LDADD = $(LDADD)
-expiry_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-faillog_SOURCES = faillog.c
-faillog_OBJECTS = faillog.$(OBJEXT)
-faillog_LDADD = $(LDADD)
-faillog_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-gpasswd_SOURCES = gpasswd.c
-gpasswd_OBJECTS = gpasswd.$(OBJEXT)
-gpasswd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-groupadd_SOURCES = groupadd.c
-groupadd_OBJECTS = groupadd.$(OBJEXT)
-groupadd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-groupdel_SOURCES = groupdel.c
-groupdel_OBJECTS = groupdel.$(OBJEXT)
-groupdel_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-groupmems_SOURCES = groupmems.c
-groupmems_OBJECTS = groupmems.$(OBJEXT)
-groupmems_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-groupmod_SOURCES = groupmod.c
-groupmod_OBJECTS = groupmod.$(OBJEXT)
-groupmod_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-groups_SOURCES = groups.c
-groups_OBJECTS = groups.$(OBJEXT)
-groups_LDADD = $(LDADD)
-groups_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-grpck_SOURCES = grpck.c
-grpck_OBJECTS = grpck.$(OBJEXT)
-grpck_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-grpconv_SOURCES = grpconv.c
-grpconv_OBJECTS = grpconv.$(OBJEXT)
-grpconv_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-grpunconv_SOURCES = grpunconv.c
-grpunconv_OBJECTS = grpunconv.$(OBJEXT)
-grpunconv_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-id_SOURCES = id.c
-id_OBJECTS = id.$(OBJEXT)
-id_LDADD = $(LDADD)
-id_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-lastlog_SOURCES = lastlog.c
-lastlog_OBJECTS = lastlog.$(OBJEXT)
-lastlog_LDADD = $(LDADD)
-lastlog_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-am_login_OBJECTS = login.$(OBJEXT) login_nopam.$(OBJEXT)
-login_OBJECTS = $(am_login_OBJECTS)
-login_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-logoutd_SOURCES = logoutd.c
-logoutd_OBJECTS = logoutd.$(OBJEXT)
-logoutd_LDADD = $(LDADD)
-logoutd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-newgidmap_SOURCES = newgidmap.c
-newgidmap_OBJECTS = newgidmap.$(OBJEXT)
-newgidmap_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-newgrp_SOURCES = newgrp.c
-newgrp_OBJECTS = newgrp.$(OBJEXT)
-newgrp_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-newuidmap_SOURCES = newuidmap.c
-newuidmap_OBJECTS = newuidmap.$(OBJEXT)
-newuidmap_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-newusers_SOURCES = newusers.c
-newusers_OBJECTS = newusers.$(OBJEXT)
-newusers_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-nologin_SOURCES = nologin.c
-nologin_OBJECTS = nologin.$(OBJEXT)
-nologin_DEPENDENCIES =
-passwd_SOURCES = passwd.c
-passwd_OBJECTS = passwd.$(OBJEXT)
-passwd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4)
-pwck_SOURCES = pwck.c
-pwck_OBJECTS = pwck.$(OBJEXT)
-pwck_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-pwconv_SOURCES = pwconv.c
-pwconv_OBJECTS = pwconv.$(OBJEXT)
-pwconv_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-pwunconv_SOURCES = pwunconv.c
-pwunconv_OBJECTS = pwunconv.$(OBJEXT)
-pwunconv_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-am_su_OBJECTS = su.$(OBJEXT) suauth.$(OBJEXT)
-su_OBJECTS = $(am_su_OBJECTS)
-su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-sulogin_SOURCES = sulogin.c
-sulogin_OBJECTS = sulogin.$(OBJEXT)
-sulogin_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-useradd_SOURCES = useradd.c
-useradd_OBJECTS = useradd.$(OBJEXT)
-useradd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-userdel_SOURCES = userdel.c
-userdel_OBJECTS = userdel.$(OBJEXT)
-userdel_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-usermod_SOURCES = usermod.c
-usermod_OBJECTS = usermod.$(OBJEXT)
-usermod_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-vipw_SOURCES = vipw.c
-vipw_OBJECTS = vipw.$(OBJEXT)
-vipw_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-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__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = chage.c chfn.c chgpasswd.c chpasswd.c chsh.c expiry.c \
- faillog.c gpasswd.c groupadd.c groupdel.c groupmems.c \
- groupmod.c groups.c grpck.c grpconv.c grpunconv.c id.c \
- lastlog.c $(login_SOURCES) logoutd.c newgidmap.c newgrp.c \
- newuidmap.c newusers.c nologin.c passwd.c pwck.c pwconv.c \
- pwunconv.c $(su_SOURCES) sulogin.c useradd.c userdel.c \
- usermod.c vipw.c
-DIST_SOURCES = chage.c chfn.c chgpasswd.c chpasswd.c chsh.c expiry.c \
- faillog.c gpasswd.c groupadd.c groupdel.c groupmems.c \
- groupmod.c groups.c grpck.c grpconv.c grpunconv.c id.c \
- lastlog.c $(login_SOURCES) logoutd.c newgidmap.c newgrp.c \
- newuidmap.c newusers.c nologin.c passwd.c pwck.c pwconv.c \
- pwunconv.c $(su_SOURCES) sulogin.c useradd.c userdel.c \
- usermod.c vipw.c
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
-GMSGFMT = @GMSGFMT@
-GMSGFMT_015 = @GMSGFMT_015@
-GREP = @GREP@
-GROUP_NAME_MAX_LENGTH = @GROUP_NAME_MAX_LENGTH@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTLLIBS = @INTLLIBS@
-INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBACL = @LIBACL@
-LIBATTR = @LIBATTR@
-LIBAUDIT = @LIBAUDIT@
-LIBCRACK = @LIBCRACK@
-LIBCRYPT = @LIBCRYPT@
-LIBICONV = @LIBICONV@
-LIBINTL = @LIBINTL@
-LIBMD = @LIBMD@
-LIBOBJS = @LIBOBJS@
-LIBPAM = @LIBPAM@
-LIBS = @LIBS@
-LIBSELINUX = @LIBSELINUX@
-LIBSEMANAGE = @LIBSEMANAGE@
-LIBSKEY = @LIBSKEY@
-LIBTCB = @LIBTCB@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBINTL = @LTLIBINTL@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
-MSGMERGE = @MSGMERGE@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-XGETTEXT = @XGETTEXT@
-XGETTEXT_015 = @XGETTEXT_015@
-XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
-XMLCATALOG = @XMLCATALOG@
-XML_CATALOG_FILE = @XML_CATALOG_FILE@
-XSLTPROC = @XSLTPROC@
-YACC = @YACC@
-YFLAGS = @YFLAGS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = \
- .indent.pro
-
-ubindir = ${prefix}/bin
-usbindir = ${prefix}/sbin
-suidperms = 4755
-sgidperms = 2755
-INCLUDES = \
- -I${top_srcdir}/lib \
- -I$(top_srcdir)/libmisc
-
-suidbins = su
-suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
-@WITH_TCB_TRUE@shadowsgidubins = passwd
-LDADD = $(INTLLIBS) \
- $(LIBTCB) \
- $(top_builddir)/libmisc/libmisc.a \
- $(top_builddir)/lib/libshadow.la
-
-AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\"
-@ACCT_TOOLS_SETUID_FALSE@LIBPAM_SUID =
-@ACCT_TOOLS_SETUID_TRUE@LIBPAM_SUID = $(LIBPAM)
-@USE_PAM_FALSE@LIBCRYPT_NOPAM = $(LIBCRYPT)
-@USE_PAM_TRUE@LIBCRYPT_NOPAM =
-chage_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
-newuidmap_LDADD = $(LDADD) $(LIBSELINUX)
-newgidmap_LDADD = $(LDADD) $(LIBSELINUX)
-chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
-chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
-chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
-chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
-gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
-groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
-groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
-groupmems_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX)
-groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
-grpck_LDADD = $(LDADD) $(LIBSELINUX)
-grpconv_LDADD = $(LDADD) $(LIBSELINUX)
-grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
-login_SOURCES = \
- login.c \
- login_nopam.c
-
-login_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
-newgrp_LDADD = $(LDADD) $(LIBAUDIT) $(LIBCRYPT)
-newusers_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
-nologin_LDADD =
-passwd_LDADD = $(LDADD) $(LIBPAM) $(LIBCRACK) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM)
-pwck_LDADD = $(LDADD) $(LIBSELINUX)
-pwconv_LDADD = $(LDADD) $(LIBSELINUX)
-pwunconv_LDADD = $(LDADD) $(LIBSELINUX)
-su_SOURCES = \
- su.c \
- suauth.c
-
-su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
-sulogin_LDADD = $(LDADD) $(LIBCRYPT)
-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
-userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE)
-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
-vipw_LDADD = $(LDADD) $(LIBSELINUX)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *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);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(sbindir)" && rm -f $$files
-
-clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-ubinPROGRAMS: $(ubin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(ubin_PROGRAMS)'; test -n "$(ubindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(ubindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(ubindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(ubindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(ubindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-ubinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(ubin_PROGRAMS)'; test -n "$(ubindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(ubindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(ubindir)" && rm -f $$files
-
-clean-ubinPROGRAMS:
- @list='$(ubin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-usbinPROGRAMS: $(usbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(usbin_PROGRAMS)'; test -n "$(usbindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(usbindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(usbindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(usbindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usbindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-usbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(usbin_PROGRAMS)'; test -n "$(usbindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(usbindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(usbindir)" && rm -f $$files
-
-clean-usbinPROGRAMS:
- @list='$(usbin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
-chage$(EXEEXT): $(chage_OBJECTS) $(chage_DEPENDENCIES) $(EXTRA_chage_DEPENDENCIES)
- @rm -f chage$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(chage_OBJECTS) $(chage_LDADD) $(LIBS)
-
-chfn$(EXEEXT): $(chfn_OBJECTS) $(chfn_DEPENDENCIES) $(EXTRA_chfn_DEPENDENCIES)
- @rm -f chfn$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(chfn_OBJECTS) $(chfn_LDADD) $(LIBS)
-
-chgpasswd$(EXEEXT): $(chgpasswd_OBJECTS) $(chgpasswd_DEPENDENCIES) $(EXTRA_chgpasswd_DEPENDENCIES)
- @rm -f chgpasswd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(chgpasswd_OBJECTS) $(chgpasswd_LDADD) $(LIBS)
-
-chpasswd$(EXEEXT): $(chpasswd_OBJECTS) $(chpasswd_DEPENDENCIES) $(EXTRA_chpasswd_DEPENDENCIES)
- @rm -f chpasswd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(chpasswd_OBJECTS) $(chpasswd_LDADD) $(LIBS)
-
-chsh$(EXEEXT): $(chsh_OBJECTS) $(chsh_DEPENDENCIES) $(EXTRA_chsh_DEPENDENCIES)
- @rm -f chsh$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(chsh_OBJECTS) $(chsh_LDADD) $(LIBS)
-
-expiry$(EXEEXT): $(expiry_OBJECTS) $(expiry_DEPENDENCIES) $(EXTRA_expiry_DEPENDENCIES)
- @rm -f expiry$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(expiry_OBJECTS) $(expiry_LDADD) $(LIBS)
-
-faillog$(EXEEXT): $(faillog_OBJECTS) $(faillog_DEPENDENCIES) $(EXTRA_faillog_DEPENDENCIES)
- @rm -f faillog$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(faillog_OBJECTS) $(faillog_LDADD) $(LIBS)
-
-gpasswd$(EXEEXT): $(gpasswd_OBJECTS) $(gpasswd_DEPENDENCIES) $(EXTRA_gpasswd_DEPENDENCIES)
- @rm -f gpasswd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(gpasswd_OBJECTS) $(gpasswd_LDADD) $(LIBS)
-
-groupadd$(EXEEXT): $(groupadd_OBJECTS) $(groupadd_DEPENDENCIES) $(EXTRA_groupadd_DEPENDENCIES)
- @rm -f groupadd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(groupadd_OBJECTS) $(groupadd_LDADD) $(LIBS)
-
-groupdel$(EXEEXT): $(groupdel_OBJECTS) $(groupdel_DEPENDENCIES) $(EXTRA_groupdel_DEPENDENCIES)
- @rm -f groupdel$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(groupdel_OBJECTS) $(groupdel_LDADD) $(LIBS)
-
-groupmems$(EXEEXT): $(groupmems_OBJECTS) $(groupmems_DEPENDENCIES) $(EXTRA_groupmems_DEPENDENCIES)
- @rm -f groupmems$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(groupmems_OBJECTS) $(groupmems_LDADD) $(LIBS)
-
-groupmod$(EXEEXT): $(groupmod_OBJECTS) $(groupmod_DEPENDENCIES) $(EXTRA_groupmod_DEPENDENCIES)
- @rm -f groupmod$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(groupmod_OBJECTS) $(groupmod_LDADD) $(LIBS)
-
-groups$(EXEEXT): $(groups_OBJECTS) $(groups_DEPENDENCIES) $(EXTRA_groups_DEPENDENCIES)
- @rm -f groups$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(groups_OBJECTS) $(groups_LDADD) $(LIBS)
-
-grpck$(EXEEXT): $(grpck_OBJECTS) $(grpck_DEPENDENCIES) $(EXTRA_grpck_DEPENDENCIES)
- @rm -f grpck$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(grpck_OBJECTS) $(grpck_LDADD) $(LIBS)
-
-grpconv$(EXEEXT): $(grpconv_OBJECTS) $(grpconv_DEPENDENCIES) $(EXTRA_grpconv_DEPENDENCIES)
- @rm -f grpconv$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(grpconv_OBJECTS) $(grpconv_LDADD) $(LIBS)
-
-grpunconv$(EXEEXT): $(grpunconv_OBJECTS) $(grpunconv_DEPENDENCIES) $(EXTRA_grpunconv_DEPENDENCIES)
- @rm -f grpunconv$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(grpunconv_OBJECTS) $(grpunconv_LDADD) $(LIBS)
-
-id$(EXEEXT): $(id_OBJECTS) $(id_DEPENDENCIES) $(EXTRA_id_DEPENDENCIES)
- @rm -f id$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(id_OBJECTS) $(id_LDADD) $(LIBS)
-
-lastlog$(EXEEXT): $(lastlog_OBJECTS) $(lastlog_DEPENDENCIES) $(EXTRA_lastlog_DEPENDENCIES)
- @rm -f lastlog$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(lastlog_OBJECTS) $(lastlog_LDADD) $(LIBS)
-
-login$(EXEEXT): $(login_OBJECTS) $(login_DEPENDENCIES) $(EXTRA_login_DEPENDENCIES)
- @rm -f login$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(login_OBJECTS) $(login_LDADD) $(LIBS)
-
-logoutd$(EXEEXT): $(logoutd_OBJECTS) $(logoutd_DEPENDENCIES) $(EXTRA_logoutd_DEPENDENCIES)
- @rm -f logoutd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(logoutd_OBJECTS) $(logoutd_LDADD) $(LIBS)
-
-newgidmap$(EXEEXT): $(newgidmap_OBJECTS) $(newgidmap_DEPENDENCIES) $(EXTRA_newgidmap_DEPENDENCIES)
- @rm -f newgidmap$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(newgidmap_OBJECTS) $(newgidmap_LDADD) $(LIBS)
-
-newgrp$(EXEEXT): $(newgrp_OBJECTS) $(newgrp_DEPENDENCIES) $(EXTRA_newgrp_DEPENDENCIES)
- @rm -f newgrp$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(newgrp_OBJECTS) $(newgrp_LDADD) $(LIBS)
-
-newuidmap$(EXEEXT): $(newuidmap_OBJECTS) $(newuidmap_DEPENDENCIES) $(EXTRA_newuidmap_DEPENDENCIES)
- @rm -f newuidmap$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(newuidmap_OBJECTS) $(newuidmap_LDADD) $(LIBS)
-
-newusers$(EXEEXT): $(newusers_OBJECTS) $(newusers_DEPENDENCIES) $(EXTRA_newusers_DEPENDENCIES)
- @rm -f newusers$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(newusers_OBJECTS) $(newusers_LDADD) $(LIBS)
-
-nologin$(EXEEXT): $(nologin_OBJECTS) $(nologin_DEPENDENCIES) $(EXTRA_nologin_DEPENDENCIES)
- @rm -f nologin$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(nologin_OBJECTS) $(nologin_LDADD) $(LIBS)
-
-passwd$(EXEEXT): $(passwd_OBJECTS) $(passwd_DEPENDENCIES) $(EXTRA_passwd_DEPENDENCIES)
- @rm -f passwd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(passwd_OBJECTS) $(passwd_LDADD) $(LIBS)
-
-pwck$(EXEEXT): $(pwck_OBJECTS) $(pwck_DEPENDENCIES) $(EXTRA_pwck_DEPENDENCIES)
- @rm -f pwck$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(pwck_OBJECTS) $(pwck_LDADD) $(LIBS)
-
-pwconv$(EXEEXT): $(pwconv_OBJECTS) $(pwconv_DEPENDENCIES) $(EXTRA_pwconv_DEPENDENCIES)
- @rm -f pwconv$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(pwconv_OBJECTS) $(pwconv_LDADD) $(LIBS)
-
-pwunconv$(EXEEXT): $(pwunconv_OBJECTS) $(pwunconv_DEPENDENCIES) $(EXTRA_pwunconv_DEPENDENCIES)
- @rm -f pwunconv$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(pwunconv_OBJECTS) $(pwunconv_LDADD) $(LIBS)
-
-su$(EXEEXT): $(su_OBJECTS) $(su_DEPENDENCIES) $(EXTRA_su_DEPENDENCIES)
- @rm -f su$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS)
-
-sulogin$(EXEEXT): $(sulogin_OBJECTS) $(sulogin_DEPENDENCIES) $(EXTRA_sulogin_DEPENDENCIES)
- @rm -f sulogin$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sulogin_OBJECTS) $(sulogin_LDADD) $(LIBS)
-
-useradd$(EXEEXT): $(useradd_OBJECTS) $(useradd_DEPENDENCIES) $(EXTRA_useradd_DEPENDENCIES)
- @rm -f useradd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(useradd_OBJECTS) $(useradd_LDADD) $(LIBS)
-
-userdel$(EXEEXT): $(userdel_OBJECTS) $(userdel_DEPENDENCIES) $(EXTRA_userdel_DEPENDENCIES)
- @rm -f userdel$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(userdel_OBJECTS) $(userdel_LDADD) $(LIBS)
-
-usermod$(EXEEXT): $(usermod_OBJECTS) $(usermod_DEPENDENCIES) $(EXTRA_usermod_DEPENDENCIES)
- @rm -f usermod$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(usermod_OBJECTS) $(usermod_LDADD) $(LIBS)
-
-vipw$(EXEEXT): $(vipw_OBJECTS) $(vipw_DEPENDENCIES) $(EXTRA_vipw_DEPENDENCIES)
- @rm -f vipw$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(vipw_OBJECTS) $(vipw_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chage.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chfn.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgpasswd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chpasswd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chsh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expiry.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faillog.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpasswd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groupadd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groupdel.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groupmems.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groupmod.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groups.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grpck.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grpconv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grpunconv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lastlog.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/login.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/login_nopam.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logoutd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newgidmap.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newgrp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newuidmap.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newusers.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nologin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwck.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwconv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwunconv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suauth.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sulogin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/useradd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userdel.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usermod.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vipw.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(ubindir)" "$(DESTDIR)$(usbindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool \
- clean-noinstPROGRAMS clean-sbinPROGRAMS clean-ubinPROGRAMS \
- clean-usbinPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-ubinPROGRAMS install-usbinPROGRAMS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS \
- uninstall-ubinPROGRAMS uninstall-usbinPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
- clean-binPROGRAMS clean-generic clean-libtool \
- clean-noinstPROGRAMS clean-sbinPROGRAMS clean-ubinPROGRAMS \
- clean-usbinPROGRAMS 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-binPROGRAMS 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-sbinPROGRAMS install-strip \
- install-ubinPROGRAMS install-usbinPROGRAMS 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 uninstall-binPROGRAMS \
- uninstall-sbinPROGRAMS uninstall-ubinPROGRAMS \
- uninstall-usbinPROGRAMS
-
-@ACCT_TOOLS_SETUID_TRUE@ suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
-
-@WITH_TCB_TRUE@suidubins -= passwd
-
-install-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
- ln -sf newgrp $(DESTDIR)$(ubindir)/sg
- ln -sf vipw $(DESTDIR)$(usbindir)/vigr
- for i in $(suidbins); do \
- chmod -f $(suidperms) $(DESTDIR)$(bindir)/$$i; \
- done
- for i in $(suidubins); do \
- chmod -f $(suidperms) $(DESTDIR)$(ubindir)/$$i; \
- done
-@WITH_TCB_TRUE@ for i in $(shadowsgidubins); do \
-@WITH_TCB_TRUE@ chown root:shadow $(DESTDIR)$(ubindir)/$$i; \
-@WITH_TCB_TRUE@ chmod -f $(sgidperms) $(DESTDIR)$(ubindir)/$$i; \
-@WITH_TCB_TRUE@ done
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/chage.c b/src/chage.c
index 2df65a94..617e90f1 100644
--- a/src/chage.c
+++ b/src/chage.c
@@ -592,7 +592,7 @@ static void open_files (bool readonly)
}
pw_locked = true;
}
- if (pw_open (readonly ? O_RDONLY: O_RDWR) == 0) {
+ if (pw_open (readonly ? O_RDONLY: O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_WARN, "cannot open %s", pw_dbname ()));
fail_exit (E_NOPERM);
@@ -613,7 +613,7 @@ static void open_files (bool readonly)
}
spw_locked = true;
}
- if (spw_open (readonly ? O_RDONLY: O_RDWR) == 0) {
+ if (spw_open (readonly ? O_RDONLY: O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, spw_dbname ());
SYSLOG ((LOG_WARN, "cannot open %s", spw_dbname ()));
diff --git a/src/chfn.c b/src/chfn.c
index a022c1a3..18aa3de7 100644
--- a/src/chfn.c
+++ b/src/chfn.c
@@ -463,7 +463,7 @@ static void update_gecos (const char *user, char *gecos)
fail_exit (E_NOPERM);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (E_NOPERM);
diff --git a/src/chgpasswd.c b/src/chgpasswd.c
index 4dd5fbab..13203a46 100644
--- a/src/chgpasswd.c
+++ b/src/chgpasswd.c
@@ -316,7 +316,7 @@ static void open_files (void)
fail_exit (1);
}
gr_locked = true;
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, gr_dbname ());
fail_exit (1);
@@ -332,7 +332,7 @@ static void open_files (void)
fail_exit (1);
}
sgr_locked = true;
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"),
Prog, sgr_dbname ());
fail_exit (1);
diff --git a/src/chpasswd.c b/src/chpasswd.c
index 78436d6a..21008f58 100644
--- a/src/chpasswd.c
+++ b/src/chpasswd.c
@@ -313,7 +313,7 @@ static void open_files (void)
fail_exit (1);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (1);
@@ -328,7 +328,7 @@ static void open_files (void)
fail_exit (1);
}
spw_locked = true;
- if (spw_open (O_RDWR) == 0) {
+ if (spw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
diff --git a/src/chsh.c b/src/chsh.c
index 393a79ff..c89708b9 100644
--- a/src/chsh.c
+++ b/src/chsh.c
@@ -373,7 +373,7 @@ static void update_shell (const char *user, char *newshell)
fail_exit (1);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_WARN, "cannot open %s", pw_dbname ()));
fail_exit (1);
diff --git a/src/expiry.c b/src/expiry.c
index 4ae47703..41add942 100644
--- a/src/expiry.c
+++ b/src/expiry.c
@@ -58,7 +58,7 @@ static void process_flags (int argc, char **argv);
*/
static RETSIGTYPE catch_signals (unused int sig)
{
- exit (10);
+ _exit (10);
}
/*
diff --git a/src/gpasswd.c b/src/gpasswd.c
index 8959a35a..c4a492b1 100644
--- a/src/gpasswd.c
+++ b/src/gpasswd.c
@@ -169,9 +169,8 @@ static RETSIGTYPE catch_signals (int killed)
}
if (0 != killed) {
- (void) putchar ('\n');
- (void) fflush (stdout);
- exit (killed);
+ (void) write (STDOUT_FILENO, "\n", 1);
+ _exit (killed);
}
}
@@ -370,7 +369,7 @@ static void open_files (void)
add_cleanup (log_gpasswd_failure_system, NULL);
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, gr_dbname ());
@@ -380,7 +379,7 @@ static void open_files (void)
#ifdef SHADOWGRP
if (is_shadowgrp) {
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
diff --git a/src/groupadd.c b/src/groupadd.c
index 39b4ec02..179438fb 100644
--- a/src/groupadd.c
+++ b/src/groupadd.c
@@ -346,7 +346,7 @@ static void open_files (void)
add_cleanup (cleanup_report_add_group, group_name);
/* And now open the databases */
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
exit (E_GRP_UPDATE);
@@ -354,7 +354,7 @@ static void open_files (void)
#ifdef SHADOWGRP
if (is_shadow_grp) {
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
diff --git a/src/groupdel.c b/src/groupdel.c
index da993475..11e522b1 100644
--- a/src/groupdel.c
+++ b/src/groupdel.c
@@ -60,6 +60,7 @@ const char *Prog;
static char *group_name;
static gid_t group_id = -1;
+static bool check_group_busy = true;
#ifdef SHADOWGRP
static bool is_shadow_grp;
@@ -96,6 +97,7 @@ static /*@noreturn@*/void usage (int status)
Prog);
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
(void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -f, --force delete group even if it is the primary group of a user\n"), usageout);
(void) fputs ("\n", usageout);
exit (status);
}
@@ -246,7 +248,7 @@ static void open_files (void)
add_cleanup (cleanup_report_del_group, group_name);
/* An now open the databases */
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, gr_dbname ());
@@ -255,7 +257,7 @@ static void open_files (void)
}
#ifdef SHADOWGRP
if (is_shadow_grp) {
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
@@ -321,7 +323,7 @@ static void process_flags (int argc, char **argv)
{NULL, 0, NULL, '\0'}
};
- while ((c = getopt_long (argc, argv, "hR:",
+ while ((c = getopt_long (argc, argv, "hfR:",
long_options, NULL)) != -1) {
switch (c) {
case 'h':
@@ -329,6 +331,9 @@ static void process_flags (int argc, char **argv)
/*@notreached@*/break;
case 'R': /* no-op, handled in process_root_flag () */
break;
+ case 'f':
+ check_group_busy = false;
+ break;
default:
usage (E_USAGE);
}
@@ -465,7 +470,9 @@ int main (int argc, char **argv)
/*
* Make sure this isn't the primary group of anyone.
*/
- group_busy (group_id);
+ if (check_group_busy) {
+ group_busy (group_id);
+ }
/*
* Do the hard stuff - open the files, delete the group entries,
diff --git a/src/groupmems.c b/src/groupmems.c
index e4f107f9..4a49e10b 100644
--- a/src/groupmems.c
+++ b/src/groupmems.c
@@ -536,14 +536,14 @@ static void open_files (void)
#endif
}
- if (gr_open (list ? O_RDONLY : O_RDWR) == 0) {
+ if (gr_open (list ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
fail_exit (EXIT_GROUP_FILE);
}
#ifdef SHADOWGRP
if (is_shadowgrp) {
- if (sgr_open (list ? O_RDONLY : O_RDWR) == 0) {
+ if (sgr_open (list ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
fail_exit (EXIT_GROUP_FILE);
}
diff --git a/src/groupmod.c b/src/groupmod.c
index d9d38071..757c1a40 100644
--- a/src/groupmod.c
+++ b/src/groupmod.c
@@ -663,7 +663,7 @@ static void lock_files (void)
*/
static void open_files (void)
{
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
exit (E_GRP_UPDATE);
@@ -672,7 +672,7 @@ static void open_files (void)
#ifdef SHADOWGRP
if ( is_shadow_grp
&& (pflg || nflg)) {
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
@@ -683,7 +683,7 @@ static void open_files (void)
#endif /* SHADOWGRP */
if (gflg) {
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, pw_dbname ());
diff --git a/src/grpck.c b/src/grpck.c
index 9d1ed903..ea5d3b39 100644
--- a/src/grpck.c
+++ b/src/grpck.c
@@ -299,7 +299,7 @@ static void open_files (void)
* Open the files. Use O_RDONLY if we are in read_only mode,
* O_RDWR otherwise.
*/
- if (gr_open (read_only ? O_RDONLY : O_RDWR) == 0) {
+ if (gr_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog,
grp_file);
if (use_system_grp_file) {
@@ -308,7 +308,7 @@ static void open_files (void)
fail_exit (E_CANT_OPEN);
}
#ifdef SHADOWGRP
- if (is_shadow && (sgr_open (read_only ? O_RDONLY : O_RDWR) == 0)) {
+ if (is_shadow && (sgr_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0)) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog,
sgr_file);
if (use_system_sgr_file) {
diff --git a/src/grpconv.c b/src/grpconv.c
index ece8095d..f681f07f 100644
--- a/src/grpconv.c
+++ b/src/grpconv.c
@@ -163,7 +163,7 @@ int main (int argc, char **argv)
fail_exit (5);
}
gr_locked = true;
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
fail_exit (1);
}
diff --git a/src/grpunconv.c b/src/grpunconv.c
index ea8914cb..253f06f5 100644
--- a/src/grpunconv.c
+++ b/src/grpunconv.c
@@ -166,7 +166,7 @@ int main (int argc, char **argv)
fail_exit (5);
}
gr_locked = true;
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, gr_dbname ());
fail_exit (1);
diff --git a/src/lastlog.c b/src/lastlog.c
index ed9484aa..965691db 100644
--- a/src/lastlog.c
+++ b/src/lastlog.c
@@ -71,6 +71,8 @@ static struct stat statbuf; /* fstat buffer for file size */
static bool uflg = false; /* print only an user of range of users */
static bool tflg = false; /* print is restricted to most recent days */
static bool bflg = false; /* print excludes most recent days */
+static bool Cflg = false; /* clear record for user */
+static bool Sflg = false; /* set record for user */
#define NOW (time ((time_t *) 0))
@@ -83,8 +85,10 @@ static /*@noreturn@*/void usage (int status)
"Options:\n"),
Prog);
(void) fputs (_(" -b, --before DAYS print only lastlog records older than DAYS\n"), usageout);
+ (void) fputs (_(" -C, --clear clear lastlog record of an user (usable only with -u)\n"), usageout);
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
(void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -S, --set set lastlog record to current time (usable only with -u)\n"), usageout);
(void) fputs (_(" -t, --time DAYS print only lastlog records more recent than DAYS\n"), usageout);
(void) fputs (_(" -u, --user LOGIN print lastlog record of the specified LOGIN\n"), usageout);
(void) fputs ("\n", usageout);
@@ -194,6 +198,80 @@ static void print (void)
}
}
+static void update_one (/*@null@*/const struct passwd *pw)
+{
+ off_t offset;
+ struct lastlog ll;
+ int err;
+
+ if (NULL == pw) {
+ return;
+ }
+
+ offset = (off_t) pw->pw_uid * sizeof (ll);
+ /* fseeko errors are not really relevant for us. */
+ err = fseeko (lastlogfile, offset, SEEK_SET);
+ assert (0 == err);
+
+ memzero (&ll, sizeof (ll));
+
+ if (Sflg) {
+ ll.ll_time = NOW;
+#ifdef HAVE_LL_HOST
+ strcpy (ll.ll_host, "localhost");
+#endif
+ strcpy (ll.ll_line, "lastlog");
+#ifdef WITH_AUDIT
+ audit_logger (AUDIT_ACCT_UNLOCK, Prog,
+ "clearing-lastlog",
+ pw->pw_name, (unsigned int) pw->pw_uid, SHADOW_AUDIT_SUCCESS);
+#endif
+ }
+#ifdef WITH_AUDIT
+ else {
+ audit_logger (AUDIT_ACCT_UNLOCK, Prog,
+ "refreshing-lastlog",
+ pw->pw_name, (unsigned int) pw->pw_uid, SHADOW_AUDIT_SUCCESS);
+ }
+#endif
+
+ if (fwrite (&ll, sizeof(ll), 1, lastlogfile) != 1) {
+ fprintf (stderr,
+ _("%s: Failed to update the entry for UID %lu\n"),
+ Prog, (unsigned long int)pw->pw_uid);
+ exit (EXIT_FAILURE);
+ }
+}
+
+static void update (void)
+{
+ const struct passwd *pwent;
+
+ if (!uflg) /* safety measure */
+ return;
+
+ if (has_umin && has_umax && (umin == umax)) {
+ update_one (getpwuid ((uid_t)umin));
+ } else {
+ setpwent ();
+ while ( (pwent = getpwent ()) != NULL ) {
+ if ((has_umin && (pwent->pw_uid < (uid_t)umin))
+ || (has_umax && (pwent->pw_uid > (uid_t)umax))) {
+ continue;
+ }
+ update_one (pwent);
+ }
+ endpwent ();
+ }
+
+ if (fflush (lastlogfile) != 0 || fsync (fileno (lastlogfile)) != 0) {
+ fprintf (stderr,
+ _("%s: Failed to update the lastlog file\n"),
+ Prog);
+ exit (EXIT_FAILURE);
+ }
+}
+
int main (int argc, char **argv)
{
/*
@@ -208,18 +286,24 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
+#ifdef WITH_AUDIT
+ audit_help_open ();
+#endif
+
{
int c;
static struct option const longopts[] = {
{"before", required_argument, NULL, 'b'},
+ {"clear", no_argument, NULL, 'C'},
{"help", no_argument, NULL, 'h'},
{"root", required_argument, NULL, 'R'},
+ {"set", no_argument, NULL, 'S'},
{"time", required_argument, NULL, 't'},
{"user", required_argument, NULL, 'u'},
{NULL, 0, NULL, '\0'}
};
- while ((c = getopt_long (argc, argv, "b:hR:t:u:", longopts,
+ while ((c = getopt_long (argc, argv, "b:ChR:St:u:", longopts,
NULL)) != -1) {
switch (c) {
case 'b':
@@ -235,11 +319,21 @@ int main (int argc, char **argv)
bflg = true;
break;
}
+ case 'C':
+ {
+ Cflg = true;
+ break;
+ }
case 'h':
usage (EXIT_SUCCESS);
/*@notreached@*/break;
case 'R': /* no-op, handled in process_root_flag () */
break;
+ case 'S':
+ {
+ Sflg = true;
+ break;
+ }
case 't':
{
unsigned long days;
@@ -294,9 +388,21 @@ int main (int argc, char **argv)
Prog, argv[optind]);
usage (EXIT_FAILURE);
}
+ if (Cflg && Sflg) {
+ fprintf (stderr,
+ _("%s: Option -C cannot be used together with option -S\n"),
+ Prog);
+ usage (EXIT_FAILURE);
+ }
+ if ((Cflg || Sflg) && !uflg) {
+ fprintf (stderr,
+ _("%s: Options -C and -S require option -u to specify the user\n"),
+ Prog);
+ usage (EXIT_FAILURE);
+ }
}
- lastlogfile = fopen (LASTLOG_FILE, "r");
+ lastlogfile = fopen (LASTLOG_FILE, (Cflg || Sflg)?"r+":"r");
if (NULL == lastlogfile) {
perror (LASTLOG_FILE);
exit (EXIT_FAILURE);
@@ -310,7 +416,10 @@ int main (int argc, char **argv)
exit (EXIT_FAILURE);
}
- print ();
+ if (Cflg || Sflg)
+ update ();
+ else
+ print ();
(void) fclose (lastlogfile);
diff --git a/src/login.c b/src/login.c
index d610844d..2d2e704e 100644
--- a/src/login.c
+++ b/src/login.c
@@ -103,7 +103,7 @@ static bool hflg = false;
static bool preauth_flag = false;
static bool amroot;
-static unsigned int timeout;
+static char tmsg[256];
/*
* External identifiers.
@@ -416,8 +416,8 @@ static void init_env (void)
static RETSIGTYPE alarm_handler (unused int sig)
{
- fprintf (stderr, _("\nLogin timed out after %u seconds.\n"), timeout);
- exit (0);
+ write (STDERR_FILENO, tmsg, strlen (tmsg));
+ _exit (0);
}
#ifdef USE_PAM
@@ -532,6 +532,7 @@ int main (int argc, char **argv)
bool is_console;
#endif
int err;
+ unsigned int timeout;
const char *cp;
const char *tmp;
char fromhost[512];
@@ -698,8 +699,10 @@ int main (int argc, char **argv)
top:
/* only allow ALARM sec. for login */
- (void) signal (SIGALRM, alarm_handler);
timeout = getdef_unum ("LOGIN_TIMEOUT", ALARM);
+ snprintf (tmsg, sizeof tmsg,
+ _("\nLogin timed out after %u seconds.\n"), timeout);
+ (void) signal (SIGALRM, alarm_handler);
if (timeout > 0) {
(void) alarm (timeout);
}
diff --git a/src/newgidmap.c b/src/newgidmap.c
index 1527a615..b1e33513 100644
--- a/src/newgidmap.c
+++ b/src/newgidmap.c
@@ -56,7 +56,7 @@ static bool verify_range(struct passwd *pw, struct map_range *range)
if (have_sub_gids(pw->pw_name, range->lower, range->count))
return true;
- /* Allow a process to map it's own gid */
+ /* Allow a process to map its own gid */
if ((range->count == 1) && (pw->pw_gid == range->lower))
return true;
@@ -94,7 +94,7 @@ static void usage(void)
*/
int main(int argc, char **argv)
{
- char proc_dir_name[PATH_MAX];
+ char proc_dir_name[32];
char *target_str;
pid_t target, parent;
int proc_dir_fd;
@@ -113,13 +113,14 @@ int main(int argc, char **argv)
if (argc < 2)
usage();
- /* Find the process that needs it's user namespace
+ /* Find the process that needs its user namespace
* gid mapping set.
*/
target_str = argv[1];
if (!get_pid(target_str, &target))
usage();
+ /* max string length is 6 + 10 + 1 + 1 = 18, allocate 32 bytes */
written = snprintf(proc_dir_name, sizeof(proc_dir_name), "/proc/%u/",
target);
if ((written <= 0) || (written >= sizeof(proc_dir_name))) {
@@ -160,8 +161,10 @@ int main(int argc, char **argv)
(getgid() != pw->pw_gid) ||
(pw->pw_uid != st.st_uid) ||
(pw->pw_gid != st.st_gid)) {
- fprintf(stderr, _( "%s: Target %u is owned by a different user\n" ),
- Prog, target);
+ fprintf(stderr, _( "%s: Target %u is owned by a different user: uid:%lu pw_uid:%lu st_uid:%lu, gid:%lu pw_gid:%lu st_gid:%lu\n" ),
+ Prog, target,
+ (unsigned long int)getuid(), (unsigned long int)pw->pw_uid, (unsigned long int)st.st_uid,
+ (unsigned long int)getgid(), (unsigned long int)pw->pw_gid, (unsigned long int)st.st_gid);
return EXIT_FAILURE;
}
diff --git a/src/newgrp.c b/src/newgrp.c
index 49dd1512..b8d3ddc8 100644
--- a/src/newgrp.c
+++ b/src/newgrp.c
@@ -255,12 +255,15 @@ static void syslog_sg (const char *name, const char *group)
{
const char *loginname = getlogin ();
const char *tty = ttyname (0);
+ char *free_login = NULL, *free_tty = NULL;
if (loginname != NULL) {
- loginname = xstrdup (loginname);
+ free_login = xstrdup (loginname);
+ loginname = free_login;
}
if (tty != NULL) {
- tty = xstrdup (tty);
+ free_tty = xstrdup (tty);
+ tty = free_tty;
}
if (loginname == NULL) {
@@ -372,6 +375,8 @@ static void syslog_sg (const char *name, const char *group)
(void) signal (SIGTTOU, SIG_DFL);
}
#endif /* USE_PAM */
+ free(free_login);
+ free(free_tty);
}
#endif /* USE_SYSLOG */
diff --git a/src/newuidmap.c b/src/newuidmap.c
index 69c50940..1ba25e7a 100644
--- a/src/newuidmap.c
+++ b/src/newuidmap.c
@@ -56,7 +56,7 @@ static bool verify_range(struct passwd *pw, struct map_range *range)
if (have_sub_uids(pw->pw_name, range->lower, range->count))
return true;
- /* Allow a process to map it's own uid */
+ /* Allow a process to map its own uid */
if ((range->count == 1) && (pw->pw_uid == range->lower))
return true;
@@ -94,7 +94,7 @@ void usage(void)
*/
int main(int argc, char **argv)
{
- char proc_dir_name[PATH_MAX];
+ char proc_dir_name[32];
char *target_str;
pid_t target, parent;
int proc_dir_fd;
@@ -113,13 +113,14 @@ int main(int argc, char **argv)
if (argc < 2)
usage();
- /* Find the process that needs it's user namespace
+ /* Find the process that needs its user namespace
* uid mapping set.
*/
target_str = argv[1];
if (!get_pid(target_str, &target))
usage();
+ /* max string length is 6 + 10 + 1 + 1 = 18, allocate 32 bytes */
written = snprintf(proc_dir_name, sizeof(proc_dir_name), "/proc/%u/",
target);
if ((written <= 0) || (written >= sizeof(proc_dir_name))) {
@@ -160,8 +161,10 @@ int main(int argc, char **argv)
(getgid() != pw->pw_gid) ||
(pw->pw_uid != st.st_uid) ||
(pw->pw_gid != st.st_gid)) {
- fprintf(stderr, _( "%s: Target %u is owned by a different user\n" ),
- Prog, target);
+ fprintf(stderr, _( "%s: Target process %u is owned by a different user: uid:%lu pw_uid:%lu st_uid:%lu, gid:%lu pw_gid:%lu st_gid:%lu\n" ),
+ Prog, target,
+ (unsigned long int)getuid(), (unsigned long int)pw->pw_uid, (unsigned long int)st.st_uid,
+ (unsigned long int)getgid(), (unsigned long int)pw->pw_gid, (unsigned long int)st.st_gid);
return EXIT_FAILURE;
}
diff --git a/src/newusers.c b/src/newusers.c
index 85822db1..724cbb40 100644
--- a/src/newusers.c
+++ b/src/newusers.c
@@ -805,27 +805,27 @@ static void open_files (void)
}
#endif /* ENABLE_SUBIDS */
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (EXIT_FAILURE);
}
- if (is_shadow && (spw_open (O_RDWR) == 0)) {
+ if (is_shadow && (spw_open (O_CREAT | O_RDWR) == 0)) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, spw_dbname ());
fail_exit (EXIT_FAILURE);
}
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
fail_exit (EXIT_FAILURE);
}
#ifdef SHADOWGRP
- if (is_shadow_grp && (sgr_open (O_RDWR) == 0)) {
+ if (is_shadow_grp && (sgr_open (O_CREAT | O_RDWR) == 0)) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
fail_exit (EXIT_FAILURE);
}
#endif
#ifdef ENABLE_SUBIDS
if (is_sub_uid) {
- if (sub_uid_open (O_RDWR) == 0) {
+ if (sub_uid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sub_uid_dbname ());
@@ -833,7 +833,7 @@ static void open_files (void)
}
}
if (is_sub_gid) {
- if (sub_gid_open (O_RDWR) == 0) {
+ if (sub_gid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sub_gid_dbname ());
@@ -988,8 +988,8 @@ int main (int argc, char **argv)
is_shadow_grp = sgr_file_present ();
#endif
#ifdef ENABLE_SUBIDS
- is_sub_uid = sub_uid_file_present () && !rflg;
- is_sub_gid = sub_gid_file_present () && !rflg;
+ is_sub_uid = sub_uid_file_present ();
+ is_sub_gid = sub_gid_file_present ();
#endif /* ENABLE_SUBIDS */
open_files ();
diff --git a/src/passwd.c b/src/passwd.c
index 3424f3bf..1191111d 100644
--- a/src/passwd.c
+++ b/src/passwd.c
@@ -573,7 +573,7 @@ static void update_noshadow (void)
exit (E_PWDBUSY);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
(void) fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, pw_dbname ());
@@ -627,7 +627,7 @@ static void update_shadow (void)
exit (E_PWDBUSY);
}
spw_locked = true;
- if (spw_open (O_RDWR) == 0) {
+ if (spw_open (O_CREAT | O_RDWR) == 0) {
(void) fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
diff --git a/src/pwck.c b/src/pwck.c
index 05df68ec..523135f6 100644
--- a/src/pwck.c
+++ b/src/pwck.c
@@ -281,7 +281,7 @@ static void open_files (void)
* Open the files. Use O_RDONLY if we are in read_only mode, O_RDWR
* otherwise.
*/
- if (pw_open (read_only ? O_RDONLY : O_RDWR) == 0) {
+ if (pw_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"),
Prog, pw_dbname ());
if (use_system_pw_file) {
@@ -290,7 +290,7 @@ static void open_files (void)
fail_exit (E_CANTOPEN);
}
if (is_shadow && !use_tcb) {
- if (spw_open (read_only ? O_RDONLY : O_RDWR) == 0) {
+ if (spw_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
@@ -566,7 +566,7 @@ static void check_pw_file (int *errors, bool *changed)
continue;
}
spw_locked = true;
- if (spw_open (read_only ? O_RDONLY : O_RDWR) == 0) {
+ if (spw_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
diff --git a/src/pwconv.c b/src/pwconv.c
index 515eba19..e2d61f87 100644
--- a/src/pwconv.c
+++ b/src/pwconv.c
@@ -200,7 +200,7 @@ int main (int argc, char **argv)
fail_exit (E_PWDBUSY);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (E_MISSING);
@@ -305,7 +305,8 @@ int main (int argc, char **argv)
}
/* /etc/passwd- (backup file) */
- if (chmod (PASSWD_FILE "-", 0600) != 0) {
+ errno = 0;
+ if ((chmod (PASSWD_FILE "-", 0600) != 0) && (errno != ENOENT)) {
fprintf (stderr,
_("%s: failed to change the mode of %s to 0600\n"),
Prog, PASSWD_FILE "-");
diff --git a/src/pwunconv.c b/src/pwunconv.c
index 62e2af04..fabf0237 100644
--- a/src/pwunconv.c
+++ b/src/pwunconv.c
@@ -166,7 +166,7 @@ int main (int argc, char **argv)
fail_exit (5);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, pw_dbname ());
diff --git a/src/su.c b/src/su.c
index 37042172..93ffd2fb 100644
--- a/src/su.c
+++ b/src/su.c
@@ -105,6 +105,8 @@ static char caller_name[BUFSIZ];
static bool change_environment = true;
#ifdef USE_PAM
+static char kill_msg[256];
+static char wait_msg[256];
static pam_handle_t *pamh = NULL;
static int caught = 0;
/* PID of the child, in case it needs to be killed */
@@ -161,8 +163,7 @@ static RETSIGTYPE die (int killed)
}
if (killed != 0) {
- closelog ();
- exit (128+killed);
+ _exit (128+killed);
}
}
@@ -182,12 +183,11 @@ static RETSIGTYPE kill_child (int unused(s))
{
if (0 != pid_child) {
(void) kill (-pid_child, SIGKILL);
- (void) fputs (_(" ...killed.\n"), stderr);
+ (void) write (STDERR_FILENO, kill_msg, strlen (kill_msg));
} else {
- (void) fputs (_(" ...waiting for child to terminate.\n"),
- stderr);
+ (void) write (STDERR_FILENO, wait_msg, strlen (wait_msg));
}
- exit (255);
+ _exit (255);
}
#endif /* USE_PAM */
@@ -373,6 +373,9 @@ static void prepare_pam_close_session (void)
stderr);
(void) kill (-pid_child, caught);
+ snprintf (kill_msg, 256, _(" ...killed.\n"));
+ snprintf (wait_msg, 256, _(" ...waiting for child to terminate.\n"));
+
(void) signal (SIGALRM, kill_child);
(void) alarm (2);
@@ -422,7 +425,7 @@ static void check_perms_pam (const struct passwd *pw)
int ret;
ret = pam_authenticate (pamh, 0);
if (PAM_SUCCESS != ret) {
- SYSLOG ((LOG_ERR, "pam_authenticate: %s",
+ SYSLOG (((pw->pw_uid != 0)? LOG_NOTICE : LOG_WARN, "pam_authenticate: %s",
pam_strerror (pamh, ret)));
fprintf (stderr, _("%s: %s\n"), Prog, pam_strerror (pamh, ret));
(void) pam_end (pamh, ret);
@@ -585,7 +588,7 @@ static /*@only@*/struct passwd * check_perms (void)
if (NULL == pw) {
(void) fprintf (stderr,
_("No passwd entry for user '%s'\n"), name);
- SYSLOG ((LOG_ERR, "No passwd entry for user '%s'", name));
+ SYSLOG ((LOG_NOTICE, "No passwd entry for user '%s'", name));
su_failure (caller_tty, true);
}
@@ -615,7 +618,7 @@ static /*@only@*/struct passwd * check_perms (void)
(void) fprintf (stderr,
_("No passwd entry for user '%s'\n"),
name);
- SYSLOG ((LOG_ERR,
+ SYSLOG ((LOG_NOTICE,
"No passwd entry for user '%s'", name));
su_failure (caller_tty, true);
}
diff --git a/src/sulogin.c b/src/sulogin.c
index ccbf2c5d..4264099b 100644
--- a/src/sulogin.c
+++ b/src/sulogin.c
@@ -70,7 +70,7 @@ static RETSIGTYPE catch_signals (int);
static RETSIGTYPE catch_signals (unused int sig)
{
- exit (1);
+ _exit (1);
}
/*
diff --git a/src/useradd.c b/src/useradd.c
index a8a1f767..fefa234c 100644
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -1537,7 +1537,7 @@ static void open_files (void)
exit (E_PW_UPDATE);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (E_PW_UPDATE);
}
@@ -1554,7 +1554,7 @@ static void open_files (void)
fail_exit (E_GRP_UPDATE);
}
gr_locked = true;
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
fail_exit (E_GRP_UPDATE);
}
@@ -1567,7 +1567,7 @@ static void open_files (void)
fail_exit (E_GRP_UPDATE);
}
sgr_locked = true;
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
@@ -1584,7 +1584,7 @@ static void open_files (void)
fail_exit (E_SUB_UID_UPDATE);
}
sub_uid_locked = true;
- if (sub_uid_open (O_RDWR) == 0) {
+ if (sub_uid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sub_uid_dbname ());
@@ -1599,7 +1599,7 @@ static void open_files (void)
fail_exit (E_SUB_GID_UPDATE);
}
sub_gid_locked = true;
- if (sub_gid_open (O_RDWR) == 0) {
+ if (sub_gid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sub_gid_dbname ());
@@ -1621,7 +1621,7 @@ static void open_shadow (void)
fail_exit (E_PW_UPDATE);
}
spw_locked = true;
- if (spw_open (O_RDWR) == 0) {
+ if (spw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
@@ -1993,9 +1993,10 @@ int main (int argc, char **argv)
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
- /* Needed for userns check */
+#ifdef ENABLE_SUBIDS
uid_t uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
uid_t uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
+#endif
/*
* Get my name so that I can use it to report errors.
@@ -2025,6 +2026,9 @@ int main (int argc, char **argv)
#ifdef SHADOWGRP
is_shadow_grp = sgr_file_present ();
#endif
+
+ process_flags (argc, argv);
+
#ifdef ENABLE_SUBIDS
is_sub_uid = sub_uid_file_present () && !rflg &&
(!user_id || (user_id <= uid_max && user_id >= uid_min));
@@ -2034,8 +2038,6 @@ int main (int argc, char **argv)
get_defaults ();
- process_flags (argc, argv);
-
#ifdef ACCT_TOOLS_SETUID
#ifdef USE_PAM
{
diff --git a/src/userdel.c b/src/userdel.c
index 19b12bc4..9092b5c1 100644
--- a/src/userdel.c
+++ b/src/userdel.c
@@ -565,7 +565,7 @@ static void open_files (void)
fail_exit (E_PW_UPDATE);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, pw_dbname ());
#ifdef WITH_AUDIT
@@ -590,7 +590,7 @@ static void open_files (void)
fail_exit (E_PW_UPDATE);
}
spw_locked = true;
- if (spw_open (O_RDWR) == 0) {
+ if (spw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
@@ -616,7 +616,7 @@ static void open_files (void)
fail_exit (E_GRP_UPDATE);
}
gr_locked = true;
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER, Prog,
@@ -641,7 +641,7 @@ static void open_files (void)
fail_exit (E_GRP_UPDATE);
}
sgr_locked= true;
- if (sgr_open (O_RDWR) == 0) {
+ if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"),
Prog, sgr_dbname ());
#ifdef WITH_AUDIT
@@ -669,7 +669,7 @@ static void open_files (void)
fail_exit (E_SUB_UID_UPDATE);
}
sub_uid_locked = true;
- if (sub_uid_open (O_RDWR) == 0) {
+ if (sub_uid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, sub_uid_dbname ());
#ifdef WITH_AUDIT
@@ -695,7 +695,7 @@ static void open_files (void)
fail_exit (E_SUB_GID_UPDATE);
}
sub_gid_locked = true;
- if (sub_gid_open (O_RDWR) == 0) {
+ if (sub_gid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, sub_gid_dbname ());
#ifdef WITH_AUDIT
diff --git a/src/usermod.c b/src/usermod.c
index e7d43513..687487d9 100644
--- a/src/usermod.c
+++ b/src/usermod.c
@@ -1361,6 +1361,7 @@ static void process_flags (int argc, char **argv)
exit (E_UID_IN_USE);
}
+#ifdef ENABLE_SUBIDS
if ( (vflg || Vflg)
&& !is_sub_uid) {
fprintf (stderr,
@@ -1376,6 +1377,7 @@ static void process_flags (int argc, char **argv)
Prog, sub_gid_dbname (), "-w", "-W");
exit (E_USAGE);
}
+#endif /* ENABLE_SUBIDS */
}
/*
@@ -1530,7 +1532,7 @@ static void open_files (void)
fail_exit (E_PW_UPDATE);
}
pw_locked = true;
- if (pw_open (O_RDWR) == 0) {
+ if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, pw_dbname ());
@@ -1543,7 +1545,7 @@ static void open_files (void)
fail_exit (E_PW_UPDATE);
}
spw_locked = true;
- if (is_shadow_pwd && (spw_open (O_RDWR) == 0)) {
+ if (is_shadow_pwd && (spw_open (O_CREAT | O_RDWR) == 0)) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
@@ -1562,7 +1564,7 @@ static void open_files (void)
fail_exit (E_GRP_UPDATE);
}
gr_locked = true;
- if (gr_open (O_RDWR) == 0) {
+ if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, gr_dbname ());
@@ -1576,7 +1578,7 @@ static void open_files (void)
fail_exit (E_GRP_UPDATE);
}
sgr_locked = true;
- if (is_shadow_grp && (sgr_open (O_RDWR) == 0)) {
+ if (is_shadow_grp && (sgr_open (O_CREAT | O_RDWR) == 0)) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
@@ -1593,7 +1595,7 @@ static void open_files (void)
fail_exit (E_SUB_UID_UPDATE);
}
sub_uid_locked = true;
- if (sub_uid_open (O_RDWR) == 0) {
+ if (sub_uid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sub_uid_dbname ());
@@ -1608,7 +1610,7 @@ static void open_files (void)
fail_exit (E_SUB_GID_UPDATE);
}
sub_gid_locked = true;
- if (sub_gid_open (O_RDWR) == 0) {
+ if (sub_gid_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sub_gid_dbname ());
@@ -1717,60 +1719,6 @@ static void usr_update (void)
fail_exit (E_PW_UPDATE);
}
}
-#ifdef ENABLE_SUBIDS
- if (Vflg) {
- struct ulong_range_list_entry *ptr;
- for (ptr = del_sub_uids; ptr != NULL; ptr = ptr->next) {
- unsigned long count = ptr->range.last - ptr->range.first + 1;
- if (sub_uid_remove(user_name, ptr->range.first, count) == 0) {
- fprintf (stderr,
- _("%s: failed to remove uid range %lu-%lu from '%s'\n"),
- Prog, ptr->range.first, ptr->range.last,
- sub_uid_dbname ());
- fail_exit (E_SUB_UID_UPDATE);
- }
- }
- }
- if (vflg) {
- struct ulong_range_list_entry *ptr;
- for (ptr = add_sub_uids; ptr != NULL; ptr = ptr->next) {
- unsigned long count = ptr->range.last - ptr->range.first + 1;
- if (sub_uid_add(user_name, ptr->range.first, count) == 0) {
- fprintf (stderr,
- _("%s: failed to add uid range %lu-%lu from '%s'\n"),
- Prog, ptr->range.first, ptr->range.last,
- sub_uid_dbname ());
- fail_exit (E_SUB_UID_UPDATE);
- }
- }
- }
- if (Wflg) {
- struct ulong_range_list_entry *ptr;
- for (ptr = del_sub_gids; ptr != NULL; ptr = ptr->next) {
- unsigned long count = ptr->range.last - ptr->range.first + 1;
- if (sub_gid_remove(user_name, ptr->range.first, count) == 0) {
- fprintf (stderr,
- _("%s: failed to remove gid range %lu-%lu from '%s'\n"),
- Prog, ptr->range.first, ptr->range.last,
- sub_gid_dbname ());
- fail_exit (E_SUB_GID_UPDATE);
- }
- }
- }
- if (wflg) {
- struct ulong_range_list_entry *ptr;
- for (ptr = add_sub_gids; ptr != NULL; ptr = ptr->next) {
- unsigned long count = ptr->range.last - ptr->range.first + 1;
- if (sub_gid_add(user_name, ptr->range.first, count) == 0) {
- fprintf (stderr,
- _("%s: failed to add gid range %lu-%lu from '%s'\n"),
- Prog, ptr->range.first, ptr->range.last,
- sub_gid_dbname ());
- fail_exit (E_SUB_GID_UPDATE);
- }
- }
- }
-#endif /* ENABLE_SUBIDS */
}
/*
@@ -2174,16 +2122,66 @@ int main (int argc, char **argv)
*/
open_files ();
if ( cflg || dflg || eflg || fflg || gflg || Lflg || lflg || pflg
- || sflg || uflg || Uflg
-#ifdef ENABLE_SUBIDS
- || vflg || Vflg || wflg || Wflg
-#endif /* ENABLE_SUBIDS */
- ) {
+ || sflg || uflg || Uflg) {
usr_update ();
}
if (Gflg || lflg) {
grp_update ();
}
+#ifdef ENABLE_SUBIDS
+ if (Vflg) {
+ struct ulong_range_list_entry *ptr;
+ for (ptr = del_sub_uids; ptr != NULL; ptr = ptr->next) {
+ unsigned long count = ptr->range.last - ptr->range.first + 1;
+ if (sub_uid_remove(user_name, ptr->range.first, count) == 0) {
+ fprintf (stderr,
+ _("%s: failed to remove uid range %lu-%lu from '%s'\n"),
+ Prog, ptr->range.first, ptr->range.last,
+ sub_uid_dbname ());
+ fail_exit (E_SUB_UID_UPDATE);
+ }
+ }
+ }
+ if (vflg) {
+ struct ulong_range_list_entry *ptr;
+ for (ptr = add_sub_uids; ptr != NULL; ptr = ptr->next) {
+ unsigned long count = ptr->range.last - ptr->range.first + 1;
+ if (sub_uid_add(user_name, ptr->range.first, count) == 0) {
+ fprintf (stderr,
+ _("%s: failed to add uid range %lu-%lu from '%s'\n"),
+ Prog, ptr->range.first, ptr->range.last,
+ sub_uid_dbname ());
+ fail_exit (E_SUB_UID_UPDATE);
+ }
+ }
+ }
+ if (Wflg) {
+ struct ulong_range_list_entry *ptr;
+ for (ptr = del_sub_gids; ptr != NULL; ptr = ptr->next) {
+ unsigned long count = ptr->range.last - ptr->range.first + 1;
+ if (sub_gid_remove(user_name, ptr->range.first, count) == 0) {
+ fprintf (stderr,
+ _("%s: failed to remove gid range %lu-%lu from '%s'\n"),
+ Prog, ptr->range.first, ptr->range.last,
+ sub_gid_dbname ());
+ fail_exit (E_SUB_GID_UPDATE);
+ }
+ }
+ }
+ if (wflg) {
+ struct ulong_range_list_entry *ptr;
+ for (ptr = add_sub_gids; ptr != NULL; ptr = ptr->next) {
+ unsigned long count = ptr->range.last - ptr->range.first + 1;
+ if (sub_gid_add(user_name, ptr->range.first, count) == 0) {
+ fprintf (stderr,
+ _("%s: failed to add gid range %lu-%lu from '%s'\n"),
+ Prog, ptr->range.first, ptr->range.last,
+ sub_gid_dbname ());
+ fail_exit (E_SUB_GID_UPDATE);
+ }
+ }
+ }
+#endif /* ENABLE_SUBIDS */
close_files ();
#ifdef WITH_TCB