[svn-upgrade] Integrating new upstream version, shadow (20000826)
This commit is contained in:
@ -78,6 +78,7 @@ INTLOBJS = @INTLOBJS@
|
||||
LD = @LD@
|
||||
LIBCRACK = @LIBCRACK@
|
||||
LIBCRYPT = @LIBCRYPT@
|
||||
LIBMD = @LIBMD@
|
||||
LIBPAM = @LIBPAM@
|
||||
LIBSKEY = @LIBSKEY@
|
||||
LIBTCFS = @LIBTCFS@
|
||||
@ -339,8 +340,8 @@ suauth.o: suauth.c ../config.h ../lib/prototypes.h ../lib/defines.h \
|
||||
../lib/gshadow_.h
|
||||
sub.o: sub.c ../config.h ../lib/rcsid.h ../lib/prototypes.h \
|
||||
../lib/defines.h ../lib/gshadow_.h
|
||||
sulog.o: sulog.c ../config.h ../lib/rcsid.h ../lib/defines.h \
|
||||
../lib/gshadow_.h ../lib/getdef.h
|
||||
sulog.o: sulog.c ../config.h ../lib/rcsid.h ../lib/prototypes.h \
|
||||
../lib/defines.h ../lib/gshadow_.h ../lib/getdef.h
|
||||
ttytype.o: ttytype.c ../config.h ../lib/rcsid.h ../lib/prototypes.h \
|
||||
../lib/defines.h ../lib/gshadow_.h ../lib/getdef.h
|
||||
tz.o: tz.c ../config.h ../lib/rcsid.h ../lib/defines.h ../lib/gshadow_.h \
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: chkname.h,v 1.1 1997/12/07 23:27:00 marekm Exp $ */
|
||||
/* $Id: chkname.h,v 1.2 2000/08/26 18:27:17 marekm Exp $ */
|
||||
#ifndef _CHKNAME_H_
|
||||
#define _CHKNAME_H_
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
extern int check_user_name P_((const char *));
|
||||
extern int check_group_name P_((const char *name));
|
||||
extern int check_user_name(const char *);
|
||||
extern int check_group_name(const char *name);
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: chowndir.c,v 1.5 1998/04/16 19:57:43 marekm Exp $")
|
||||
RCSID("$Id: chowndir.c,v 1.6 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -94,10 +94,11 @@ chown_tree(const char *root, uid_t old_uid, uid_t new_uid, gid_t old_gid, gid_t
|
||||
|
||||
snprintf(new_name, sizeof new_name, "%s/%s", root, ent->d_name);
|
||||
|
||||
if (stat (new_name, &sb) == -1)
|
||||
/* Don't follow symbolic links! */
|
||||
if (LSTAT(new_name, &sb) == -1)
|
||||
continue;
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
if (S_ISDIR(sb.st_mode) && !S_ISLNK(sb.st_mode)) {
|
||||
|
||||
/*
|
||||
* Do the entire subdirectory.
|
||||
@ -107,8 +108,13 @@ chown_tree(const char *root, uid_t old_uid, uid_t new_uid, gid_t old_gid, gid_t
|
||||
old_gid, new_gid)))
|
||||
break;
|
||||
}
|
||||
#ifndef HAVE_LCHOWN
|
||||
/* don't use chown (follows symbolic links!) */
|
||||
if (S_ISLNK(sb.st_mode))
|
||||
continue;
|
||||
#endif
|
||||
if (sb.st_uid == old_uid)
|
||||
chown (new_name, new_uid,
|
||||
LCHOWN(new_name, new_uid,
|
||||
sb.st_gid == old_gid ? new_gid:sb.st_gid);
|
||||
}
|
||||
closedir (dir);
|
||||
@ -119,7 +125,7 @@ chown_tree(const char *root, uid_t old_uid, uid_t new_uid, gid_t old_gid, gid_t
|
||||
|
||||
if (! stat (root, &sb)) {
|
||||
if (sb.st_uid == old_uid)
|
||||
chown (root, new_uid,
|
||||
LCHOWN(root, new_uid,
|
||||
sb.st_gid == old_gid ? new_gid:sb.st_gid);
|
||||
}
|
||||
return rc;
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: copydir.c,v 1.6 1998/06/25 22:10:42 marekm Exp $")
|
||||
RCSID("$Id: copydir.c,v 1.7 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
|
||||
#include <sys/stat.h>
|
||||
@ -192,11 +192,7 @@ copy_tree(const char *src_root, const char *dst_root, uid_t uid, gid_t gid)
|
||||
}
|
||||
snprintf(dst_name, sizeof dst_name, "%s/%s", dst_root, ent->d_name);
|
||||
|
||||
#ifdef S_IFLNK
|
||||
if (lstat (src_name, &sb) == -1)
|
||||
#else
|
||||
if (stat (src_name, &sb) == -1)
|
||||
#endif
|
||||
if (LSTAT(src_name, &sb) == -1)
|
||||
continue;
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
@ -380,11 +376,7 @@ remove_tree(const char *root)
|
||||
break;
|
||||
}
|
||||
snprintf(new_name, sizeof new_name, "%s/%s", root, ent->d_name);
|
||||
#ifdef S_IFLNK
|
||||
if (lstat (new_name, &sb) == -1)
|
||||
#else
|
||||
if (stat (new_name, &sb) == -1)
|
||||
#endif
|
||||
if (LSTAT(new_name, &sb) == -1)
|
||||
continue;
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: entry.c,v 1.3 1997/12/07 23:27:03 marekm Exp $")
|
||||
RCSID("$Id: entry.c,v 1.4 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
@ -38,10 +38,10 @@ RCSID("$Id: entry.c,v 1.3 1997/12/07 23:27:03 marekm Exp $")
|
||||
#include "defines.h"
|
||||
#include <pwd.h>
|
||||
|
||||
struct passwd *fgetpwent ();
|
||||
extern struct passwd *fgetpwent ();
|
||||
|
||||
void
|
||||
entry(const char *name, struct passwd *pwent)
|
||||
pw_entry(const char *name, struct passwd *pwent)
|
||||
{
|
||||
struct passwd *passwd;
|
||||
#ifdef SHADOWPWD
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: failure.h,v 1.1 1997/12/07 23:27:04 marekm Exp $ */
|
||||
/* $Id: failure.h,v 1.2 2000/08/26 18:27:17 marekm Exp $ */
|
||||
#ifndef _FAILURE_H_
|
||||
#define _FAILURE_H_
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* failure() creates a new (struct faillog) entry or updates an
|
||||
* existing one with the current failed login information.
|
||||
*/
|
||||
extern void failure P_((uid_t, const char *, struct faillog *));
|
||||
extern void failure(uid_t, const char *, struct faillog *);
|
||||
|
||||
/*
|
||||
* failcheck - check for failures > allowable
|
||||
@ -22,7 +22,7 @@ extern void failure P_((uid_t, const char *, struct faillog *));
|
||||
* returns FALSE to indicate that the login should be denied even though
|
||||
* the password is valid.
|
||||
*/
|
||||
extern int failcheck P_((uid_t, struct faillog *, int));
|
||||
extern int failcheck(uid_t, struct faillog *, int);
|
||||
|
||||
/*
|
||||
* failprint - print line of failure information
|
||||
@ -30,7 +30,7 @@ extern int failcheck P_((uid_t, struct faillog *, int));
|
||||
* failprint takes a (struct faillog) entry and formats it into a
|
||||
* message which is displayed at login time.
|
||||
*/
|
||||
extern void failprint P_((const struct faillog *));
|
||||
extern void failprint(const struct faillog *);
|
||||
|
||||
/*
|
||||
* failtmp - update the cummulative failure log
|
||||
@ -38,7 +38,7 @@ extern void failprint P_((const struct faillog *));
|
||||
* failtmp updates the (struct utmp) formatted failure log which
|
||||
* maintains a record of all login failures.
|
||||
*/
|
||||
extern void failtmp P_((const struct utmp *));
|
||||
extern void failtmp(const struct utmp *);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -4,5 +4,5 @@
|
||||
#include <config.h>
|
||||
#include "defines.h"
|
||||
|
||||
time_t get_date P_((const char *p, const time_t *now));
|
||||
time_t get_date(const char *, const time_t *);
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: hushed.c,v 1.3 1997/12/07 23:27:05 marekm Exp $")
|
||||
RCSID("$Id: hushed.c,v 1.4 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
@ -68,7 +68,7 @@ hushed(const struct passwd *pw)
|
||||
*/
|
||||
|
||||
if (hushfile[0] != '/') {
|
||||
strcat(strcat(strcpy(buf, pw->pw_dir), "/"), hushfile);
|
||||
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, hushfile);
|
||||
return (access(buf, F_OK) == 0);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: loginprompt.c,v 1.5 1998/04/16 19:57:44 marekm Exp $")
|
||||
RCSID("$Id: loginprompt.c,v 1.6 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
@ -62,9 +62,9 @@ login_prompt(const char *prompt, char *name, int namesize)
|
||||
char *cp;
|
||||
int i;
|
||||
FILE *fp;
|
||||
RETSIGTYPE (*sigquit) P_((int));
|
||||
RETSIGTYPE (*sigquit)(int);
|
||||
#ifdef SIGTSTP
|
||||
RETSIGTYPE (*sigtstp) P_((int));
|
||||
RETSIGTYPE (*sigtstp)(int);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: setupenv.c,v 1.9 1999/03/07 19:14:41 marekm Exp $")
|
||||
RCSID("$Id: setupenv.c,v 1.10 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -235,8 +235,21 @@ setup_env(struct passwd *info)
|
||||
* Create the PATH environmental variable and export it.
|
||||
*/
|
||||
|
||||
cp = getdef_str( info->pw_uid == 0 ? "ENV_SUPATH" : "ENV_PATH" );
|
||||
cp = getdef_str((info->pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
|
||||
#if 0
|
||||
addenv(cp ? cp : "PATH=/bin:/usr/bin", NULL);
|
||||
#else
|
||||
if (!cp) {
|
||||
/* not specified, use a minimal default */
|
||||
addenv("PATH=/bin:/usr/bin", NULL);
|
||||
} else if (strchr(cp, '=')) {
|
||||
/* specified as name=value (PATH=...) */
|
||||
addenv(cp, NULL);
|
||||
} else {
|
||||
/* only value specified without "PATH=" */
|
||||
addenv("PATH", cp);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Export the user name. For BSD derived systems, it's "USER", for
|
||||
@ -269,9 +282,11 @@ 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
|
||||
}
|
||||
|
@ -23,10 +23,10 @@
|
||||
* strings output to the user or the syslog. -- chris
|
||||
*/
|
||||
|
||||
static int applies P_((const char *, char *));
|
||||
static int applies(const char *, char *);
|
||||
|
||||
int check_su_auth P_((const char *, const char *));
|
||||
int isgrp P_((const char *, const char *));
|
||||
int check_su_auth(const char *, const char *);
|
||||
int isgrp(const char *, const char *);
|
||||
|
||||
static int lines = 0;
|
||||
|
||||
|
@ -30,25 +30,22 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: sulog.c,v 1.4 1998/04/02 21:51:51 marekm Exp $")
|
||||
RCSID("$Id: sulog.c,v 1.5 2000/08/26 18:27:17 marekm Exp $")
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
|
||||
extern char name[];
|
||||
extern char oldname[];
|
||||
extern struct tm *localtime ();
|
||||
|
||||
/*
|
||||
* sulog - log a SU command execution result
|
||||
*/
|
||||
|
||||
void
|
||||
sulog(const char *tty, int success)
|
||||
sulog(const char *tty, int success, const char *oldname, const char *name)
|
||||
{
|
||||
char *sulog_file;
|
||||
time_t now;
|
||||
|
Reference in New Issue
Block a user