[svn-upgrade] Integrating new upstream version, shadow (4.0.16)
This commit is contained in:
@@ -159,6 +159,8 @@ U = @U@
|
||||
USE_NLS = @USE_NLS@
|
||||
USE_NLS_FALSE = @USE_NLS_FALSE@
|
||||
USE_NLS_TRUE = @USE_NLS_TRUE@
|
||||
USE_PAM_FALSE = @USE_PAM_FALSE@
|
||||
USE_PAM_TRUE = @USE_PAM_TRUE@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XMLCATALOG = @XMLCATALOG@
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ident "$Id: commonio.c,v 1.31 2005/10/19 11:34:21 kloczek Exp $"
|
||||
#ident "$Id: commonio.c,v 1.32 2006/05/07 18:32:51 kloczek Exp $"
|
||||
|
||||
#include "defines.h"
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <utime.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
@@ -22,6 +24,7 @@ static security_context_t old_context = NULL;
|
||||
#include "commonio.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static int lrename (const char *, const char *);
|
||||
static int check_link_count (const char *);
|
||||
static int do_lock_file (const char *, const char *);
|
||||
static FILE *fopen_set_perms (const char *, const char *, const struct stat *);
|
||||
@@ -36,6 +39,30 @@ static struct commonio_entry *find_entry_by_name (struct commonio_db *,
|
||||
static int lock_count = 0;
|
||||
static int nscd_need_reload = 0;
|
||||
|
||||
/*
|
||||
* Simple rename(P) alternative that attempts to rename to symlink
|
||||
* target.
|
||||
*/
|
||||
int lrename (const char *old, const char *new)
|
||||
{
|
||||
|
||||
char resolved_path[PATH_MAX];
|
||||
int res;
|
||||
|
||||
#if defined(S_ISLNK)
|
||||
struct stat sb = { 0 };
|
||||
if (lstat (new, &sb) == 0 && S_ISLNK (sb.st_mode)) {
|
||||
if (realpath (new, resolved_path) == NULL) {
|
||||
perror ("realpath in lrename()");
|
||||
} else {
|
||||
new = resolved_path;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
res = rename (old, new);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int check_link_count (const char *file)
|
||||
{
|
||||
struct stat sb;
|
||||
@@ -563,7 +590,7 @@ int commonio_sort_wrt (struct commonio_db *shadow, struct commonio_db *passwd)
|
||||
struct commonio_entry *head = NULL, *pw_ptr, *spw_ptr;
|
||||
const char *name;
|
||||
|
||||
if(!shadow || !shadow->head)
|
||||
if (!shadow || !shadow->head)
|
||||
return 0;
|
||||
|
||||
for (pw_ptr = passwd->head; pw_ptr; pw_ptr = pw_ptr->next) {
|
||||
@@ -708,7 +735,7 @@ int commonio_close (struct commonio_db *db)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (rename (buf, db->filename))
|
||||
if (lrename (buf, db->filename))
|
||||
goto fail;
|
||||
|
||||
nscd_need_reload = 1;
|
||||
|
||||
12
lib/getdef.c
12
lib/getdef.c
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ident "$Id: getdef.c,v 1.37 2005/12/02 22:16:11 kloczek Exp $"
|
||||
#ident "$Id: getdef.c,v 1.39 2006/05/12 22:59:06 kloczek Exp $"
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
@@ -57,7 +57,6 @@ static struct itemdef def_table[] = {
|
||||
{"ERASECHAR", NULL},
|
||||
{"FAIL_DELAY", NULL},
|
||||
{"FAKE_SHELL", NULL},
|
||||
{"GETPASS_ASTERISKS", NULL},
|
||||
{"GID_MAX", NULL},
|
||||
{"GID_MIN", NULL},
|
||||
{"HUSHLOGIN_FILE", NULL},
|
||||
@@ -68,7 +67,6 @@ static struct itemdef def_table[] = {
|
||||
{"LOG_UNKFAIL_ENAB", NULL},
|
||||
{"MAIL_DIR", NULL},
|
||||
{"MAIL_FILE", NULL},
|
||||
{"MD5_CRYPT_ENAB", NULL},
|
||||
{"PASS_MAX_DAYS", NULL},
|
||||
{"PASS_MIN_DAYS", NULL},
|
||||
{"PASS_WARN_AGE", NULL},
|
||||
@@ -87,14 +85,15 @@ static struct itemdef def_table[] = {
|
||||
{"CHSH_AUTH", NULL},
|
||||
{"CRACKLIB_DICTPATH", NULL},
|
||||
{"ENV_HZ", NULL},
|
||||
{"ENV_TZ", NULL},
|
||||
{"ENVIRON_FILE", NULL},
|
||||
{"ENV_TZ", NULL},
|
||||
{"FAILLOG_ENAB", NULL},
|
||||
{"FTMP_FILE", NULL},
|
||||
{"ISSUE_FILE", NULL},
|
||||
{"LASTLOG_ENAB", NULL},
|
||||
{"LOGIN_STRING", NULL},
|
||||
{"MAIL_CHECK_ENAB", NULL},
|
||||
{"MD5_CRYPT_ENAB", NULL},
|
||||
{"MOTD_FILE", NULL},
|
||||
{"NOLOGINS_FILE", NULL},
|
||||
{"OBSCURE_CHECKS_ENAB", NULL},
|
||||
@@ -103,13 +102,16 @@ static struct itemdef def_table[] = {
|
||||
{"PASS_MAX_LEN", NULL},
|
||||
{"PASS_MIN_LEN", NULL},
|
||||
{"PORTTIME_CHECKS_ENAB", NULL},
|
||||
{"SU_WHEEL_ONLY", NULL},
|
||||
{"QUOTAS_ENAB", NULL},
|
||||
{"SU_WHEEL_ONLY", NULL},
|
||||
{"ULIMIT", NULL},
|
||||
#endif
|
||||
#ifdef USE_SYSLOG
|
||||
{"SYSLOG_SG_ENAB", NULL},
|
||||
{"SYSLOG_SU_ENAB", NULL},
|
||||
#endif
|
||||
#ifdef SKEY
|
||||
{"GETPASS_ASTERISKS", NULL},
|
||||
#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ident "$Id: getpass.c,v 1.14 2005/08/31 17:24:56 kloczek Exp $"
|
||||
#ifdef SKEY
|
||||
|
||||
#ident "$Id: getpass.c,v 1.15 2006/05/12 22:54:22 kloczek Exp $"
|
||||
|
||||
#include "defines.h"
|
||||
#include <signal.h>
|
||||
@@ -277,3 +279,4 @@ char *getpass_with_echo (const char *prompt)
|
||||
{
|
||||
return prompt_password (prompt, 1);
|
||||
}
|
||||
#endif /* SKEY */
|
||||
|
||||
@@ -87,7 +87,7 @@ int nscd_flush_cache (char *service)
|
||||
|
||||
req.version = NSCD_VERSION;
|
||||
req.type = INVALIDATE;
|
||||
req.key_len = strlen (service);
|
||||
req.key_len = strlen (service) + 1;
|
||||
|
||||
iov[0].iov_base = &req;
|
||||
iov[0].iov_len = sizeof (req);
|
||||
|
||||
14
lib/pwauth.c
14
lib/pwauth.c
@@ -30,13 +30,14 @@
|
||||
#include <config.h>
|
||||
|
||||
#ifndef USE_PAM
|
||||
#ident "$Id: pwauth.c,v 1.20 2006/03/11 21:15:55 kloczek Exp $"
|
||||
#ident "$Id: pwauth.c,v 1.22 2006/05/12 22:54:22 kloczek Exp $"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "pwauth.h"
|
||||
@@ -50,8 +51,9 @@ static const char *PROMPT = gettext_noop ("Password: ");
|
||||
static const char *PROMPT = gettext_noop ("%s's Password: ");
|
||||
#endif
|
||||
|
||||
extern char *getpass ();
|
||||
#ifdef SKEY
|
||||
extern char *getpass_with_echo ();
|
||||
#endif
|
||||
|
||||
int wipe_clear_pass = 1;
|
||||
char *clear_pass = NULL;
|
||||
|
||||
Reference in New Issue
Block a user