home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-14 | 29.6 KB | 1,126 lines |
- Newsgroups: comp.sources.misc
- From: jfh@rpp386.cactus.org (John F. Haugh II)
- Subject: v38i133: shadow - Shadow Password Suite, v3.3, Part14/14
- Message-ID: <1993Aug14.192711.10054@sparky.sterling.com>
- X-Md4-Signature: 8a8f59a70a424c257f89084a02f63a17
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Sat, 14 Aug 1993 19:27:11 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: jfh@rpp386.cactus.org (John F. Haugh II)
- Posting-number: Volume 38, Issue 133
- Archive-name: shadow/part14
- Environment: UNIX
- Supersedes: shadow: Volume 26, Issue 54-64
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: chpasswd.8 dpasswd.8 faillog.4 faillog.h fields.c
- # groupadd.1 groupdel.1 groups.1 id.1 lastlog.h lockpw.c logoutd.8
- # mkrmdir.c motd.c patchlevel.h pwauth.h pwunconv.8 spdbm.c tz.c
- # Wrapped by kent@sparky on Sat Aug 14 14:11:42 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 14 (of 14)."'
- if test -f 'chpasswd.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'chpasswd.8'\"
- else
- echo shar: Extracting \"'chpasswd.8'\" \(1273 characters\)
- sed "s/^X//" >'chpasswd.8' <<'END_OF_FILE'
- X.\" Copyright 1991, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" @(#)chpasswd.8 3.1 16:50:16 04 Aug 1991
- X.\"
- X.TH CHPASSWD 8
- X.SH NAME
- X\fBchpasswd\fR - update password file in batch
- X.SH SYNOPSIS
- X\fBchpasswd\fR
- X.SH DESCRIPTION
- X\fBchpasswd\fR reads a file of user name and cleartext password pairs
- Xfrom standard input and uses this information
- Xto update a group of existing users.
- XEach line is of the format
- X.DS
- X \fIuser_name\fR:\fIpassword\fR
- X.DE
- XThe named user must exist.
- XThe supplied password will be encrypted and the password age updated,
- Xif present.
- X.PP
- XThis command is intended to be used in a large system environment where
- Xmany accounts are created at a single time.
- X.SH CAVEATS
- XThe \fImkpasswd\fR command must be executed afterwards to update the
- XDBM password files.
- XThe input file must be protected since it contains unencrypted passwords.
- XThis command may be discarded in favor of the newusers(8) command.
- X.SH SEE ALSO
- Xmkpasswd(8), passwd(1), useradd(1)
- END_OF_FILE
- if test 1273 -ne `wc -c <'chpasswd.8'`; then
- echo shar: \"'chpasswd.8'\" unpacked with wrong size!
- fi
- # end of 'chpasswd.8'
- fi
- if test -f 'dpasswd.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dpasswd.8'\"
- else
- echo shar: Extracting \"'dpasswd.8'\" \(1002 characters\)
- sed "s/^X//" >'dpasswd.8' <<'END_OF_FILE'
- X.\" Copyright 1991, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" @(#)dpasswd.8 3.1 17:36:06 04 Aug 1991
- X.\"
- X.TH DPASSWD 8
- X.SH NAME
- X\fBdpasswd\fR - change dialup password
- X.SH SYNOPSIS
- X\fBdpasswd\fR
- X[ \fI-(a|d)\fR ] \fIshell\fR
- X.SH DESCRIPTION
- X\fBdpasswd\fR adds, deletes, and updates dialup passwords for user
- Xlogin shells.
- XThe dialup password is prompted for after a user's password has been
- Xauthenticated whenever the user logs in over a dialup line.
- X\fBdpasswd\fR will prompt for the new password twice to insure it
- Xhas been entered correctly.
- X.PP
- XThe \fIshell\fR argument must be the complete pathname of the login
- Xprogram.
- X.SH FILES
- X.br
- X/etc/d_passwd
- X.br
- X/etc/dialups
- X.SH SEE ALSO
- Xlogin(1)
- END_OF_FILE
- if test 1002 -ne `wc -c <'dpasswd.8'`; then
- echo shar: \"'dpasswd.8'\" unpacked with wrong size!
- fi
- # end of 'dpasswd.8'
- fi
- if test -f 'faillog.4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'faillog.4'\"
- else
- echo shar: Extracting \"'faillog.4'\" \(972 characters\)
- sed "s/^X//" >'faillog.4' <<'END_OF_FILE'
- X.\" Copyright 1989, 1990, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Use, duplication, and disclosure prohibited without
- X.\" the express written permission of the author.
- X.\"
- X.\" @(#)faillog.4 3.1 09:34:18 21 Nov 1990
- X.\"
- X.TH FAILLOG 4
- X.SH NAME
- Xfaillog \- Login failure logging file
- X.SH DESCRIPTION
- X.I faillog
- Xmaintains a count of login failures and the limits for each account.
- XThe file is fixed length record, indexed by numerical UID.
- XEach record contains the count of login failures since the last
- Xsuccessful login;
- Xthe maximum number of failures before the account is disabled;
- Xthe line the last login failure occured on;
- Xand the date the last login failure occured.
- X.PP
- XThe structure of the file is
- X.DS
- X
- X struct faillog {
- X short fail_cnt;
- X short fail_max;
- X char fail_line[12];
- X time_t fail_time;
- X };
- X
- X.DE
- X.SH Files
- X/usr/adm/faillog \- login failure log
- X.SH See Also
- Xfaillog(8)
- END_OF_FILE
- if test 972 -ne `wc -c <'faillog.4'`; then
- echo shar: \"'faillog.4'\" unpacked with wrong size!
- fi
- # end of 'faillog.4'
- fi
- if test -f 'faillog.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'faillog.h'\"
- else
- echo shar: Extracting \"'faillog.h'\" \(978 characters\)
- sed "s/^X//" >'faillog.h' <<'END_OF_FILE'
- X/*
- X * Copyright 1989, 1990, 1992, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X */
- X
- X/*
- X * faillog.h - login failure logging file format
- X *
- X * @(#)faillog.h 3.1 20:36:28 07 Mar 1992
- X *
- X * The login failure file is maintained by login(1) and faillog(8)
- X * Each record in the file represents a separate UID and the file
- X * is indexed in that fashion.
- X */
- X
- X#ifdef SVR4
- X#define FAILFILE "/var/adm/faillog"
- X#else
- X#define FAILFILE "/usr/adm/faillog"
- X#endif
- X
- Xstruct faillog {
- X short fail_cnt; /* failures since last success */
- X short fail_max; /* failures before turning account off */
- X char fail_line[12]; /* last failure occured here */
- X time_t fail_time; /* last failure occured then */
- X};
- END_OF_FILE
- if test 978 -ne `wc -c <'faillog.h'`; then
- echo shar: \"'faillog.h'\" unpacked with wrong size!
- fi
- # end of 'faillog.h'
- fi
- if test -f 'fields.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'fields.c'\"
- else
- echo shar: Extracting \"'fields.c'\" \(1233 characters\)
- sed "s/^X//" >'fields.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1990, John F. Haugh II
- X * All rights reserved.
- X *
- X * Use, duplication, and disclosure prohibited without
- X * the express written permission of the author.
- X */
- X
- X#include <ctype.h>
- X#include <string.h>
- X#include <stdio.h>
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)fields.c 3.2 08:26:23 26 Nov 1990";
- X#endif
- X
- Xextern char *Progname;
- X
- X/*
- X * valid_field - insure that a field contains all legal characters
- X *
- X * The supplied field is scanned for non-printing and other illegal
- X * characters. If any illegal characters are found, valid_field
- X * returns -1. Zero is returned for success.
- X */
- X
- Xint
- Xvalid_field (field, illegal)
- Xchar *field;
- Xchar *illegal;
- X{
- X char *cp;
- X
- X for (cp = field;*cp && isprint (*cp) && ! strchr (illegal, *cp);cp++)
- X ;
- X
- X if (*cp)
- X return -1;
- X else
- X return 0;
- X}
- X
- X/*
- X * change_field - change a single field if a new value is given.
- X *
- X * prompt the user with the name of the field being changed and the
- X * current value.
- X */
- X
- Xvoid
- Xchange_field (buf, prompt)
- Xchar *buf;
- Xchar *prompt;
- X{
- X char new[BUFSIZ];
- X char *cp;
- X
- X printf ("\t%s [%s]: ", prompt, buf);
- X if (fgets (new, BUFSIZ, stdin) != new)
- X return;
- X
- X if (cp = strchr (new, '\n'))
- X *cp = '\0';
- X else
- X return;
- X
- X if (new[0])
- X strcpy (buf, new);
- X}
- END_OF_FILE
- if test 1233 -ne `wc -c <'fields.c'`; then
- echo shar: \"'fields.c'\" unpacked with wrong size!
- fi
- # end of 'fields.c'
- fi
- if test -f 'groupadd.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'groupadd.1'\"
- else
- echo shar: Extracting \"'groupadd.1'\" \(1353 characters\)
- sed "s/^X//" >'groupadd.1' <<'END_OF_FILE'
- X.\" Copyright 1991, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" @(#)groupadd.1 3.1 13:28:00 13 Jul 1991
- X.\"
- X.TH GROUPADD 1M
- X.SH NAME
- Xgroupadd \- Create a new group
- X.SH SYNOPSIS
- X.B groupadd
- X[ \fB-g\fI gid \fR[ \fB-o\fR ] ]
- X.I group
- X.SH DESCRIPTION
- XThe \fIgroupadd\fR command
- Xcreates a new group account using the values specified on the
- Xcommand line and the default values from the system.
- XThe new group will be entered into the system files as needed.
- XThe options which apply to the \fIgroupadd\fR command are
- X.IP "\fB-g \fIgid\fR"
- XThe numerical value of the group's ID.
- XThis value must be unique, unless the \fI-o\fR option is used.
- XThe value must be non-negative.
- XThe default is to use the smallest ID value greater than 99 and
- Xgreater than every other group.
- XValues between 0 and 99 are typically reserved for system accounts.
- X.SH Files
- X/etc/group \- group account information
- X.br
- X/etc/gshadow \- secure group account information
- X.SH SEE ALSO
- X\fBchfn(1), chsh(1), useradd(1M), userdel(1M), usermod(1M),
- Xpasswd(1), groupdel(1M), groupmod(1M)
- END_OF_FILE
- if test 1353 -ne `wc -c <'groupadd.1'`; then
- echo shar: \"'groupadd.1'\" unpacked with wrong size!
- fi
- # end of 'groupadd.1'
- fi
- if test -f 'groupdel.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'groupdel.1'\"
- else
- echo shar: Extracting \"'groupdel.1'\" \(1207 characters\)
- sed "s/^X//" >'groupdel.1' <<'END_OF_FILE'
- X.\" Copyright 1991, 1993, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" This software is provided on an AS-IS basis and the author makes
- X.\" no warrantee of any kind.
- X.\"
- X.\" @(#)groupdel.1 3.2 08:14:28 23 Apr 1993
- X.\"
- X.TH GROUPDEL 1M
- X.SH NAME
- Xgroupdel \- Delete a group
- X.SH SYNOPSIS
- X.B groupdel
- X.I group
- X.SH DESCRIPTION
- XThe \fIgroupdel\fR command modifies the system account files, deleting
- Xall entries that refer to \fIgroup\fR.
- XThe named group must exist.
- X.PP
- XYou must manually check all filesystems to insure that no files remain
- Xwith the named group as the file group ID.
- X.SH CAVEATS
- XYou may not remove the primary group of any existing user.
- XYou must remove the user before you remove the group.
- X.SH Files
- X/etc/group \- group information
- X.br
- X/etc/gshadow \- secure group information
- X.SH SEE ALSO
- X\fBchfn(1), chsh(1), useradd(1M), userdel(1M), usermod(1M),
- Xpasswd(1), groupadd(1M), groupmod(1M)
- END_OF_FILE
- if test 1207 -ne `wc -c <'groupdel.1'`; then
- echo shar: \"'groupdel.1'\" unpacked with wrong size!
- fi
- # end of 'groupdel.1'
- fi
- if test -f 'groups.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'groups.1'\"
- else
- echo shar: Extracting \"'groups.1'\" \(1118 characters\)
- sed "s/^X//" >'groups.1' <<'END_OF_FILE'
- X.\" Copyright 1991, 1992, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" @(#)groups.1 3.2 14:52:10 28 Apr 1992
- X.\"
- X.TH GROUPS 1
- X.SH NAME
- Xgroups \- Display current group ID names
- X.SH SYNOPSIS
- X.B groups
- X[
- X.I user
- X]
- X.SH DESCRIPTION
- X.I groups
- Xdisplays the current group ID names
- Xor values.
- XIf the value does not have a corresponding entry in
- X\fB/etc/group\fR, the value will be displayed as the numerical group value.
- XThe optional \fIuser\fR parameter will display the groups for the named
- X\fIuser\R.
- X.SH Note
- XSystems which do not support concurrent group sets will have the information
- Xfrom \fB/etc/group\fR reported.
- XThe user must use \fInewgrp\fR or \fIsg\fR to change their current real and
- Xeffective group ID.
- X.SH Files
- X/etc/group \- group information
- X.SH See Also
- Xnewgrp(1), getuid(2), getgid(2), getgroups(2)
- END_OF_FILE
- if test 1118 -ne `wc -c <'groups.1'`; then
- echo shar: \"'groups.1'\" unpacked with wrong size!
- fi
- # end of 'groups.1'
- fi
- if test -f 'id.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'id.1'\"
- else
- echo shar: Extracting \"'id.1'\" \(1003 characters\)
- sed "s/^X//" >'id.1' <<'END_OF_FILE'
- X.\" Copyright 1991, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" @(#)id.1 3.2 07:24:54 01 Aug 1991
- X.\"
- X.TH ID 1
- X.SH NAME
- Xid \- Display current user and group ID names
- X.SH SYNOPSIS
- X.B id
- X[
- X.B -a
- X]
- X.SH DESCRIPTION
- X.I id
- Xdisplays the current real and effective user and group ID names
- Xor values.
- XIf the value does not have a corresponding entry in \fB/etc/passwd\fR
- Xor \fB/etc/group\fR, the value will be displayed without the corresponding
- Xname.
- XThe optional \fB-a\fR flag will display the group set on systems which
- Xsupport multiple concurrent group membership.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/group \- group information
- X.SH See Also
- Xgetuid(2), getgid(2), getgroups(2)
- END_OF_FILE
- if test 1003 -ne `wc -c <'id.1'`; then
- echo shar: \"'id.1'\" unpacked with wrong size!
- fi
- # end of 'id.1'
- fi
- if test -f 'lastlog.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'lastlog.h'\"
- else
- echo shar: Extracting \"'lastlog.h'\" \(860 characters\)
- sed "s/^X//" >'lastlog.h' <<'END_OF_FILE'
- X/*
- X * Copyright 1989, 1990, 1992, 1993, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X *
- X * This software is provided on an AS-IS basis and the author makes
- X * not warrantee of any kind.
- X */
- X
- X/*
- X * lastlog.h - structure of lastlog file
- X *
- X * @(#)lastlog.h 3.1.1.2 08:57:40 10 Jun 1993
- X *
- X * This file defines a lastlog file structure which should be sufficient
- X * to hold the information required by login. It should only be used if
- X * there is no real lastlog.h file.
- X */
- X
- Xstruct lastlog {
- X time_t ll_time;
- X char ll_line[8];
- X#ifdef SVR4
- X char ll_host[16];
- X#endif
- X};
- END_OF_FILE
- if test 860 -ne `wc -c <'lastlog.h'`; then
- echo shar: \"'lastlog.h'\" unpacked with wrong size!
- fi
- # end of 'lastlog.h'
- fi
- if test -f 'lockpw.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'lockpw.c'\"
- else
- echo shar: Extracting \"'lockpw.c'\" \(1264 characters\)
- sed "s/^X//" >'lockpw.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1992, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X *
- X * This software is provided on an AS-IS basis and the author makes
- X * no warrantee of any kind.
- X */
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)lockpw.c 3.1 08:12:51 12 Nov 1992";
- X#endif
- X
- X/*
- X * lckpwdf - lock the password files
- X */
- X
- Xint
- Xlckpwdf ()
- X{
- X int i;
- X
- X /*
- X * We have 15 seconds to lock the whole mess
- X */
- X
- X for (i = 0;i < 15;i++)
- X if (pw_lock ())
- X break;
- X else
- X sleep (1);
- X
- X /*
- X * Did we run out of time?
- X */
- X
- X if (i == 15)
- X return -1;
- X
- X /*
- X * Nope, use any remaining time to lock the shadow password
- X * file.
- X */
- X
- X for (;i < 15;i++)
- X if (spw_lock ())
- X break;
- X else
- X sleep (1);
- X
- X /*
- X * Out of time yet?
- X */
- X
- X if (i == 15) {
- X pw_unlock ();
- X return -1;
- X }
- X
- X /*
- X * Nope - and both files are now locked.
- X */
- X
- X return 0;
- X}
- X
- X/*
- X * ulckpwdf - unlock the password files
- X */
- X
- Xint
- Xulckpwdf ()
- X{
- X
- X /*
- X * Unlock both files.
- X */
- X
- X return (pw_unlock () && spw_unlock ()) ? 0:-1;
- X}
- END_OF_FILE
- if test 1264 -ne `wc -c <'lockpw.c'`; then
- echo shar: \"'lockpw.c'\" unpacked with wrong size!
- fi
- # end of 'lockpw.c'
- fi
- if test -f 'logoutd.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'logoutd.8'\"
- else
- echo shar: Extracting \"'logoutd.8'\" \(1003 characters\)
- sed "s/^X//" >'logoutd.8' <<'END_OF_FILE'
- X.\" Copyright 1991, John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" @(#)logoutd.8 3.1 16:31:36 22 Sep 1991
- X.\"
- X.TH LOGOUTD 8
- X.SH NAME
- Xlogoutd \- Enforce login time restrictions
- X.SH SYNOPSIS
- X.B /etc/logoutd
- X.SH DESCRIPTION
- X.I logoutd enforces the login time and port restrictions specified in
- X/etc/porttime.
- X.I logoutd should be started from \fB/etc/rc\fR.
- XThe \fB/etc/utmp\fR file is scanned periodically and each user name
- Xis checked to see if the named user is permitted on the named port
- Xat the current time.
- XAny login session which is violating the restrictions in \fB/etc/porttime\fR
- Xis terminated.
- X.SH Files
- X/etc/porttime \- login and port permissions
- X.br
- X/etc/utmp \- current login sessions
- END_OF_FILE
- if test 1003 -ne `wc -c <'logoutd.8'`; then
- echo shar: \"'logoutd.8'\" unpacked with wrong size!
- fi
- # end of 'logoutd.8'
- fi
- if test -f 'mkrmdir.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mkrmdir.c'\"
- else
- echo shar: Extracting \"'mkrmdir.c'\" \(1338 characters\)
- sed "s/^X//" >'mkrmdir.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1991, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X */
- X
- X#include <fcntl.h>
- X#include "config.h"
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)mkrmdir.c 3.3 07:43:57 17 Sep 1991";
- X#endif
- X
- X#ifdef NEED_MKDIR
- X/*
- X * mkdir - create a directory
- X *
- X * mkdir is provided for systems which do not include the mkdir()
- X * system call.
- X */
- X
- Xint
- Xmkdir (dir, mode)
- Xchar *dir;
- Xint mode;
- X{
- X int status;
- X
- X if (fork ()) {
- X while (wait (&status) != -1)
- X ;
- X
- X return status >> 8;
- X }
- X#ifdef USE_SYSLOG
- X closelog ();
- X#endif
- X close (2);
- X open ("/dev/null", O_WRONLY);
- X umask (0777 & ~ mode);
- X execl ("/bin/mkdir", "mkdir", dir, 0);
- X _exit (128);
- X /*NOTREACHED*/
- X}
- X#endif
- X#ifdef NEED_RMDIR
- X/*
- X * rmdir - remove a directory
- X *
- X * rmdir is provided for systems which do not include the rmdir()
- X * system call.
- X */
- X
- Xint
- Xrmdir (dir)
- Xchar *dir;
- X{
- X int status;
- X
- X if (fork ()) {
- X while (wait (&status) != -1)
- X ;
- X
- X return status >> 8;
- X }
- X close (2);
- X open ("/dev/null", O_WRONLY);
- X execl ("/bin/rmdir", "rmdir", dir, 0);
- X _exit (128);
- X /*NOTREACHED*/
- X}
- X#endif
- END_OF_FILE
- if test 1338 -ne `wc -c <'mkrmdir.c'`; then
- echo shar: \"'mkrmdir.c'\" unpacked with wrong size!
- fi
- # end of 'mkrmdir.c'
- fi
- if test -f 'motd.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'motd.c'\"
- else
- echo shar: Extracting \"'motd.c'\" \(1079 characters\)
- sed "s/^X//" >'motd.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1989, 1990, 1991, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X */
- X
- X#include <stdio.h>
- X#ifndef BSD
- X#include <string.h>
- X#include <memory.h>
- X#else
- X#include <strings.h>
- X#define strchr index
- X#define strrchr rindex
- X#endif
- X#include "config.h"
- X
- X#ifndef lint
- Xstatic char _sccsid[] = "@(#)motd.c 3.1 07:43:40 17 Sep 1991";
- X#endif
- X
- Xextern char *getdef_str();
- X
- Xvoid motd ()
- X{
- X FILE *fp;
- X char motdlist[BUFSIZ], *motd, *mb;
- X register int c;
- X
- X if ((mb = getdef_str("MOTD_FILE")) == NULL)
- X return;
- X
- X strncpy(motdlist, mb, sizeof(motdlist));
- X motdlist[sizeof(motdlist)-1] = '\0';
- X
- X for (mb = motdlist ; (motd = strtok(mb,":")) != NULL ; mb = NULL) {
- X if ((fp = fopen(motd,"r")) != NULL) {
- X while ((c = getc (fp)) != EOF)
- X putchar (c);
- X fclose (fp);
- X }
- X }
- X fflush (stdout);
- X}
- END_OF_FILE
- if test 1079 -ne `wc -c <'motd.c'`; then
- echo shar: \"'motd.c'\" unpacked with wrong size!
- fi
- # end of 'motd.c'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(969 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X/*
- X * Copyright 1991, 1992, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X *
- X * Revision History
- X * 11/25/91 3.1.1 patchlevel 14
- X * Added "login.defs" to Makefile
- X * 12/02/91 3.1.2 patchlevel 15
- X * Bugs found by users
- X * 12/28/91 3.1.3 patchlevel 16
- X * Changes for SunOS 4.1.1
- X * 02/08/92 3.1.4 patchlevel 17
- X * Changes for SVR4, plus bug fixes
- X * 04/03/92 3.2.1 patchlevel 18
- X * Minor bug fixes, new baseline
- X * 07/07/92 3.2.2 patchlevel 20
- X * Added administrator defined authentication
- X * 11/04/92 3.2.3 patchlevel 21
- X * Bug fixes for SVR4
- X * 07/23/93 3.3.0 patchlevel 23
- X * New baseline release
- X */
- X
- X#define RELEASE 3
- X#define PATCHLEVEL 23
- X#define VERSION "3.3.0"
- END_OF_FILE
- if test 969 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- if test -f 'pwauth.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'pwauth.h'\"
- else
- echo shar: Extracting \"'pwauth.h'\" \(899 characters\)
- sed "s/^X//" >'pwauth.h' <<'END_OF_FILE'
- X/*
- X * Copyright 1992, 1993, John F. Haugh II
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X *
- X * This software is provided on an AS-IS basis and the author makes
- X * not warrantee of any kind.
- X *
- X * @(#)pwauth.h 3.2 17:40:49 01 May 1993
- X */
- X
- X#if __STDC__
- Xint pw_auth (char * program, char * user, int flag, char * input);
- X#else
- Xint pw_auth ();
- X#endif
- X
- X/*
- X * Local access
- X */
- X
- X#define PW_SU 1
- X#define PW_LOGIN 2
- X
- X/*
- X * Administrative functions
- X */
- X
- X#define PW_ADD 101
- X#define PW_CHANGE 102
- X#define PW_DELETE 103
- X
- X/*
- X * Network access
- X */
- X
- X#define PW_TELNET 201
- X#define PW_RLOGIN 202
- X#define PW_FTP 203
- X#define PW_REXEC 204
- END_OF_FILE
- if test 899 -ne `wc -c <'pwauth.h'`; then
- echo shar: \"'pwauth.h'\" unpacked with wrong size!
- fi
- # end of 'pwauth.h'
- fi
- if test -f 'pwunconv.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'pwunconv.8'\"
- else
- echo shar: Extracting \"'pwunconv.8'\" \(1293 characters\)
- sed "s/^X//" >'pwunconv.8' <<'END_OF_FILE'
- X.\" Copyright 1989, 1990, 1993 John F. Haugh II
- X.\" All rights reserved.
- X.\"
- X.\" Permission is granted to copy and create derivative works for any
- X.\" non-commercial purpose, provided this copyright notice is preserved
- X.\" in all copies of source code, or included in human readable form
- X.\" and conspicuously displayed on all copies of object code or
- X.\" distribution media.
- X.\"
- X.\" This software is provided on an AS-IS basis and the author makes
- X.\" no warrantee of any kind.
- X.\"
- X.\" @(#)pwunconv.8 3.2 12:24:15 02 May 1993
- X.\"
- X.TH PWUNCONV 8
- X.SH NAME
- Xpwunconv \- restore old password file from shadow password file
- X.SH SYNOPSIS
- Xpwunconv
- X.SH DESCRIPTION
- X\fIPwunconv\fR copies the password file information from the shadow
- Xpassword file,
- Xmerging entries from an optional existing shadow file.
- XThe new password file is left in \fBnpasswd\fR.
- XThis file is created with modes which allow read access for
- Xthe owner only.
- XThere is no new shadow file.
- XPassword aging information is translated where possible.
- XThere is some loss of resolution in the password aging information.
- X.SH FILES
- X/etc/passwd \- old encrypted passwords and password aging
- X.br
- X/etc/shadow \- previously converted shadow password file
- X.br
- X./npasswd \- new password file
- X.SH SEE ALSO
- Xpasswd(1),
- Xpasswd(4),
- Xshadow(4),
- Xpwconv(8)
- END_OF_FILE
- if test 1293 -ne `wc -c <'pwunconv.8'`; then
- echo shar: \"'pwunconv.8'\" unpacked with wrong size!
- fi
- # end of 'pwunconv.8'
- fi
- if test -f 'spdbm.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'spdbm.c'\"
- else
- echo shar: Extracting \"'spdbm.c'\" \(1235 characters\)
- sed "s/^X//" >'spdbm.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1990, 1991, John F. Haugh II
- X * All rights reserved.
- X *
- X * Use, duplication, and disclosure prohibited without
- X * the express written permission of the author.
- X */
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)spdbm.c 3.3 08:46:22 12 Sep 1991";
- X#endif
- X
- X#include <string.h>
- X#include <stdio.h>
- X#include "config.h"
- X#include "shadow.h"
- X
- X#ifdef NDBM
- X#include <ndbm.h>
- XDBM *sp_dbm;
- X
- X/*
- X * sp_dbm_update
- X *
- X * Updates the DBM password files, if they exist.
- X */
- X
- Xint
- Xsp_dbm_update (sp)
- Xstruct spwd *sp;
- X{
- X datum key;
- X datum content;
- X char data[BUFSIZ];
- X int len;
- X static int once;
- X
- X if (! once) {
- X if (! sp_dbm)
- X setspent ();
- X
- X once++;
- X }
- X if (! sp_dbm)
- X return 0;
- X
- X len = spw_pack (sp, data);
- X
- X content.dsize = len;
- X content.dptr = data;
- X
- X key.dsize = strlen (sp->sp_namp);
- X key.dptr = sp->sp_namp;
- X if (dbm_store (sp_dbm, key, content, DBM_REPLACE))
- X return 0;
- X
- X return 1;
- X}
- X
- X/*
- X * sp_dbm_remove
- X *
- X * Updates the DBM password files, if they exist.
- X */
- X
- Xint
- Xsp_dbm_remove (user)
- Xchar *user;
- X{
- X datum key;
- X static int once;
- X
- X if (! once) {
- X if (! sp_dbm)
- X setspent ();
- X
- X once++;
- X }
- X if (! sp_dbm)
- X return 0;
- X
- X key.dsize = strlen (user);
- X key.dptr = user;
- X if (dbm_delete (sp_dbm, key))
- X return 0;
- X
- X return 1;
- X}
- X#endif
- END_OF_FILE
- if test 1235 -ne `wc -c <'spdbm.c'`; then
- echo shar: \"'spdbm.c'\" unpacked with wrong size!
- fi
- # end of 'spdbm.c'
- fi
- if test -f 'tz.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tz.c'\"
- else
- echo shar: Extracting \"'tz.c'\" \(931 characters\)
- sed "s/^X//" >'tz.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1991, John F. Haugh II and Chip Rosenthal
- X * All rights reserved.
- X *
- X * Permission is granted to copy and create derivative works for any
- X * non-commercial purpose, provided this copyright notice is preserved
- X * in all copies of source code, or included in human readable form
- X * and conspicuously displayed on all copies of object code or
- X * distribution media.
- X */
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)tz.c 3.1 07:47:56 17 Sep 1991";
- X#endif
- X
- X#include <stdio.h>
- X
- X/*
- X * tz - return local timezone name
- X *
- X * Tz() determines the name of the local timezone by reading the
- X * contents of the file named by ``fname''.
- X */
- X
- Xchar *
- Xtz (fname)
- Xchar *fname;
- X{
- X FILE *fp;
- X static char tzbuf[64];
- X
- X if ((fp = fopen(fname,"r")) == NULL)
- X return "TZ=CST6CDT";
- X else if (fgets(tzbuf, sizeof(tzbuf), fp) == NULL)
- X strcpy(tzbuf, "TZ=CST6CDT");
- X else
- X tzbuf[strlen(tzbuf) - 1] = '\0';
- X
- X (void) fclose(fp);
- X return tzbuf;
- X}
- END_OF_FILE
- if test 931 -ne `wc -c <'tz.c'`; then
- echo shar: \"'tz.c'\" unpacked with wrong size!
- fi
- # end of 'tz.c'
- fi
- echo shar: End of archive 14 \(of 14\).
- cp /dev/null ark14isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 14 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-