home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-24 | 47.0 KB | 1,772 lines |
- Newsgroups: comp.sources.misc
- From: jfh@rpp386.Cactus.ORG (John F Haugh II)
- Subject: v26i064: shadow - Shadow Password Suite, Part11/11
- Message-ID: <1991Nov24.185332.20763@sparky.imd.sterling.com>
- X-Md4-Signature: fd04797535c13517f2938233ee8e6477
- Date: Sun, 24 Nov 1991 18:53:32 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jfh@rpp386.Cactus.ORG (John F Haugh II)
- Posting-number: Volume 26, Issue 64
- Archive-name: shadow/part11
- Environment: UNIX
- Supersedes: shadow-2: Volume 06, Issue 22-24
-
- #! /bin/sh
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: chfn.1 chsh.1 dialchk.c dialup.h dpasswd.8 encrypt.c
- # faillog.4 faillog.h fields.c groupadd.1 groupdel.1 groupmod.1
- # groups.1 grpack.c id.1 lastlog.h log.c logoutd.8 logoutd.c mail.c
- # mkrmdir.c motd.c newgrp.1 pwconv.8 pwunconv.8 spdbm.c sulog.c tz.c
- # userdel.1
- # Wrapped by kent@sparky on Sun Nov 24 11:03:44 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 11 (of 11)."'
- if test -f 'chfn.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'chfn.1'\"
- else
- echo shar: Extracting \"'chfn.1'\" \(1598 characters\)
- sed "s/^X//" >'chfn.1' <<'END_OF_FILE'
- 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.\" @(#)chfn.1 3.1 09:34:16 11/21/90
- X.\"
- X.TH CHFN 1
- X.SH NAME
- Xchfn \- change user name and information
- X.SH SYNOPSIS
- X\fBchfn\fR [ \fB-f \fIfull_name\fR ] [ \fB-r \fIroom_no\fR ]
- X.br
- X[ \fB-w \fIwork_ph\fR ] [ \fB-h \fIhome_ph\fR ] [ \fB-o \fIother\fR ]
- X[ \fIuser\fR ]
- X.SH DESCRIPTION
- X\fIchfn\f changes user fullname, office number, office extension, and home
- Xphone number information for a user's account.
- XThis information is typically printed by \fIfinger(1)\f and similiar
- Xprograms.
- XA normal user may only change the fields for their own account,
- Xthe super user may change the fields for any account.
- XAlso, only the super user may use the \fB-o\f option to change the
- Xundefined portions of the GCOS field.
- X.PP
- XThe only restrictions placed on the contents of the fields is that no
- Xcontrol characters may be present, nor any of comma, colon, or equal sign.
- XThe \fIother\f field does not have this restriction, and is used to
- Xstore accounting information used by other applications.
- X.PP
- XIf none of the options are selected, \fIchfn\f operates in an interactive
- Xfashion, prompting the user with the current values for all of the fields.
- XEnter the new value to change the field, or leave the line blank to use
- Xthe current value.
- XThe current value is displayed between a pair of \fB[ ]\f marks.
- XWithout options, chfn prompts for the current user account.
- X.SH Files
- X/etc/passwd \- user account information
- X.SH See Also
- Xpasswd(4)
- END_OF_FILE
- if test 1598 -ne `wc -c <'chfn.1'`; then
- echo shar: \"'chfn.1'\" unpacked with wrong size!
- fi
- # end of 'chfn.1'
- fi
- if test -f 'chsh.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'chsh.1'\"
- else
- echo shar: Extracting \"'chsh.1'\" \(1475 characters\)
- sed "s/^X//" >'chsh.1' <<'END_OF_FILE'
- 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.\" @(#)chsh.1 3.1 09:34:17 11/21/90
- X.\"
- X.TH CHSH 1
- X.SH NAME
- Xchsh \- change login shell
- X.SH SYNOPSIS
- X\fBchsh\fR [ \fB-s \fIlogin_shell\fR ] [ \fIuser\fR ]
- X.SH DESCRIPTION
- X\fIchsh\f changes the user login shell.
- XThis determines the name of the user's initial login command.
- XA normal user may only change the login shell for their own account,
- Xthe super user may change the login shell for any account.
- X.PP
- XThe only restrictions placed on the login shell is that the
- Xcommand name must be listed in \fB/etc/shells\fR, unless the
- Xinvoker is the super-user, and then any value may be added.
- XAn account with a restricted login shell may not change
- Xtheir login shell.
- XFor this reason, placing \fB/bin/rsh\fR in \fB/etc/shells\fR
- Xis discouraged since accidentally changing to a restricted
- Xshell would prevent the user from every changing their login
- Xshell back to its original value.
- X.PP
- XIf the \fB-s\fR option is not selected, \fIchsh\f operates in an interactive
- Xfashion, prompting the user with the current login shell.
- XEnter the new value to change the field, or leave the line blank to use
- Xthe current value.
- XThe current value is displayed between a pair of \fB[ ]\f marks.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/shells \- list of valid login shells
- X.SH See Also
- Xchfn(1),
- Xpasswd(4)
- END_OF_FILE
- if test 1475 -ne `wc -c <'chsh.1'`; then
- echo shar: \"'chsh.1'\" unpacked with wrong size!
- fi
- # end of 'chsh.1'
- fi
- if test -f 'dialchk.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dialchk.c'\"
- else
- echo shar: Extracting \"'dialchk.c'\" \(1427 characters\)
- sed "s/^X//" >'dialchk.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#ifdef BSD
- X#include <strings.h>
- X#else
- X#include <string.h>
- X#endif
- X#include "config.h"
- X#include "dialup.h"
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)dialchk.c 3.3 08:54:38 7/10/91";
- X#endif
- X
- Xextern char *pw_encrypt();
- X
- X/*
- X * Check for dialup password
- X *
- X * dialcheck tests to see if tty is listed as being a dialup
- X * line. If so, a dialup password may be required if the shell
- X * is listed as one which requires a second password.
- X */
- X
- Xint dialcheck (tty, shell)
- Xchar *tty;
- Xchar *shell;
- X{
- X char *crypt ();
- X char *getpass ();
- X struct dialup *dialup;
- X char *pass;
- X char *cp;
- X
- X setduent ();
- X
- X if (! isadialup (tty)) {
- X endduent ();
- X return (1);
- X }
- X if (! (dialup = getdushell (shell))) {
- X endduent ();
- X return (1);
- X }
- X endduent ();
- X
- X if (dialup->du_passwd[0] == '\0')
- X return (1);
- X
- X if (! (pass = getpass ("Dialup Password:")))
- X return (0);
- X
- X cp = pw_encrypt (pass, dialup->du_passwd);
- X#if defined(USG)
- X memset (pass, 0, strlen (pass));
- X#else
- X bzero (pass, strlen (pass));
- X#endif
- X return (strcmp (cp, dialup->du_passwd) == 0);
- X}
- END_OF_FILE
- if test 1427 -ne `wc -c <'dialchk.c'`; then
- echo shar: \"'dialchk.c'\" unpacked with wrong size!
- fi
- # end of 'dialchk.c'
- fi
- if test -f 'dialup.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dialup.h'\"
- else
- echo shar: Extracting \"'dialup.h'\" \(1581 characters\)
- sed "s/^X//" >'dialup.h' <<'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/*
- X * Structure of the /etc/d_passwd file
- X *
- X * The d_passwd file contains the names of login shells which require
- X * dialup passwords. Each line contains the fully qualified path name
- X * for the shell, followed by an optional password. Each field is
- X * separated by a ':'.
- X *
- X * Structure of the /etc/dialups file
- X *
- X * The dialups file contains the names of ports which may be dialup
- X * lines. Each line consists of the last component of the path
- X * name. The leading "/dev/" string is removed.
- X *
- X * @(#)dialup.h 3.2 09:06:55 5/28/91
- X */
- X
- X#ifndef _DIALUP_H
- X#define _DIALUP_H
- X
- Xstruct dialup {
- X char *du_shell;
- X char *du_passwd;
- X};
- X
- X#if !__STDC__
- Xextern void setduent ();
- Xextern void endduent ();
- Xextern struct dialup *fgetduent ();
- Xextern struct dialup *getduent ();
- Xextern struct dialup *getdushell ();
- Xextern int putduent ();
- Xextern int isadialup ();
- X#else
- Xextern void setduent (void);
- Xextern void endduent (void);
- Xextern struct dialup *fgetduent (FILE *);
- Xextern struct dialup *getduent (void);
- Xextern struct dialup *getdushell (char *);
- Xextern int putduent (struct dialup *, FILE *);
- Xextern int isadialup (char *);
- X#endif
- X
- X#define DIALPWD "/etc/d_passwd"
- X#define DIALUPS "/etc/dialups"
- X
- X#endif
- END_OF_FILE
- if test 1581 -ne `wc -c <'dialup.h'`; then
- echo shar: \"'dialup.h'\" unpacked with wrong size!
- fi
- # end of 'dialup.h'
- 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'\" \(997 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 8/4/91
- 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 997 -ne `wc -c <'dpasswd.8'`; then
- echo shar: \"'dpasswd.8'\" unpacked with wrong size!
- fi
- # end of 'dpasswd.8'
- fi
- if test -f 'encrypt.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'encrypt.c'\"
- else
- echo shar: Extracting \"'encrypt.c'\" \(1287 characters\)
- sed "s/^X//" >'encrypt.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1990, 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 <string.h>
- X#include "config.h"
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)encrypt.c 3.4 19:44:23 12/10/90";
- X#endif
- X
- Xextern char *crypt();
- X
- Xchar *
- Xpw_encrypt (clear, salt)
- Xchar *clear;
- Xchar *salt;
- X{
- X static char cipher[32];
- X static int count;
- X char newsalt[2];
- X char *cp;
- X long now;
- X
- X /*
- X * See if a new salt is needed and get a few random
- X * bits of information. The amount of randomness is
- X * probably not all that crucial since the salt only
- X * serves to thwart a dictionary attack.
- X */
- X
- X if (salt == (char *) 0) {
- X now = time ((long *) 0) + count++;
- X now ^= clock ();
- X now ^= getpid ();
- X now = ((now >> 12) ^ (now)) & 07777;
- X newsalt[0] = i64c ((now >> 6) & 077);
- X newsalt[1] = i64c (now & 077);
- X salt = newsalt;
- X }
- X cp = crypt (clear, salt);
- X strcpy (cipher, cp);
- X
- X#ifdef DOUBLESIZE
- X if (strlen (clear) > 8) {
- X cp = crypt (clear + 8, salt);
- X strcat (cipher, cp + 2);
- X }
- X#endif
- X return cipher;
- X}
- END_OF_FILE
- if test 1287 -ne `wc -c <'encrypt.c'`; then
- echo shar: \"'encrypt.c'\" unpacked with wrong size!
- fi
- # end of 'encrypt.c'
- 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'\" \(969 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 11/21/90
- 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 969 -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'\" \(715 characters\)
- sed "s/^X//" >'faillog.h' <<'END_OF_FILE'
- X/*
- 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
- X/*
- X * faillog.h - login failure logging file format
- X *
- X * @(#)faillog.h 2.2 19:23:46 7/29/90
- X *
- X * The login failure file is maintained by login(1) and fail(1L)
- X * Each record in the file represents a separate UID and the file
- X * is indexed in that fashion.
- X */
- X
- X#define FAILFILE "/usr/adm/faillog"
- 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 715 -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'\" \(1230 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 11/26/90";
- 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 1230 -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'\" \(1349 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 7/13/91
- 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 1349 -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'\" \(969 characters\)
- sed "s/^X//" >'groupdel.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.\" @(#)groupdel.1 3.1 13:28:12 7/13/91
- 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 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 969 -ne `wc -c <'groupdel.1'`; then
- echo shar: \"'groupdel.1'\" unpacked with wrong size!
- fi
- # end of 'groupdel.1'
- fi
- if test -f 'groupmod.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'groupmod.1'\"
- else
- echo shar: Extracting \"'groupmod.1'\" \(1383 characters\)
- sed "s/^X//" >'groupmod.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.\" @(#)groupmod.1 3.1 13:28:27 7/13/91
- X.\"
- X.TH GROUPMOD 1M
- X.SH NAME
- Xgroupmod \- Modify a group
- X.SH SYNOPSIS
- X.B groupmod
- X[ \fB-g\fI gid \fR[ \fB-o\fR ] ]
- X[ \fB-n\fI group_name \fR ]
- X.I group
- X.SH DESCRIPTION
- XThe \fIgroupmod\fR command modifies the system account files to reflect
- Xthe changes that are specified on the command line.
- XThe options which apply to the \fIgroupmod\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.
- XValues between 0 and 99 are typically reserved for system groups.
- XAny files which the old group ID is the file group ID
- Xmust have the file group ID changed manually.
- X.IP "\fB-n \fIgroup_name\fR"
- XThe name of the group will be changed from \fIgroup\fR to
- X\fIgroup_name\fR.
- 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), groupdel(1M)
- END_OF_FILE
- if test 1383 -ne `wc -c <'groupmod.1'`; then
- echo shar: \"'groupmod.1'\" unpacked with wrong size!
- fi
- # end of 'groupmod.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'\" \(1092 characters\)
- sed "s/^X//" >'groups.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.\" @(#)groups.1 3.1 08:50:54 11/3/91
- X.\"
- X.TH ID 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 to change their current real and effective
- Xgroup 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 1092 -ne `wc -c <'groups.1'`; then
- echo shar: \"'groups.1'\" unpacked with wrong size!
- fi
- # end of 'groups.1'
- fi
- if test -f 'grpack.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'grpack.c'\"
- else
- echo shar: Extracting \"'grpack.c'\" \(1511 characters\)
- sed "s/^X//" >'grpack.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 * Duplication is permitted for non-commercial [ profit making ]
- X * purposes provided this and other copyright notices remain
- X * intact.
- X */
- X
- X#include <stdio.h>
- X#include <grp.h>
- X#ifdef BSD
- X#include <strings.h>
- X#else
- X#include <string.h>
- X#endif
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)grpack.c 3.3 08:45:46 9/12/91";
- X#endif
- X
- Xint gr_pack (group, buf)
- Xstruct group *group;
- Xchar *buf;
- X{
- X char *cp;
- X int i;
- X
- X cp = buf;
- X strcpy (cp, group->gr_name);
- X cp += strlen (cp) + 1;
- X
- X strcpy (cp, group->gr_passwd);
- X cp += strlen (cp) + 1;
- X
- X memcpy (cp, (char *) &group->gr_gid, sizeof group->gr_gid);
- X cp += sizeof group->gr_gid;
- X
- X for (i = 0;group->gr_mem[i];i++) {
- X strcpy (cp, group->gr_mem[i]);
- X cp += strlen (cp) + 1;
- X }
- X *cp++ = '\0';
- X
- X return cp - buf;
- X}
- X
- Xint gr_unpack (buf, len, group)
- Xchar *buf;
- Xint len;
- Xstruct group *group;
- X{
- X char *org = buf;
- X int i;
- X
- X group->gr_name = buf;
- X buf += strlen (buf) + 1;
- X if (buf - org > len)
- X return -1;
- X
- X group->gr_passwd = buf;
- X buf += strlen (buf) + 1;
- X if (buf - org > len)
- X return -1;
- X
- X memcpy ((char *) &group->gr_gid, (char *) buf, sizeof group->gr_gid);
- X buf += sizeof group->gr_gid;
- X if (buf - org > len)
- X return -1;
- X
- X for (i = 0;*buf && i < 1024;i++) {
- X group->gr_mem[i] = buf;
- X buf += strlen (buf) + 1;
- X
- X if (buf - org > len)
- X return -1;
- X }
- X group->gr_mem[i] = (char *) 0;
- X return 0;
- X}
- END_OF_FILE
- if test 1511 -ne `wc -c <'grpack.c'`; then
- echo shar: \"'grpack.c'\" unpacked with wrong size!
- fi
- # end of 'grpack.c'
- 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'\" \(998 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 8/1/91
- 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 998 -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'\" \(511 characters\)
- sed "s/^X//" >'lastlog.h' <<'END_OF_FILE'
- X/*
- 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
- X/*
- X * lastlog.h - structure of lastlog file
- X *
- X * @(#)lastlog.h 2.3 19:23:49 7/29/90
- 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};
- END_OF_FILE
- if test 511 -ne `wc -c <'lastlog.h'`; then
- echo shar: \"'lastlog.h'\" unpacked with wrong size!
- fi
- # end of 'lastlog.h'
- fi
- if test -f 'log.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'log.c'\"
- else
- echo shar: Extracting \"'log.c'\" \(1526 characters\)
- sed "s/^X//" >'log.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 <sys/types.h>
- X#include <utmp.h>
- X#include "pwd.h"
- X#include <fcntl.h>
- X#include <time.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[] = "@(#)log.c 3.2 07:43:10 9/17/91";
- X#endif
- X
- X#include "lastlog.h"
- X
- Xextern struct utmp utent;
- Xextern struct passwd pwent;
- Xextern struct lastlog lastlog;
- Xextern char **environ;
- X
- Xlong lseek ();
- Xtime_t time ();
- X
- Xvoid log ()
- X{
- X int fd;
- X off_t offset;
- X struct lastlog newlog;
- X
- X if ((fd = open ("/usr/adm/lastlog", O_RDWR)) == -1)
- X return;
- X
- X offset = pwent.pw_uid * sizeof lastlog;
- X
- X if (lseek (fd, offset, 0) != offset) {
- X (void) close (fd);
- X return;
- X }
- X if (read (fd, (char *) &lastlog, sizeof lastlog) != sizeof lastlog)
- X#ifndef BSD
- X memset ((char *) &lastlog, sizeof lastlog, 0);
- X#else
- X bzero ((char *) &lastlog, sizeof lastlog);
- X#endif
- X newlog = lastlog;
- X
- X (void) time (&newlog.ll_time);
- X (void) strncpy (newlog.ll_line, utent.ut_line, sizeof newlog.ll_line);
- X (void) lseek (fd, offset, 0);
- X (void) write (fd, (char *) &newlog, sizeof newlog);
- X (void) close (fd);
- X}
- X
- END_OF_FILE
- if test 1526 -ne `wc -c <'log.c'`; then
- echo shar: \"'log.c'\" unpacked with wrong size!
- fi
- # end of 'log.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'\" \(999 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 9/22/91
- 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 999 -ne `wc -c <'logoutd.8'`; then
- echo shar: \"'logoutd.8'\" unpacked with wrong size!
- fi
- # end of 'logoutd.8'
- fi
- if test -f 'logoutd.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'logoutd.c'\"
- else
- echo shar: Extracting \"'logoutd.c'\" \(1118 characters\)
- sed "s/^X//" >'logoutd.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1991, John F. Haugh II
- X * An unpublished work.
- 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[] = "@(#)logoutd.c 3.1 16:31:39 9/22/91";
- X#endif
- X
- X#include <sys/types.h>
- X#include <stdio.h>
- X#include <signal.h>
- X#include <utmp.h>
- X
- Xmain ()
- X{
- X int i;
- X struct utmp utmp;
- X int fd;
- X
- X for (i = 0;close (i) == 0;i++)
- X ;
- X
- X#ifdef NDEBUG
- X setpgrp ();
- X signal (SIGHUP, SIG_IGN);
- X
- X if (fork () > 0)
- X exit (0);
- X#endif
- X while (1) {
- X#ifdef NDEBUG
- X sleep (60);
- X#endif
- X if ((fd = open ("/etc/utmp", 0)) == -1)
- X continue;
- X
- X while (read (fd, &utmp, sizeof utmp) == sizeof utmp) {
- X if (utmp.ut_type != USER_PROCESS)
- X continue;
- X
- X if (isttytime (utmp.ut_user, utmp.ut_line, time (0)))
- X continue;
- X
- X kill (- utmp.ut_pid, SIGHUP);
- X sleep (10);
- X kill (- utmp.ut_pid, SIGKILL);
- X }
- X close (fd);
- X }
- X}
- END_OF_FILE
- if test 1118 -ne `wc -c <'logoutd.c'`; then
- echo shar: \"'logoutd.c'\" unpacked with wrong size!
- fi
- # end of 'logoutd.c'
- fi
- if test -f 'mail.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mail.c'\"
- else
- echo shar: Extracting \"'mail.c'\" \(1054 characters\)
- sed "s/^X//" >'mail.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 <sys/types.h>
- X#include <sys/stat.h>
- X
- 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
- X#include "config.h"
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)mail.c 3.3 07:43:42 9/17/91";
- X#endif
- X
- Xextern char *getenv();
- Xextern int getdef_bool();
- X
- Xvoid mailcheck ()
- X{
- X struct stat statbuf;
- X char *mailbox;
- X
- X if (! getdef_bool("MAIL_CHECK_ENAB"))
- X return;
- X if (! (mailbox = getenv ("MAIL")))
- X return;
- X
- X if (stat (mailbox, &statbuf) == -1 || statbuf.st_size == 0)
- X puts ("No mail.");
- X else if (statbuf.st_atime > statbuf.st_mtime)
- X puts ("You have mail.");
- X else
- X puts ("You have new mail.");
- X}
- END_OF_FILE
- if test 1054 -ne `wc -c <'mail.c'`; then
- echo shar: \"'mail.c'\" unpacked with wrong size!
- fi
- # end of 'mail.c'
- 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'\" \(1334 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 9/17/91";
- 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 1334 -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'\" \(1075 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 9/17/91";
- 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 1075 -ne `wc -c <'motd.c'`; then
- echo shar: \"'motd.c'\" unpacked with wrong size!
- fi
- # end of 'motd.c'
- fi
- if test -f 'newgrp.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'newgrp.1'\"
- else
- echo shar: Extracting \"'newgrp.1'\" \(1469 characters\)
- sed "s/^X//" >'newgrp.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.\" @(#)newgrp.1 3.1 07:47:52 7/13/91
- X.\"
- X.TH NEWGRP 1
- X.SH NAME
- Xnewgrp \- Change group ID
- X.SH SYNOPSIS
- X.B newgrp
- X[ - ] [ \fIgroup\fR ]
- X.SH DESCRIPTION
- X.I newgrp
- Xis used to change the current group ID during a login session.
- XIf the optional \fB\-\fR flag is given, the user's environment
- Xwill be reinitialized as though the user had logged in, otherwise
- Xthe current environment, including current working directory,
- Xremains unchanged.
- X.PP
- X.I newgrp
- Xchanges the current real group ID to the named group, or to
- Xthe default group listed in \fB/etc/passwd\fR if no group name
- Xis given.
- XThe user will be prompted for a password if they do not have a
- Xpassword and the group does, or if the user is not listed as a
- Xmember and the group has a password.
- XThe user will be denied access if the group password is empty
- Xand the user is not listed as a member.
- X.SH CAVEATS
- X.PP
- XThis version of \fInewgrp\fR has many compilation options,
- Xonly some of which may be in use at any particular site.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/group \- group information
- X.SH See Also
- Xlogin(1),
- Xid(1),
- Xsu(1)
- END_OF_FILE
- if test 1469 -ne `wc -c <'newgrp.1'`; then
- echo shar: \"'newgrp.1'\" unpacked with wrong size!
- fi
- # end of 'newgrp.1'
- fi
- if test -f 'pwconv.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'pwconv.8'\"
- else
- echo shar: Extracting \"'pwconv.8'\" \(1396 characters\)
- sed "s/^X//" >'pwconv.8' <<'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.\" @(#)pwconv.8 3.1 23:51:34 11/11/90
- X.\"
- X.TH PWCONV 8
- X.SH NAME
- Xpwconv \- convert and update shadow password files
- X.SH SYNOPSIS
- X/etc/pwconv
- X.SH DESCRIPTION
- X\fIPwconv\fR copies the old password file information to a new shadow
- Xpassword file,
- Xmerging entries from an optional existing shadow file.
- XThe new password file is left in \fBnpasswd\fR,
- Xthe new shadow file is left in \fBnshadow\fR.
- XBoth of these are files are created with modes which only permit
- Xread access to the owner.
- XExisting shadow entries are copied as is.
- XShadow entries in the old format will be silently converted to the
- Xnew format on output.
- XAny entries which are missing fields will have those fields
- Xfilled in with default values where appropriate.
- XNew entries are created with passwords which expire in 10000 days,
- Xwith a last changed date of today,
- Xunless password aging information was already present.
- XEntries with blank passwords are not copied to the shadow file at all.
- 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.br
- X./nshadow \- new shadow password file
- X.SH See Also
- Xpasswd(1),
- Xpasswd(4),
- Xshadow(4),
- Xpwunconv(8)
- END_OF_FILE
- if test 1396 -ne `wc -c <'pwconv.8'`; then
- echo shar: \"'pwconv.8'\" unpacked with wrong size!
- fi
- # end of 'pwconv.8'
- 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'\" \(926 characters\)
- sed "s/^X//" >'pwunconv.8' <<'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.\" @(#)pwunconv.8 3.1 09:34:27 11/21/90
- X.\"
- X.TH PWUNCONV 8
- X.SH NAME
- Xpwunconv \- restore old password file from shadow password file
- X.SH SYNOPSIS
- X/etc/pwunconv
- 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.
- 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 926 -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'\" \(1231 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 9/12/91";
- 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 1231 -ne `wc -c <'spdbm.c'`; then
- echo shar: \"'spdbm.c'\" unpacked with wrong size!
- fi
- # end of 'spdbm.c'
- fi
- if test -f 'sulog.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sulog.c'\"
- else
- echo shar: Extracting \"'sulog.c'\" \(1450 characters\)
- sed "s/^X//" >'sulog.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 <sys/types.h>
- X#include <stdio.h>
- X#include <time.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[] = "@(#)sulog.c 3.2 07:43:31 9/17/91";
- X#endif
- X
- Xextern char name[];
- Xextern char oldname[];
- X
- Xtime_t time ();
- Xextern char *getdef_str();
- X
- Xvoid sulog (success)
- Xint success;
- X{
- X char *sulog;
- X char *tty;
- X char *cp;
- X char *ttyname ();
- X time_t clock;
- X struct tm *tm;
- X struct tm *localtime ();
- X FILE *fp;
- X
- X if ( (sulog=getdef_str("SULOG_FILE")) == (char *) 0 )
- X return;
- X
- X if ((fp = fopen (sulog, "a+")) == (FILE *) 0)
- X return; /* can't open or create logfile */
- X
- X (void) time (&clock);
- X tm = localtime (&clock);
- X
- X if (isatty (0) && (cp = ttyname (0))) {
- X if (tty = strrchr (cp, '/'))
- X tty++;
- X else
- X tty = cp;
- X } else
- X tty = "???";
- X
- X (void) fprintf (fp, "SU %.02d/%0.2d %.02d:%.02d %c %.6s %s-%s\n",
- X tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min,
- X success ? '+':'-', tty, oldname, name);
- X
- X fflush (fp);
- X fclose (fp);
- X}
- END_OF_FILE
- if test 1450 -ne `wc -c <'sulog.c'`; then
- echo shar: \"'sulog.c'\" unpacked with wrong size!
- fi
- # end of 'sulog.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'\" \(927 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 9/17/91";
- 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 927 -ne `wc -c <'tz.c'`; then
- echo shar: \"'tz.c'\" unpacked with wrong size!
- fi
- # end of 'tz.c'
- fi
- if test -f 'userdel.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'userdel.1'\"
- else
- echo shar: Extracting \"'userdel.1'\" \(1122 characters\)
- sed "s/^X//" >'userdel.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.\" @(#)userdel.1 3.1 07:46:18 7/13/91
- X.\"
- X.TH USERDEL 1M
- X.SH NAME
- Xuserdel \- Delete a user account and related files
- X.SH SYNOPSIS
- X.B userdel
- X[ \fB-r\fI ]
- X.I login
- X.SH DESCRIPTION
- XThe \fIuserdel\fR command modifies the system account files, deleting
- Xall entries that refer to \fIlogin\fR.
- XThe named user must exist.
- X.IP \fB-r\fR
- XFiles in the user's home directory will be removed along with the
- Xhome directory itself.
- XFiles located in other file system will have to be searched for
- Xand deleted manually.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/shadow \- secure user account information
- X.br
- X/etc/group \- group information
- X.SH SEE ALSO
- X\fBchfn(1), chsh(1), groupadd(1M), groupdel(1M), groupmod(1M),
- Xpasswd(1), useradd(1M), usermod(1M)
- END_OF_FILE
- if test 1122 -ne `wc -c <'userdel.1'`; then
- echo shar: \"'userdel.1'\" unpacked with wrong size!
- fi
- # end of 'userdel.1'
- fi
- echo shar: End of archive 11 \(of 11\).
- cp /dev/null ark11isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 11 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...
-