* 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.
This commit is contained in:
@ -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 @@ void update_primary_groups (gid_t ogid, gid_t ngid)
|
||||
*/
|
||||
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 @@ int main (int argc, char **argv)
|
||||
|
||||
OPENLOG ("groupmod");
|
||||
|
||||
#ifdef ACCT_TOOLS_SETUID
|
||||
#ifdef USE_PAM
|
||||
{
|
||||
struct passwd *pampw;
|
||||
@ -729,6 +734,7 @@ int main (int argc, char **argv)
|
||||
fail_exit (1);
|
||||
}
|
||||
#endif /* USE_PAM */
|
||||
#endif /* ACCT_TOOLS_SETUID */
|
||||
|
||||
#ifdef SHADOWGRP
|
||||
is_shadow_grp = sgr_file_present ();
|
||||
|
Reference in New Issue
Block a user