[svn-upgrade] Integrating new upstream version, shadow (4.0.4)
This commit is contained in:
20
src/chsh.c
20
src/chsh.c
@@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID (PKG_VER "$Id: chsh.c,v 1.20 2002/01/05 15:41:43 kloczek Exp $")
|
||||
RCSID (PKG_VER "$Id: chsh.c,v 1.23 2003/06/19 18:11:01 kloczek Exp $")
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
@@ -41,6 +41,7 @@ RCSID (PKG_VER "$Id: chsh.c,v 1.20 2002/01/05 15:41:43 kloczek Exp $")
|
||||
#include "pwio.h"
|
||||
#include "getdef.h"
|
||||
#include "pwauth.h"
|
||||
#include "nscd.h"
|
||||
#ifdef HAVE_SHADOW_H
|
||||
#include <shadow.h>
|
||||
#endif
|
||||
@@ -99,18 +100,12 @@ static void new_fields (void)
|
||||
|
||||
static int restricted_shell (const char *sh)
|
||||
{
|
||||
#if 0
|
||||
char *cp = Basename ((char *) sh);
|
||||
|
||||
return *cp == 'r' || *cp == 'R';
|
||||
#else
|
||||
/*
|
||||
* Shells not listed in /etc/shells are considered to be restricted.
|
||||
* Changed this to avoid confusion with "rc" (the plan9 shell - not
|
||||
* restricted despite the name starting with 'r'). --marekm
|
||||
*/
|
||||
return !check_shell (sh);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -256,10 +251,10 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* Non-privileged users are optionally authenticated (must enter
|
||||
* the password of the user whose information is being changed)
|
||||
* before any changes can be made. Idea from util-linux
|
||||
* chfn/chsh. --marekm
|
||||
* Non-privileged users are optionally authenticated (must enter
|
||||
* the password of the user whose information is being changed)
|
||||
* before any changes can be made. Idea from util-linux
|
||||
* chfn/chsh. --marekm
|
||||
*/
|
||||
|
||||
if (!amroot && getdef_bool ("CHFN_AUTH"))
|
||||
@@ -406,6 +401,9 @@ int main (int argc, char **argv)
|
||||
}
|
||||
SYSLOG ((LOG_INFO, "changed user `%s' shell to `%s'", user,
|
||||
loginsh));
|
||||
|
||||
nscd_flush_cache ("passwd");
|
||||
|
||||
closelog ();
|
||||
exit (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user