[svn-upgrade] Integrating new upstream version, shadow (4.0.11)
This commit is contained in:
@@ -11,7 +11,6 @@ libmisc_a_SOURCES = \
|
||||
basename.c \
|
||||
chkname.c \
|
||||
chkname.h \
|
||||
chkshell.c \
|
||||
chowndir.c \
|
||||
chowntty.c \
|
||||
console.c \
|
||||
|
@@ -52,20 +52,19 @@ ARFLAGS = cru
|
||||
libmisc_a_AR = $(AR) $(ARFLAGS)
|
||||
libmisc_a_LIBADD =
|
||||
am_libmisc_a_OBJECTS = addgrps.$(OBJEXT) age.$(OBJEXT) \
|
||||
basename.$(OBJEXT) chkname.$(OBJEXT) chkshell.$(OBJEXT) \
|
||||
chowndir.$(OBJEXT) chowntty.$(OBJEXT) console.$(OBJEXT) \
|
||||
copydir.$(OBJEXT) entry.$(OBJEXT) env.$(OBJEXT) \
|
||||
failure.$(OBJEXT) fields.$(OBJEXT) getdate.$(OBJEXT) \
|
||||
hushed.$(OBJEXT) isexpired.$(OBJEXT) limits.$(OBJEXT) \
|
||||
list.$(OBJEXT) log.$(OBJEXT) loginprompt.$(OBJEXT) \
|
||||
mail.$(OBJEXT) motd.$(OBJEXT) myname.$(OBJEXT) \
|
||||
obscure.$(OBJEXT) pam_pass.$(OBJEXT) pwd2spwd.$(OBJEXT) \
|
||||
pwdcheck.$(OBJEXT) pwd_init.$(OBJEXT) rlogin.$(OBJEXT) \
|
||||
salt.$(OBJEXT) setugid.$(OBJEXT) setupenv.$(OBJEXT) \
|
||||
shell.$(OBJEXT) strtoday.$(OBJEXT) sub.$(OBJEXT) \
|
||||
sulog.$(OBJEXT) ttytype.$(OBJEXT) tz.$(OBJEXT) \
|
||||
ulimit.$(OBJEXT) utmp.$(OBJEXT) valid.$(OBJEXT) \
|
||||
xmalloc.$(OBJEXT)
|
||||
basename.$(OBJEXT) chkname.$(OBJEXT) chowndir.$(OBJEXT) \
|
||||
chowntty.$(OBJEXT) console.$(OBJEXT) copydir.$(OBJEXT) \
|
||||
entry.$(OBJEXT) env.$(OBJEXT) failure.$(OBJEXT) \
|
||||
fields.$(OBJEXT) getdate.$(OBJEXT) hushed.$(OBJEXT) \
|
||||
isexpired.$(OBJEXT) limits.$(OBJEXT) list.$(OBJEXT) \
|
||||
log.$(OBJEXT) loginprompt.$(OBJEXT) mail.$(OBJEXT) \
|
||||
motd.$(OBJEXT) myname.$(OBJEXT) obscure.$(OBJEXT) \
|
||||
pam_pass.$(OBJEXT) pwd2spwd.$(OBJEXT) pwdcheck.$(OBJEXT) \
|
||||
pwd_init.$(OBJEXT) rlogin.$(OBJEXT) salt.$(OBJEXT) \
|
||||
setugid.$(OBJEXT) setupenv.$(OBJEXT) shell.$(OBJEXT) \
|
||||
strtoday.$(OBJEXT) sub.$(OBJEXT) sulog.$(OBJEXT) \
|
||||
ttytype.$(OBJEXT) tz.$(OBJEXT) ulimit.$(OBJEXT) utmp.$(OBJEXT) \
|
||||
valid.$(OBJEXT) xmalloc.$(OBJEXT)
|
||||
libmisc_a_OBJECTS = $(am_libmisc_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@@ -127,10 +126,12 @@ LIBCRACK = @LIBCRACK@
|
||||
LIBCRYPT = @LIBCRYPT@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBMD = @LIBMD@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPAM = @LIBPAM@
|
||||
LIBS = @LIBS@
|
||||
LIBSELINUX = @LIBSELINUX@
|
||||
LIBSKEY = @LIBSKEY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
@@ -213,7 +214,6 @@ libmisc_a_SOURCES = \
|
||||
basename.c \
|
||||
chkname.c \
|
||||
chkname.h \
|
||||
chkshell.c \
|
||||
chowndir.c \
|
||||
chowntty.c \
|
||||
console.c \
|
||||
@@ -304,7 +304,6 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/age.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkname.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkshell.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chowndir.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chowntty.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console.Po@am__quote@
|
||||
|
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright 1989 - 1994, Julianne Frances Haugh
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of Julianne F. Haugh nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: chkshell.c,v 1.2 2003/04/22 10:59:21 kloczek Exp $")
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#ifndef SHELLS_FILE
|
||||
#define SHELLS_FILE "/etc/shells"
|
||||
#endif
|
||||
/*
|
||||
* check_shell - see if the user's login shell is listed in /etc/shells
|
||||
*
|
||||
* The /etc/shells file is read for valid names of login shells. If the
|
||||
* /etc/shells file does not exist the user cannot set any shell unless
|
||||
* they are root.
|
||||
*
|
||||
* If getusershell() is available (Linux, *BSD, possibly others), use it
|
||||
* instead of re-implementing it.
|
||||
*/
|
||||
int check_shell (const char *sh)
|
||||
{
|
||||
char *cp;
|
||||
int found = 0;
|
||||
|
||||
#ifndef HAVE_GETUSERSHELL
|
||||
char buf[BUFSIZ];
|
||||
FILE *fp;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETUSERSHELL
|
||||
setusershell ();
|
||||
while ((cp = getusershell ())) {
|
||||
if (*cp == '#')
|
||||
continue;
|
||||
|
||||
if (strcmp (cp, sh) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
endusershell ();
|
||||
#else
|
||||
if ((fp = fopen (SHELLS_FILE, "r")) == (FILE *) 0)
|
||||
return 0;
|
||||
|
||||
while (fgets (buf, sizeof (buf), fp)) {
|
||||
if ((cp = strrchr (buf, '\n')))
|
||||
*cp = '\0';
|
||||
|
||||
if (buf[0] == '#')
|
||||
continue;
|
||||
|
||||
if (strcmp (buf, sh) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose (fp);
|
||||
#endif
|
||||
return found;
|
||||
}
|
@@ -149,7 +149,7 @@
|
||||
|
||||
#include "getdate.h"
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (USG)
|
||||
#if defined (STDC_HEADERS)
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
|
@@ -54,7 +54,7 @@
|
||||
|
||||
#include "getdate.h"
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (USG)
|
||||
#if defined (STDC_HEADERS)
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
|
@@ -1,10 +1,11 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: pwdcheck.c,v 1.6 2005/05/25 18:20:22 kloczek Exp $")
|
||||
RCSID ("$Id: pwdcheck.c,v 1.7 2005/07/18 12:55:36 kloczek Exp $")
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include <pwd.h>
|
||||
#include "pwauth.h"
|
||||
#ifdef HAVE_SHADOW_H
|
||||
#include <shadow.h>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: setupenv.c,v 1.14 2005/03/31 05:14:50 kloczek Exp $")
|
||||
RCSID ("$Id: setupenv.c,v 1.17 2005/07/06 11:49:21 kloczek Exp $")
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
@@ -238,7 +238,17 @@ void setup_env (struct passwd *info)
|
||||
* Create the PATH environmental variable and export it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Export the user name. For BSD derived systems, it's "USER", for
|
||||
* all others it's "LOGNAME". We set both of them.
|
||||
*/
|
||||
|
||||
addenv ("USER", info->pw_name);
|
||||
addenv ("LOGNAME", info->pw_name);
|
||||
|
||||
#ifndef USE_PAM
|
||||
cp = getdef_str ((info->pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
|
||||
|
||||
if (!cp) {
|
||||
/* not specified, use a minimal default */
|
||||
addenv ("PATH=/bin:/usr/bin", NULL);
|
||||
@@ -250,14 +260,6 @@ void setup_env (struct passwd *info)
|
||||
addenv ("PATH", cp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Export the user name. For BSD derived systems, it's "USER", for
|
||||
* all others it's "LOGNAME". We set both of them.
|
||||
*/
|
||||
|
||||
addenv ("USER", info->pw_name);
|
||||
addenv ("LOGNAME", info->pw_name);
|
||||
|
||||
/*
|
||||
* MAILDIR environment variable for Qmail
|
||||
*/
|
||||
@@ -281,11 +283,10 @@ void setup_env (struct passwd *info)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef USE_PAM
|
||||
/*
|
||||
* Read environment from optional config file. --marekm
|
||||
*/
|
||||
if ((envf = getdef_str ("ENVIRON_FILE")))
|
||||
read_env_file (envf);
|
||||
#endif
|
||||
#endif /* !USE_PAM */
|
||||
}
|
||||
|
@@ -30,11 +30,12 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: sub.c,v 1.7 2003/04/22 10:59:22 kloczek Exp $")
|
||||
RCSID ("$Id: sub.c,v 1.8 2005/07/18 13:19:05 kloczek Exp $")
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include <pwd.h>
|
||||
#define BAD_SUBROOT2 "invalid root `%s' for user `%s'\n"
|
||||
#define NO_SUBROOT2 "no subsystem root `%s' for user `%s'\n"
|
||||
/*
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: tz.c,v 1.5 2003/04/22 10:59:22 kloczek Exp $")
|
||||
RCSID ("$Id: tz.c,v 1.6 2005/07/06 11:33:05 kloczek Exp $")
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "defines.h"
|
||||
@@ -49,8 +49,10 @@ char *tz (const char *fname)
|
||||
|
||||
if ((fp = fopen (fname, "r")) == NULL ||
|
||||
fgets (tzbuf, sizeof (tzbuf), fp) == NULL) {
|
||||
#ifndef USE_PAM
|
||||
if (!(def_tz = getdef_str ("ENV_TZ")) || def_tz[0] == '/')
|
||||
def_tz = "TZ=CST6CDT";
|
||||
#endif /* !USE_PAM */
|
||||
|
||||
strcpy (tzbuf, def_tz);
|
||||
} else
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID ("$Id: utmp.c,v 1.15 2005/03/31 05:14:50 kloczek Exp $")
|
||||
RCSID ("$Id: utmp.c,v 1.16 2005/07/05 20:17:51 kloczek Exp $")
|
||||
#if HAVE_UTMPX_H
|
||||
struct utmpx utxent;
|
||||
#endif
|
||||
@@ -217,29 +217,7 @@ void checkutmp (int picky)
|
||||
}
|
||||
}
|
||||
|
||||
#else /* !USG */
|
||||
|
||||
void checkutmp (int picky)
|
||||
{
|
||||
char *line;
|
||||
|
||||
/*
|
||||
* Hand-craft a new utmp entry.
|
||||
*/
|
||||
|
||||
memzero (&utent, sizeof utent);
|
||||
if (!(line = ttyname (0))) {
|
||||
puts (NO_TTY);
|
||||
exit (1);
|
||||
}
|
||||
if (strncmp (line, "/dev/", 5) == 0)
|
||||
line += 5;
|
||||
|
||||
(void) strncpy (utent.ut_line, line, sizeof utent.ut_line);
|
||||
utent.ut_time = time (NULL);
|
||||
}
|
||||
|
||||
#endif /* !USG */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user