[Pkg-shadow-commits] r2357 - in upstream/trunk: . etc/pam.d src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Sep 6 21:35:38 UTC 2008


Author: nekral-guest
Date: 2008-09-06 21:35:37 +0000 (Sat, 06 Sep 2008)
New Revision: 2357

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/configure.in
   upstream/trunk/etc/pam.d/Makefile.am
   upstream/trunk/src/Makefile.am
   upstream/trunk/src/chage.c
   upstream/trunk/src/chgpasswd.c
   upstream/trunk/src/chpasswd.c
   upstream/trunk/src/groupadd.c
   upstream/trunk/src/groupdel.c
   upstream/trunk/src/groupmod.c
   upstream/trunk/src/newusers.c
   upstream/trunk/src/useradd.c
   upstream/trunk/src/userdel.c
   upstream/trunk/src/usermod.c
Log:
	* configure.in: Added option --enable-account-tools-setuid to
	enable/disable the usage of PAM to authenticate the callers of
	account management tools: chage, chgpasswd, chpasswd, groupadd,
	groupdel, groupmod, useradd, userdel, usermod.
	* src/Makefile.am: Do not link the above tools with libpam if
	account-tools-setuid is disabled.
	* src/userdel.c, src/newusers.c, src/chpasswd.c, src/usermod.c,
	src/groupdel.c, src/chgpasswd.c, src/useradd.c, src/groupmod.c,
	src/groupadd.c, src/chage.c: Implement ACCT_TOOLS_SETUID
	(--enable-account-tools-setuid).
	* etc/pam.d/Makefile.am: Install the pam service file for the
	above tools only when needed.
	* src/useradd.c, src/userdel.c, src/usermod.c: It is no more
	needed to initialize retval to PAM_SUCCESS.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/ChangeLog	2008-09-06 21:35:37 UTC (rev 2357)
@@ -1,5 +1,20 @@
 2008-09-06  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* configure.in: Added option --enable-account-tools-setuid to
+	enable/disable the usage of PAM to authenticate the callers of
+	account management tools: chage, chgpasswd, chpasswd, groupadd,
+	groupdel, groupmod, useradd, userdel, usermod.
+	* src/Makefile.am: Do not link the above tools with libpam if
+	account-tools-setuid is disabled.
+	* src/userdel.c, src/newusers.c, src/chpasswd.c, src/usermod.c,
+	src/groupdel.c, src/chgpasswd.c, src/useradd.c, src/groupmod.c,
+	src/groupadd.c, src/chage.c: Implement ACCT_TOOLS_SETUID
+	(--enable-account-tools-setuid).
+	* etc/pam.d/Makefile.am: Install the pam service file for the
+	above tools only when needed.
+
+2008-09-06  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* libmisc/tz.c: tz() is only used when USE_PAM is not defined.
 	* lib/prototypes.h: Indicate functions whose presence depends on
 	the USE_PAM flag.
@@ -32,6 +47,8 @@
 	src/chsh.c: Simplify the PAM error handling. Do not keep the pamh
 	handle, but terminate the PAM transaction as soon as possible if
 	there are no PAM session opened.
+	* src/useradd.c, src/userdel.c, src/usermod.c: It is no more
+	needed to initialize retval to PAM_SUCCESS.
 
 2008-09-06  Nicolas François  <nicolas.francois at centraliens.net>
 

Modified: upstream/trunk/configure.in
===================================================================
--- upstream/trunk/configure.in	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/configure.in	2008-09-06 21:35:37 UTC (rev 2357)
@@ -219,6 +219,18 @@
 	[enable_man=no]
 )
 
+AC_ARG_ENABLE(account-tools-setuid,
+	[AC_HELP_STRING([--enable-account-tools-setuid],
+		[Install the user and group management tools setuid and authenticate the callers. This requires --with-pam.])],
+	[case "${enableval}" in
+	 yes) enable_acct_tools_setuid="yes" ;;
+	  no) enable_acct_tools_setuid="no" ;;
+	   *) AC_MSG_ERROR(bad value ${enableval} for --enable-account-tools-setuid)
+	   ;;
+	 esac],
+	[enable_acct_tools_setuid="yes"]
+)
+
 AC_ARG_WITH(audit, 
 	[AC_HELP_STRING([--with-audit], [use auditing support @<:@default=yes if found@:>@])],
 	[with_audit=$withval], [with_audit=maybe])
@@ -417,6 +429,16 @@
 	AC_MSG_RESULT(yes)
 fi
 
+if test "$enable_acct_tools_setuid" = "yes"; then
+	if test "$with_libpam" != "yes"; then
+		AC_MSG_ERROR(PAM support is required for --enable-account-tools-setuid)
+	fi
+	AC_DEFINE(ACCT_TOOLS_SETUID,
+	          1,
+	          [Define if account management tools should be installed setuid and authenticate the callers])
+fi
+AM_CONDITIONAL(ACCT_TOOLS_SETUID, test "x$enable_acct_tools_setuid" = "xyes")
+
 AC_SUBST(LIBSKEY)
 AC_SUBST(LIBMD)
 if test "$with_skey" = "yes"; then
@@ -475,6 +497,9 @@
 echo "	auditing support:		$with_audit"
 echo "	CrackLib support:		$with_libcrack"
 echo "	PAM support:			$with_libpam"
+if test "$with_libpam" = "yes"; then
+echo "	suid account management tools:	$enable_acct_tools_setuid"
+fi
 echo "	SELinux support:		$with_selinux"
 echo "	shadow group support:		$enable_shadowgrp"
 echo "	S/Key support:			$with_skey"

Modified: upstream/trunk/etc/pam.d/Makefile.am
===================================================================
--- upstream/trunk/etc/pam.d/Makefile.am	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/etc/pam.d/Makefile.am	2008-09-06 21:35:37 UTC (rev 2357)
@@ -2,22 +2,26 @@
 # and also cooperate to make a distribution for `make dist'
 
 pamd_files = \
+	chfn \
+	chsh \
+	groupmems \
+	login \
+	passwd \
+	su
+
+if ACCT_TOOLS_SETUID
+pamd_files += \
 	chage \
-	chfn \
 	chgpasswd \
 	chpasswd \
-	chsh \
 	groupadd \
 	groupdel \
-	groupmems \
 	groupmod \
-	login \
 	newusers \
-	passwd \
-	su \
 	useradd \
 	userdel \
 	usermod
+endif
 
 if USE_PAM
 pamddir = $(sysconfdir)/pam.d

Modified: upstream/trunk/src/Makefile.am
===================================================================
--- upstream/trunk/src/Makefile.am	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/Makefile.am	2008-09-06 21:35:37 UTC (rev 2357)
@@ -49,22 +49,31 @@
 
 suidbins       = su
 suidubins      = chage chfn chsh expiry gpasswd newgrp passwd
+if ACCT_TOOLS_SETUID
+	suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
+endif
 
 LDADD          = $(INTLLIBS) \
 		 $(top_builddir)/libmisc/libmisc.a \
 		 $(top_builddir)/lib/libshadow.la
 AM_CPPFLAGS    = -DLOCALEDIR=\"$(datadir)/locale\"
 
-chage_LDADD    = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
+if ACCT_TOOLS_SETUID
+LIBPAM_SUID  = $(LIBPAM)
+else
+LIBPAM_SUID  =
+endif
+
+chage_LDADD    = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
 chfn_LDADD     = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT) $(LIBSKEY) $(LIBMD)
-chgpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
+chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
 chsh_LDADD     = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT) $(LIBSKEY) $(LIBMD)
-chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
+chpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
 gpasswd_LDADD  = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
-groupadd_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
-groupdel_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
+groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
+groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
 groupmems_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX)
-groupmod_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
+groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
 grpck_LDADD    = $(LDADD) $(LIBSELINUX)
 grpconv_LDADD  = $(LDADD) $(LIBSELINUX)
 grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
@@ -73,7 +82,7 @@
 	login_nopam.c
 login_LDADD    = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBCRYPT) $(LIBSKEY) $(LIBMD)
 newgrp_LDADD   = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBCRYPT)
-newusers_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
+newusers_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
 nologin_LDADD  =
 passwd_LDADD   = $(LDADD) $(LIBPAM) $(LIBCRACK) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
 pwck_LDADD     = $(LDADD) $(LIBSELINUX)
@@ -84,9 +93,9 @@
 	suauth.c
 su_LDADD       = $(LDADD) $(LIBPAM) $(LIBCRYPT) $(LIBSKEY) $(LIBMD)
 sulogin_LDADD  = $(LDADD) $(LIBCRYPT)
-useradd_LDADD  = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
-userdel_LDADD  = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
-usermod_LDADD  = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX)
+useradd_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
+userdel_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
+usermod_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
 vipw_LDADD     = $(LDADD) $(LIBSELINUX)
 
 install-am: all-am

Modified: upstream/trunk/src/chage.c
===================================================================
--- upstream/trunk/src/chage.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/chage.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -42,9 +42,11 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <time.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include <pwd.h>
 #ifdef WITH_SELINUX
 #include <selinux/selinux.h>
@@ -484,11 +486,13 @@
  */
 static void check_perms (void)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	struct passwd *pampw;
 	int retval;
-#endif
+#endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 	/*
 	 * An unprivileged user can ask for their own aging information, but
@@ -501,6 +505,7 @@
 		fail_exit (E_NOPERM);
 	}
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
 	if (NULL == pampw) {
@@ -525,6 +530,7 @@
 		fail_exit (E_NOPERM);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 }
 
 /*

Modified: upstream/trunk/src/chgpasswd.c
===================================================================
--- upstream/trunk/src/chgpasswd.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/chgpasswd.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -39,9 +39,11 @@
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include "defines.h"
 #include "exitcodes.h"
 #include "nscd.h"
@@ -246,6 +248,7 @@
  */
 static void check_perms (void)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
@@ -274,6 +277,7 @@
 		exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 }
 
 /*

Modified: upstream/trunk/src/chpasswd.c
===================================================================
--- upstream/trunk/src/chpasswd.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/chpasswd.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -39,9 +39,11 @@
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include "defines.h"
 #include "exitcodes.h"
 #include "nscd.h"
@@ -240,6 +242,7 @@
  */
 static void check_perms (void)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
@@ -268,6 +271,7 @@
 		exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 }
 
 /*

Modified: upstream/trunk/src/groupadd.c
===================================================================
--- upstream/trunk/src/groupadd.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/groupadd.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -41,10 +41,12 @@
 #include <grp.h>
 #include <stdio.h>
 #include <sys/types.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #include <pwd.h>
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include "chkname.h"
 #include "defines.h"
 #include "getdef.h"
@@ -565,6 +567,7 @@
  */
 static void check_perms (void)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
@@ -593,6 +596,7 @@
 		exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 }
 
 /*

Modified: upstream/trunk/src/groupdel.c
===================================================================
--- upstream/trunk/src/groupdel.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/groupdel.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -38,9 +38,11 @@
 #include <fcntl.h>
 #include <grp.h>
 #include <pwd.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include <stdio.h>
 #include <sys/types.h>
 #include "defines.h"
@@ -309,10 +311,12 @@
 
 int main (int argc, char **argv)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
-#endif
+#endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef WITH_AUDIT
 	audit_help_open ();
@@ -336,6 +340,7 @@
 
 	OPENLOG ("groupdel");
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	{
 		struct passwd *pampw;
@@ -364,6 +369,7 @@
 		exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef SHADOWGRP
 	is_shadow_grp = sgr_file_present ();

Modified: upstream/trunk/src/groupmod.c
===================================================================
--- upstream/trunk/src/groupmod.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/groupmod.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -40,10 +40,12 @@
 #include <grp.h>
 #include <stdio.h>
 #include <sys/types.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #include <pwd.h>
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include "chkname.h"
 #include "defines.h"
 #include "groupio.h"
@@ -679,10 +681,12 @@
  */
 int main (int argc, char **argv)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
-#endif
+#endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef WITH_AUDIT
 	audit_help_open ();
@@ -701,6 +705,7 @@
 
 	OPENLOG ("groupmod");
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	{
 		struct passwd *pampw;
@@ -729,6 +734,7 @@
 		fail_exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef SHADOWGRP
 	is_shadow_grp = sgr_file_present ();

Modified: upstream/trunk/src/newusers.c
===================================================================
--- upstream/trunk/src/newusers.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/newusers.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -50,9 +50,11 @@
 #include <fcntl.h>
 #include <getopt.h>
 #include <ctype.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include "prototypes.h"
 #include "defines.h"
 #include "getdef.h"
@@ -561,6 +563,7 @@
  */
 static void check_perms (void)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
@@ -589,6 +592,7 @@
 		fail_exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 }
 
 /*

Modified: upstream/trunk/src/useradd.c
===================================================================
--- upstream/trunk/src/useradd.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/useradd.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -42,9 +42,11 @@
 #include <grp.h>
 #include <lastlog.h>
 #include <pwd.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -1748,10 +1750,12 @@
  */
 int main (int argc, char **argv)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
-#endif
+#endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef WITH_AUDIT
 	audit_help_open ();
@@ -1785,9 +1789,8 @@
 
 	process_flags (argc, argv);
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
-	retval = PAM_SUCCESS;
-
 	{
 		struct passwd *pampw;
 		pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
@@ -1815,6 +1818,7 @@
 		fail_exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 	/*
 	 * See if we are messing with the defaults file, or creating

Modified: upstream/trunk/src/userdel.c
===================================================================
--- upstream/trunk/src/userdel.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/userdel.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -43,9 +43,11 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include "defines.h"
 #include "getdef.h"
 #include "groupio.h"
@@ -781,10 +783,12 @@
 {
 	int errors = 0; /* Error in the removal of the home directory */
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
-#endif
+#endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef WITH_AUDIT
 	audit_help_open ();
@@ -830,9 +834,8 @@
 
 	OPENLOG ("userdel");
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
-	retval = PAM_SUCCESS;
-
 	{
 		struct passwd *pampw;
 		pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
@@ -860,6 +863,7 @@
 		exit (E_PW_UPDATE);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 	is_shadow_pwd = spw_file_present ();
 #ifdef SHADOWGRP

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2008-09-06 16:43:21 UTC (rev 2356)
+++ upstream/trunk/src/usermod.c	2008-09-06 21:35:37 UTC (rev 2357)
@@ -41,9 +41,11 @@
 #include <grp.h>
 #include <lastlog.h>
 #include <pwd.h>
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -1620,10 +1622,12 @@
  */
 int main (int argc, char **argv)
 {
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
 	pam_handle_t *pamh = NULL;
 	int retval;
-#endif
+#endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 #ifdef WITH_AUDIT
 	audit_help_open ();
@@ -1651,9 +1655,8 @@
 
 	process_flags (argc, argv);
 
+#ifdef ACCT_TOOLS_SETUID
 #ifdef USE_PAM
-	retval = PAM_SUCCESS;
-
 	{
 		struct passwd *pampw;
 		pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
@@ -1681,6 +1684,7 @@
 		exit (1);
 	}
 #endif				/* USE_PAM */
+#endif				/* ACCT_TOOLS_SETUID */
 
 	/*
 	 * Do the hard stuff - open the files, change the user entries,




More information about the Pkg-shadow-commits mailing list