[svn-upgrade] Integrating new upstream version, shadow (4.0.9)
This commit is contained in:
@@ -41,7 +41,11 @@ host_triplet = @host@
|
||||
subdir = lib
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: encrypt.c,v 1.11 2005/04/06 02:59:22 kloczek Exp $")
|
||||
RCSID ("$Id: encrypt.c,v 1.12 2005/05/19 12:05:03 kloczek Exp $")
|
||||
#include <unistd.h>
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
@@ -40,7 +40,7 @@ char *pw_encrypt (const char *clear, const char *salt)
|
||||
static char cipher[128];
|
||||
char *cp;
|
||||
|
||||
crypt (clear, salt);
|
||||
cp = crypt (clear, salt);
|
||||
if (!cp) {
|
||||
/*
|
||||
* Single Unix Spec: crypt() may return a null pointer,
|
||||
|
||||
40
lib/getdef.c
40
lib/getdef.c
@@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: getdef.c,v 1.28 2005/04/01 22:52:03 kloczek Exp $")
|
||||
RCSID ("$Id: getdef.c,v 1.29 2005/05/09 10:45:26 kloczek Exp $")
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include <stdio.h>
|
||||
@@ -45,10 +45,6 @@ struct itemdef {
|
||||
char *value; /* value given, or NULL if no value */
|
||||
};
|
||||
|
||||
/*
|
||||
* This list *must* be sorted by the "name" member.
|
||||
*/
|
||||
|
||||
#define NUMDEFS (sizeof(def_table)/sizeof(def_table[0]))
|
||||
static struct itemdef def_table[] = {
|
||||
{"CHFN_RESTRICT", NULL},
|
||||
@@ -118,7 +114,8 @@ static struct itemdef def_table[] = {
|
||||
{"UID_MAX", NULL},
|
||||
{"UID_MIN", NULL},
|
||||
{"UMASK", NULL},
|
||||
{"USERGROUPS_ENAB", NULL}
|
||||
{"USERGROUPS_ENAB", NULL},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
#ifndef LOGINDEFS
|
||||
@@ -278,37 +275,24 @@ int putdef_str (const char *name, const char *value)
|
||||
/*
|
||||
* def_find - locate named item in table
|
||||
*
|
||||
* Search through a sorted table of configurable items to locate the
|
||||
* Search through a table of configurable items to locate the
|
||||
* specified configuration option.
|
||||
*/
|
||||
|
||||
static struct itemdef *def_find (const char *name)
|
||||
{
|
||||
int min, max, curr, n;
|
||||
int n;
|
||||
struct itemdef *ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Invariant - desired item in range [min:max].
|
||||
* Search into the table.
|
||||
*/
|
||||
|
||||
min = 0;
|
||||
max = NUMDEFS - 1;
|
||||
|
||||
/*
|
||||
* Binary search into the table. Relies on the items being
|
||||
* sorted by name.
|
||||
*/
|
||||
|
||||
while (min <= max) {
|
||||
curr = (min + max) / 2;
|
||||
|
||||
if (!(n = strcmp (def_table[curr].name, name)))
|
||||
return &def_table[curr];
|
||||
|
||||
if (n < 0)
|
||||
min = curr + 1;
|
||||
else
|
||||
max = curr - 1;
|
||||
}
|
||||
for (ptr = def_table; ptr->name; ptr++) {
|
||||
if (!(n = strcmp (ptr->name, name)))
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Item was never found.
|
||||
|
||||
Reference in New Issue
Block a user