home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-14 | 59.7 KB | 2,183 lines |
- Newsgroups: comp.sources.misc
- From: jfh@rpp386.cactus.org (John F. Haugh II)
- Subject: v38i132: shadow - Shadow Password Suite, v3.3, Part13/14
- Message-ID: <1993Aug14.192658.9980@sparky.sterling.com>
- X-Md4-Signature: a2d7f04b5241a7fce5b7190a57837407
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Sat, 14 Aug 1993 19:26:58 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: jfh@rpp386.cactus.org (John F. Haugh II)
- Posting-number: Volume 38, Issue 132
- Archive-name: shadow/part13
- 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: chfn.1 chsh.1 console.c dialchk.c dialup.h entry.c env.c
- # grpack.c hushed.c lastlog.8 mkpasswd.8 newgrp.1 newusers.8 port.h
- # porttime.4 pwauth.8 pwconv.8 rad64.c scologin.c shadow.4 shadow.h
- # su.1 sub.c sulog.c sulogin.8 ttytype.c userdel.1
- # 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 13 (of 14)."'
- if test -f 'chfn.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'chfn.1'\"
- else
- echo shar: Extracting \"'chfn.1'\" \(1601 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 21 Nov 1990
- 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 1601 -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'\" \(1478 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 21 Nov 1990
- 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 1478 -ne `wc -c <'chsh.1'`; then
- echo shar: \"'chsh.1'\" unpacked with wrong size!
- fi
- # end of 'chsh.1'
- fi
- if test -f 'console.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'console.c'\"
- else
- echo shar: Extracting \"'console.c'\" \(2029 characters\)
- sed "s/^X//" >'console.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[] = "@(#)console.c 3.1 07:47:49 17 Sep 1991";
- X#endif
- X
- X#include <stdio.h>
- X#ifndef BSD
- X# include <string.h>
- X#else
- X# include <strings.h>
- X#endif
- X
- Xextern char *getdef_str();
- X
- X/*
- X * tty - return 1 if the "tty" is a console device, else 0.
- X *
- X * Note - we need to take extreme care here to avoid locking out root logins
- X * if something goes awry. That's why we do things like call everything a
- X * console if the consoles file can't be opened. Because of this, we must
- X * warn the user to protect against the remove of the consoles file since
- X * that would allow an unauthorized root login.
- X */
- X
- Xint
- Xconsole (tty)
- Xchar *tty;
- X{
- X FILE *fp;
- X char buf[BUFSIZ], *console, *s;
- X
- X /*
- X * If the CONSOLE configuration definition isn't given, call
- X * everything a valid console.
- X */
- X
- X if ((console = getdef_str("CONSOLE")) == NULL)
- X return 1;
- X
- X /*
- X * If this isn't a filename, then it is a ":" delimited list of
- X * console devices upon which root logins are allowed.
- X */
- X
- X if (*console != '/') {
- X console = strcpy(buf,console);
- X while ((s = strtok(console,":")) != NULL) {
- X if (strcmp(s,tty) == 0)
- X return 1;
- X
- X console = NULL;
- X }
- X return 0;
- X }
- X
- X /*
- X * If we can't open the console list, then call everything a
- X * console - otherwise root will never be allowed to login.
- X */
- X
- X if ((fp = fopen(console,"r")) == NULL)
- X return 1;
- X
- X /*
- X * See if this tty is listed in the console file.
- X */
- X
- X while (fgets(buf,sizeof(buf),fp) != NULL) {
- X buf[strlen(buf)-1] = '\0';
- X if (strcmp(buf,tty) == 0) {
- X (void) fclose(fp);
- X return 1;
- X }
- X }
- X
- X /*
- X * This tty isn't a console.
- X */
- X
- X (void) fclose(fp);
- X return 0;
- X}
- END_OF_FILE
- if test 2029 -ne `wc -c <'console.c'`; then
- echo shar: \"'console.c'\" unpacked with wrong size!
- fi
- # end of 'console.c'
- 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'\" \(1431 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 10 Jul 1991";
- 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 1431 -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'\" \(1585 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 28 May 1991
- 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 1585 -ne `wc -c <'dialup.h'`; then
- echo shar: \"'dialup.h'\" unpacked with wrong size!
- fi
- # end of 'dialup.h'
- fi
- if test -f 'entry.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'entry.c'\"
- else
- echo shar: Extracting \"'entry.c'\" \(1998 characters\)
- sed "s/^X//" >'entry.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 "config.h"
- X#include "pwd.h"
- X#ifndef BSD
- X#include <string.h>
- X#else
- X#include <strings.h>
- X#define strchr index
- X#define strrchr rindex
- X#endif
- X#ifdef SHADOWPWD
- X#include "shadow.h"
- X#endif
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)entry.c 3.5 11:59:41 28 Dec 1991";
- X#endif
- X
- Xstruct passwd *fgetpwent ();
- Xchar *malloc ();
- X
- Xvoid entry (name, pwent)
- Xchar *name;
- Xstruct passwd *pwent;
- X{
- X struct passwd *passwd;
- X#ifdef SHADOWPWD
- X struct spwd *spwd;
- X char *l64a ();
- X#endif
- X char *cp;
- X char *malloc();
- X
- X if (! (passwd = getpwnam (name))) {
- X pwent->pw_name = (char *) 0;
- X return;
- X } else {
- X pwent->pw_name = strdup (passwd->pw_name);
- X pwent->pw_uid = passwd->pw_uid;
- X pwent->pw_gid = passwd->pw_gid;
- X#ifdef ATT_COMMENT
- X pwent->pw_comment = strdup (passwd->pw_comment);
- X#endif
- X pwent->pw_gecos = strdup (passwd->pw_gecos);
- X pwent->pw_dir = strdup (passwd->pw_dir);
- X pwent->pw_shell = strdup (passwd->pw_shell);
- X#if defined(SHADOWPWD) && !defined(AUTOSHADOW)
- X setspent ();
- X if (spwd = getspnam (name)) {
- X pwent->pw_passwd = strdup (spwd->sp_pwdp);
- X#ifdef ATT_AGE
- X pwent->pw_age = (char *) malloc (5);
- X
- X if (spwd->sp_max > (63*7))
- X spwd->sp_max = (63*7);
- X if (spwd->sp_min > (63*7))
- X spwd->sp_min = (63*7);
- X
- X pwent->pw_age[0] = i64c (spwd->sp_max / 7);
- X pwent->pw_age[1] = i64c (spwd->sp_min / 7);
- X
- X cp = l64a (spwd->sp_lstchg / 7);
- X pwent->pw_age[2] = cp[0];
- X pwent->pw_age[3] = cp[1];
- X
- X pwent->pw_age[4] = '\0';
- X#endif
- X endspent ();
- X return;
- X }
- X endspent ();
- X#endif
- X pwent->pw_passwd = strdup (passwd->pw_passwd);
- X#ifdef ATT_AGE
- X pwent->pw_age = strdup (passwd->pw_age);
- X#endif
- X }
- X}
- END_OF_FILE
- if test 1998 -ne `wc -c <'entry.c'`; then
- echo shar: \"'entry.c'\" unpacked with wrong size!
- fi
- # end of 'entry.c'
- fi
- if test -f 'env.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'env.c'\"
- else
- echo shar: Extracting \"'env.c'\" \(2207 characters\)
- sed "s/^X//" >'env.c' <<'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 * This software is provided on an AS-IS basis and the author makes
- X * no warrantee of any kind.
- X */
- X
- X#include <stdio.h>
- X#ifndef BSD
- X#include <string.h>
- X#else
- X#define strchr index
- X#define strrchr rindex
- X#include <strings.h>
- X#endif
- X
- X#ifndef lint
- Xstatic char _sccsid[] = "@(#)env.c 3.1 13:00:03 27 Jul 1992";
- X#endif
- X
- Xextern char **environ;
- Xextern char *newenvp[];
- Xextern int newenvc;
- Xextern int maxenv;
- X
- Xchar *strdup ();
- Xvoid free ();
- X
- Xstatic char *forbid[] = {
- X "HOME",
- X "IFS",
- X "PATH",
- X "SHELL",
- X (char *) 0
- X};
- X
- X/*
- X * addenv - add a new environmental entry
- X */
- X
- Xvoid
- Xaddenv (entry)
- Xchar *entry;
- X{
- X char *cp;
- X int i;
- X int len;
- X
- X if (cp = strchr (entry, '='))
- X len = cp - entry;
- X else
- X return;
- X
- X for (i = 0;i < newenvc;i++)
- X if (strncmp (entry, newenvp[i], len) == 0 &&
- X (newenvp[i][len] == '=' || newenvp[i][len] == '\0'))
- X break;
- X
- X if (i == maxenv) {
- X puts ("Environment overflow");
- X return;
- X }
- X if (i == newenvc) {
- X newenvp[newenvc++] = strdup (entry);
- X } else {
- X free (newenvp[i]);
- X newenvp[i] = strdup (entry);
- X }
- X}
- X
- X/*
- X * setenv - copy command line arguments into the environment
- X */
- X
- Xvoid
- Xsetenv (argc, argv)
- Xint argc;
- Xchar **argv;
- X{
- X int i;
- X int n;
- X int noname = 1;
- X char variable[BUFSIZ];
- X char *cp;
- X
- X for (i = 0;i < argc;i++) {
- X if ((n = strlen (argv[i])) >= BUFSIZ)
- X continue; /* ignore long entries */
- X
- X if (! (cp = strchr (argv[i], '='))) {
- X (void) strcpy (variable, argv[i]);
- X } else {
- X (void) strncpy (variable, argv[i], cp - argv[i]);
- X variable[cp - argv[i]] = '\0';
- X }
- X for (n = 0;forbid[n] != (char *) 0;n++)
- X if (strcmp (variable, forbid[n]) == 0)
- X break;
- X
- X if (forbid[n] != (char *) 0) {
- X printf ("You may not change $%s\n", forbid[n]);
- X continue;
- X }
- X if (cp) {
- X addenv (argv[i]);
- X } else {
- X sprintf (variable, "L%d=%s", noname++, argv[i]);
- X addenv (variable);
- X }
- X }
- X}
- END_OF_FILE
- if test 2207 -ne `wc -c <'env.c'`; then
- echo shar: \"'env.c'\" unpacked with wrong size!
- fi
- # end of 'env.c'
- 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'\" \(1515 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 12 Sep 1991";
- 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 1515 -ne `wc -c <'grpack.c'`; then
- echo shar: \"'grpack.c'\" unpacked with wrong size!
- fi
- # end of 'grpack.c'
- fi
- if test -f 'hushed.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'hushed.c'\"
- else
- echo shar: Extracting \"'hushed.c'\" \(1811 characters\)
- sed "s/^X//" >'hushed.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1991, 1993, 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 * 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[] = "@(#)hushed.c 3.2 22:02:26 02 Jun 1993";
- X#endif
- X
- X#include <sys/types.h>
- X#include <stdio.h>
- X#ifndef BSD
- X# include <string.h>
- X#else
- X# include <strings.h>
- X#endif
- X#include "config.h"
- X#include "pwd.h"
- X
- Xextern char *getdef_str();
- X
- X/*
- X * hushed - determine if a user receives login messages
- X *
- X * Look in the hushed-logins file (or user's home directory) to see
- X * if the user is to receive the login-time messages.
- X */
- X
- Xint
- Xhushed(pw)
- Xstruct passwd *pw;
- X{
- X char *hushfile;
- X char buf[BUFSIZ];
- X int found;
- X FILE *fp;
- X
- X /*
- X * Get the name of the file to use. If this option is not
- X * defined, default to a noisy login.
- X */
- X
- X if ( (hushfile=getdef_str("HUSHLOGIN_FILE")) == NULL )
- X return 0;
- X
- X /*
- X * If this is not a fully rooted path then see if the
- X * file exists in the user's home directory.
- X */
- X
- X if (hushfile[0] != '/') {
- X strcat(strcat(strcpy(buf, pw->pw_dir), "/"), hushfile);
- X return (access(buf, 0) == 0);
- X }
- X
- X /*
- X * If this is a fully rooted path then go through the file
- X * and see if this user is in there.
- X */
- X
- X if ((fp = fopen(hushfile, "r")) == NULL)
- X return 0;
- X
- X for (found = 0;! found && fgets (buf, sizeof buf, fp);) {
- X buf[strlen (buf) - 1] = '\0';
- X found = ! strcmp (buf,
- X buf[0] == '/' ? pw->pw_shell:pw->pw_name);
- X }
- X (void) fclose(fp);
- X return found;
- X}
- END_OF_FILE
- if test 1811 -ne `wc -c <'hushed.c'`; then
- echo shar: \"'hushed.c'\" unpacked with wrong size!
- fi
- # end of 'hushed.c'
- fi
- if test -f 'lastlog.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'lastlog.8'\"
- else
- echo shar: Extracting \"'lastlog.8'\" \(1459 characters\)
- sed "s/^X//" >'lastlog.8' <<'END_OF_FILE'
- X.\" Copyright 1992, Phillip Street and 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.\" @(#)lastlog.8 3.2 10:35:49 18 Jul 1993 (National Guard Release)
- X.\"
- X.TH LASTLOG 8
- X.SH NAME
- Xlastlog \- examine lastlog file
- X.SH SYNOPSIS
- X/etc/lastlog [ -u uid ] [ -t days ]
- X.SH DESCRIPTION
- X\fIlastlog\fR formats and prints the contents of the last login log,
- X\fI/usr/adm/lastlog\fR. The \fBlogin-name\fR, \fBport\fR, and \fBlast login
- Xtime\fR will be printed.
- XThe default (no flags) causes lastlog entries to be printed in UID
- Xorder.
- XEntering \fB-u login-name\fR flag will
- Xcause the lastlog record for \fBlogin-name\fR only to be printed.
- XEntering \fB-t days\fR will cause only the
- Xlastlogins more recent than \fBdays\fR to be printed.
- XThe \fB-t\fR flag overrides the use of \fB-u\fR.
- X.PP
- XIf the user has never logged in the message \fB"**Never logged in**"\fR will
- Xbe displayed instead of the port and time.
- X.SH Files
- X/usr/adm/lastlog \- lastlog logging file
- X.SH Caveats
- XLarge gaps in uid numbers will cause the lastlog program to run longer with
- Xno output to the screen (i.e. if mmdf=800 and last uid=170, program will
- Xappear to hang as it processes uid 171-799).
- END_OF_FILE
- if test 1459 -ne `wc -c <'lastlog.8'`; then
- echo shar: \"'lastlog.8'\" unpacked with wrong size!
- fi
- # end of 'lastlog.8'
- fi
- if test -f 'mkpasswd.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mkpasswd.8'\"
- else
- echo shar: Extracting \"'mkpasswd.8'\" \(2129 characters\)
- sed "s/^X//" >'mkpasswd.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.\" @(#)mkpasswd.8 3.1 07:49:05 13 Jul 1991
- X.\"
- X.TH MKPASSWD 1
- X.SH NAME
- Xmkpasswd \- Update passwd and group database files
- X.SH SYNOPSIS
- X\fBmkpasswd\fR [ \fB-fvgps\fR ] \fIfile\fR
- X.SH DESCRIPTION
- X.I mkpasswd
- Xreads the file in the format given by the flags and converts it to the
- Xcorresponding database file format.
- XThese database files are used to improve access performance on systems
- Xwith large numbers of users.
- XThe output files will be named \fIfile\fR.dir and \fIfile\fR.pag.
- X.PP
- XThe \fB-f\fR option causes \fImkpasswd\fR to ignore any existing output
- Xfiles and overwrite them.
- XNormally \fImkpasswd\fR complains about existing output files and quits.
- X.PP
- XThe \fB-v\fR option causes \fImkpasswd\fR to output information about
- Xeach record as it is converted, with a final message at the very end.
- X.PP
- XThe \fB-g\fR option treats the input file as though it were in
- X\fB/etc/group\fR file format.
- XWhen combined with the \fB-s\fR option, the \fB/etc/gshadow\fR file
- Xformat is used instead.
- X.PP
- XThe \fB-p\fR option treats the input file as though it were in
- X\fB/etc/passwd\fR file format.
- XThis is the default.
- XWhen combined with the \fB-s\fR option, the \fB/etc/shadow\fR file
- Xformat is used instead.
- X.SH CAVEATS
- XThe use of more than one database file is limited to systems which
- Xinclude the NDBM database library and therefore may not be available
- Xon every system.
- X.SH Note
- XSince most commands are capable of updating the database files as
- Xchanges are made, this command need only be used when re-creating a
- Xdeleted or corrupted database file.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/shadow \- shadow user information
- X.br
- X/etc/group \- group information
- X.br
- X/etc/gshadow \- shadow group information
- X.SH See Also
- Xpasswd(4), group(4), shadow(4)
- END_OF_FILE
- if test 2129 -ne `wc -c <'mkpasswd.8'`; then
- echo shar: \"'mkpasswd.8'\" unpacked with wrong size!
- fi
- # end of 'mkpasswd.8'
- 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'\" \(1867 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.2 14:52:37 28 Apr 1992
- X.\"
- X.TH NEWGRP 1
- X.SH NAME
- Xnewgrp \- Change group ID
- X.br
- Xsg \- Execute command as different group ID
- X.SH SYNOPSIS
- X.B newgrp
- X[ - ] [ \fIgroup\fR ]
- X.br
- X.B sg
- X[ - ] [ \fIgroup\fR [ \fB-c\fR \fIcommand\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.PP
- XThe
- X.I sg
- Xcommand works similiar to \fInewgrp\fR but does not replace the
- Xuser's shell, so upon exit from a \fIsg\fR command, you are
- Xreturned to your previous group ID.
- X.I sg
- Xalso accepts a command.
- XThe command will be executed with the Bourne shell and must be
- Xenclosed in quotes.
- 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 1867 -ne `wc -c <'newgrp.1'`; then
- echo shar: \"'newgrp.1'\" unpacked with wrong size!
- fi
- # end of 'newgrp.1'
- fi
- if test -f 'newusers.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'newusers.8'\"
- else
- echo shar: Extracting \"'newusers.8'\" \(1810 characters\)
- sed "s/^X//" >'newusers.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.\" @(#)newusers.8 3.1 16:49:47 04 Aug 1991
- X.\"
- X.TH NEWUSERS 8
- X.SH NAME
- X\fBnewusers\fR - update and create new users in batch
- X.SH SYNOPSIS
- X\fBnewusers\fR
- X[ \fI new_users \fR ]
- X.SH DESCRIPTION
- X\fBnewusers\fR reads a file of user name and cleartext password pairs
- Xand uses this information to update a group of existing users or to
- Xcreate new users.
- XEach line is in the same format as the standard password file (see
- X\fIpasswd(4)\fR) with the following exceptions.
- X.IP "pw_passwd"
- XThis field will be encrypted and used as the new value
- Xof the encrpted password.
- X.IP "pw_age"
- XThis field will be ignored for shadow passwords if the user already
- Xexists.
- X.IP "pw_gid"
- XThis field may be the name of an existing group, in which case the
- Xnamed user will be added as a member. If a non-existent numerical
- Xgroup is given, a new group will be created having this number.
- X.IP "pw_dir"
- XThis field will be checked for existence as a directory and a new
- Xdirectory will the same name created if it does not already exist.
- XThe ownership of the directory will be set to be that of the user
- Xbeing created or updated.
- X.PP
- XThis command is intended to be used in a large system environment where
- Xmany accounts are updated 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.
- X.SH SEE ALSO
- Xmkpasswd(8), passwd(1), useradd(1)
- END_OF_FILE
- if test 1810 -ne `wc -c <'newusers.8'`; then
- echo shar: \"'newusers.8'\" unpacked with wrong size!
- fi
- # end of 'newusers.8'
- fi
- if test -f 'port.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'port.h'\"
- else
- echo shar: Extracting \"'port.h'\" \(1748 characters\)
- sed "s/^X//" >'port.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 * port.h - structure of /etc/porttime
- X *
- X * @(#)port.h 3.1 08:59:36 08 Feb 1991
- X *
- X * Each entry in /etc/porttime consists of a TTY device
- X * name or "*" to indicate all TTY devices, followed by
- X * a list of 1 or more user IDs or "*" to indicate all
- X * user names, followed by a list of zero or more valid
- X * login times. Login time entries consist of zero or
- X * more day names (Su, Mo, Tu, We, Th, Fr, Sa, Wk, Al)
- X * followed by a pair of time values in HHMM format
- X * separated by a "-".
- X */
- X
- X/*
- X * PORTS - Name of system port access time file.
- X * PORT_IDS - Allowable number of IDs per entry.
- X * PORT_TTY - Allowable number of TTYs per entry.
- X * PORT_TIMES - Allowable number of time entries per entry.
- X * PORT_DAY - Day of the week to a bit value (0 = Sunday).
- X */
- X
- X#define PORTS "/etc/porttime"
- X#define PORT_IDS 64
- X#define PORT_TTY 64
- X#define PORT_TIMES 24
- X#define PORT_DAY(day) (1<<(day))
- X
- X/*
- X * pt_names - pointer to array of device names in /dev/
- X * pt_users - pointer to array of applicable user IDs.
- X * pt_times - pointer to list of allowable time periods.
- X */
- X
- Xstruct port {
- X char **pt_names;
- X char **pt_users;
- X struct pt_time *pt_times;
- X};
- X
- X/*
- X * t_days - bit array for each day of the week (0 = Sunday)
- X * t_start - starting time for this entry
- X * t_end - ending time for this entry
- X */
- X
- Xstruct pt_time {
- X short t_days;
- X short t_start;
- X short t_end;
- X};
- END_OF_FILE
- if test 1748 -ne `wc -c <'port.h'`; then
- echo shar: \"'port.h'\" unpacked with wrong size!
- fi
- # end of 'port.h'
- fi
- if test -f 'porttime.4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'porttime.4'\"
- else
- echo shar: Extracting \"'porttime.4'\" \(1877 characters\)
- sed "s/^X//" >'porttime.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.\" @(#)porttime.4 3.2 08:36:07 08 Feb 1991
- X.\"
- X.TH PORTTIME 4
- X.SH NAME
- Xporttime \- port access time file
- X.SH DESCRIPTION
- X.I porttime
- Xcontains a list of tty devices, user names, and permitted login times.
- X.PP
- XEach entry consists of three colon separated fields.
- XThe first field is a comma separated list of tty devices,
- Xor an asterisk to indicate that all tty devices are matched by this entry.
- XThe second field is a comma separated list of user names, or an
- Xasterisk to indicated that all user names are matched by this entry.
- XThe third field is a comma separated list of permitted access times.
- X.PP
- XEach access time entry consists of zero or more days of the week,
- Xabbreviated \fBSu\fR, \fBMo\fR, \fBTu\fR, \fBWe\fR, \fBTh\fR,
- X\fBFr\fR, and \fBSa\fR, followed by a pair of times separated by
- Xa hyphen.
- XThe abbreviation \fBWk\fR may be used to represent Monday thru Friday,
- Xand \fBAl\fR may be used to indicate every day.
- XIf no days are given, \fBAl\fR is assumed.
- X.SH Examples
- XThe following entry allows access to user \fBjfh\fR on every port
- Xduring weekdays from 9am to 5pm.
- X.br
- X.sp 1
- X*:jfh:Wk0900-1700
- X.br
- X.sp 1
- XThe following entries allow access only to the users \fBroot\fR and
- X\fBoper\fR on /dev/console at any time.
- XThis illustrates how the
- X\fB/etc/porttime\fR file is an ordered list of access times.
- XAny other user would match the second entry which does not permit
- Xaccess at any time.
- X.br
- X.sp 1
- Xconsole:root,oper:Al0000-2400
- X.br
- Xconsole:*:
- X.br
- X.sp 1
- XThe following entry allows access for the user \fBgames\fR on any
- Xport during non-working hours.
- X.br
- X.sp 1
- X*:games:Wk1700-0900,SaSu0000-2400
- X.br
- X.sp 1
- X.SH Files
- X/etc/porttime \- file containing port access times
- X.SH See Also
- Xlogin(1)
- END_OF_FILE
- if test 1877 -ne `wc -c <'porttime.4'`; then
- echo shar: \"'porttime.4'\" unpacked with wrong size!
- fi
- # end of 'porttime.4'
- fi
- if test -f 'pwauth.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'pwauth.8'\"
- else
- echo shar: Extracting \"'pwauth.8'\" \(1868 characters\)
- sed "s/^X//" >'pwauth.8' <<'END_OF_FILE'
- 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.\" @(#)pwauth.8 3.1 08:30:40 01 Oct 1992
- X.\"
- X.TH PWAUTH 8
- X.SH NAME
- Xpwauth \- administrator defined password authentication
- X.SH DESCRIPTION
- XThe system administrator is able to define a list of programs which
- Xare used to validate a user's identity.
- XThese programs are given in place of the encrypted password
- Xinformation which is present in either the \fB/etc/passwd\fR or
- X\fB/etc/shadow\fR files.
- XThe utilities which administer user accounts examine the encrypted
- Xpassword field and determine if the user has an administrator defined
- Xauthentication program.
- XThe \fIpw_auth\fR function will be invoked whenever one of these
- Xadministration programs determines that a user which is being altered
- Xhas authentication programs defined.
- X.PP
- XThe initial entry is created with the \fIuseradd\fR command.
- XAlterations, such as changing authentication information or deleting
- Xthe user account, will cause the \fIpw_auth\fR function to be invoked.
- XThis keeps the authentication information up to date for each user
- Xaccount.
- X.PP
- XThe authentication programs do not create the actual login or network
- Xsessions.
- XThe exit code from the authentication program is taken as an
- Xindication that the action is to be permitted.
- XThe calling process must have the appropriate priviledges to create
- Xthe login or network session itself.
- X.SH SEE ALSO
- Xlogin(1), passwd(1), su(1), useradd(1), userdel(1), usermod(1), pwauth(3)
- END_OF_FILE
- if test 1868 -ne `wc -c <'pwauth.8'`; then
- echo shar: \"'pwauth.8'\" unpacked with wrong size!
- fi
- # end of 'pwauth.8'
- 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'\" \(1732 characters\)
- sed "s/^X//" >'pwconv.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.\" @(#)pwconv.8 3.2 12:04:55 02 May 1993
- X.\"
- X.TH PWCONV 8
- X.SH NAME
- Xpwconv \- convert and update shadow password files
- X.SH SYNOPSIS
- Xpwconv
- 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 System V Release 3.2 format will be silently
- Xconverted to the new System V Release 4 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 1732 -ne `wc -c <'pwconv.8'`; then
- echo shar: \"'pwconv.8'\" unpacked with wrong size!
- fi
- # end of 'pwconv.8'
- fi
- if test -f 'rad64.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rad64.c'\"
- else
- echo shar: Extracting \"'rad64.c'\" \(1742 characters\)
- sed "s/^X//" >'rad64.c' <<'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#include "config.h"
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)rad64.c 3.3 20:38:01 07 Mar 1992";
- X#endif
- X
- X/*
- X * c64i - convert a radix 64 character to an integer
- X */
- X
- Xint c64i (c)
- Xchar c;
- X{
- X if (c == '.')
- X return (0);
- X
- X if (c == '/')
- X return (1);
- X
- X if (c >= '0' && c <= '9')
- X return (c - '0' + 2);
- X
- X if (c >= 'A' && c <= 'Z')
- X return (c - 'A' + 12);
- X
- X if (c >= 'a' && c <= 'z')
- X return (c - 'a' + 38);
- X else
- X return (-1);
- X}
- X
- X/*
- X * i64c - convert an integer to a radix 64 character
- X */
- X
- Xint i64c (i)
- Xint i;
- X{
- X if (i < 0)
- X return ('.');
- X else if (i > 63)
- X return ('z');
- X
- X if (i == 0)
- X return ('.');
- X
- X if (i == 1)
- X return ('/');
- X
- X if (i >= 2 && i <= 11)
- X return ('0' - 2 + i);
- X
- X if (i >= 12 && i <= 37)
- X return ('A' - 12 + i);
- X
- X if (i >= 38 && i <= 63)
- X return ('a' - 38 + i);
- X
- X return ('\0');
- X}
- X
- X#ifdef NEED_AL64
- X
- X/*
- X * l64a - convert a long to a string of radix 64 characters
- X */
- X
- Xchar *l64a (l)
- Xlong l;
- X{
- X static char buf[8];
- X int i = 0;
- X
- X if (i < 0L)
- X return ((char *) 0);
- X
- X do {
- X buf[i++] = i64c ((int) (l % 64));
- X buf[i] = '\0';
- X } while (l /= 64L, l > 0 && i < 6);
- X
- X return (buf);
- X}
- X
- X/*
- X * a64l - convert a radix 64 string to a long integer
- X */
- X
- Xlong a64l (s)
- Xchar *s;
- X{
- X int i;
- X long value;
- X long shift = 0;
- X
- X for (i = 0, value = 0L;i < 6 && *s;s++) {
- X value += (c64i (*s) << shift);
- X shift += 6;
- X }
- X return (value);
- X}
- X
- X#endif /* NEED_A64L */
- END_OF_FILE
- if test 1742 -ne `wc -c <'rad64.c'`; then
- echo shar: \"'rad64.c'\" unpacked with wrong size!
- fi
- # end of 'rad64.c'
- fi
- if test -f 'scologin.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'scologin.c'\"
- else
- echo shar: Extracting \"'scologin.c'\" \(1837 characters\)
- sed "s/^X//" >'scologin.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[] = "@(#)scologin.c 3.2 14:38:24 27 Oct 1991";
- X#endif
- X
- X#include <stdio.h>
- X#include "pwd.h"
- X
- X#define USAGE "usage: %s [ -r remote_host remote_user local_user [ term_type ] ]\n"
- X#define LOGIN "/etc/login"
- X
- Xextern int errno;
- Xextern char *sys_errlist[];
- Xextern char **environ;
- X
- Xmain(argc, argv)
- Xint argc;
- Xchar *argv[];
- X{
- X char *rhost, *ruser, *luser;
- X char term[1024], *nargv[8], *nenvp[2];
- X int root_user, i;
- X struct passwd *pw;
- X
- X if (argc == 1) {
- X
- X /*
- X * Called from telnetd.
- X */
- X nargv[0] = "login";
- X nargv[1] = "-p";
- X nargv[2] = NULL;
- X
- X } else if (strcmp(argv[1], "-r") == 0 && argc >= 6) {
- X
- X /*
- X * Called from rlogind.
- X */
- X
- X rhost = argv[2];
- X ruser = argv[3];
- X luser = argv[4];
- X root_user = ((pw = getpwnam(luser)) != NULL && pw->pw_uid == 0);
- X
- X i = 0;
- X if ( argc == 6 ) {
- X strcpy(term, "TERM=");
- X strncat(term+sizeof("TERM=")-1,
- X argv[5], sizeof(term)-sizeof("TERM="));
- X term[sizeof(term)-1] = '\0';
- X nenvp[i++] = term;
- X }
- X nenvp[i++] = NULL;
- X environ = nenvp;
- X
- X i = 0;
- X nargv[i++] = "login";
- X nargv[i++] = "-p";
- X nargv[i++] = "-h";
- X nargv[i++] = rhost;
- X if (ruserok(rhost, root_user, ruser, luser) == 0)
- X nargv[i++] = "-f";
- X nargv[i++] = luser;
- X nargv[i++] = NULL;
- X
- X } else {
- X
- X fprintf(stderr, USAGE, argv[0]);
- X exit(1);
- X
- X }
- X
- X (void) execv(LOGIN, nargv);
- X fprintf(stderr, "%s: could not exec '%s' [%s]\n",
- X argv[0], LOGIN, sys_errlist[errno]);
- X exit(1);
- X /*NOTREACHED*/
- X}
- END_OF_FILE
- if test 1837 -ne `wc -c <'scologin.c'`; then
- echo shar: \"'scologin.c'\" unpacked with wrong size!
- fi
- # end of 'scologin.c'
- fi
- if test -f 'shadow.4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'shadow.4'\"
- else
- echo shar: Extracting \"'shadow.4'\" \(2125 characters\)
- sed "s/^X//" >'shadow.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.\" @(#)shadow.4 3.1 23:49:44 11 Nov 1990
- X.\"
- X.TH SHADOW 4
- X.SH NAME
- Xshadow \- encrypted password file
- X.SH DESCRIPTION
- X.I shadow
- Xcontains the encrypted password information for user's accounts
- Xand optional the password aging information.
- XIncluded is
- X.IP "" .5i
- XLogin name
- X.IP "" .5i
- XEncrypted password
- X.IP "" .5i
- XDays since Jan 1, 1970 that password was last changed
- X.IP "" .5i
- XDays before password may be changed
- X.IP "" .5i
- XDays after which password must be changed
- X.IP "" .5i
- XDays before password is to expire that user is warned
- X.IP "" .5i
- XDays after password expires that account is disabled
- X.IP "" .5i
- XDays since Jan 1, 1970 that account is disabled
- X.IP "" .5i
- XA reserved field
- X.PP
- XThe password field must be filled.
- XThe encryped password consists of 13 to 24 characters from the
- X64 character alphabet
- Xa thru z, A thru Z, 0 thru 9, \. and /.
- XRefer to \fIcrypt(3)\fR for details on how this string is
- Xinterpreted.
- X.PP
- XThe date of the last password change is given as the number
- Xof days since Jan 1, 1970.
- XThe password may not be changed again until the proper number
- Xof days have passed, and must be changed after the maximum
- Xnumber of days.
- XIf the minimum number of days required is greater than the
- Xmaximum number of day allowed, this password may not be
- Xchanged by the user.
- X.PP
- XAn account is considered to be inactive and is disabled if
- Xthe password is not changed within the specified number of
- Xdays after the password expires.
- XAn account will also be disabled on the specified day
- Xregardless of other password expiration information.
- X.PP
- XThis information supercedes any password or password age
- Xinformation present in \fB/etc/passwd\fR.
- X.PP
- XThis file must not be readable by regular users if password
- Xsecurity is to be maintained.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/shadow \- encrypted user passwords
- X.SH See Also
- Xchage(1),
- Xlogin(1),
- Xpasswd(1),
- Xsu(1),
- Xsulogin(1M),
- Xshadow(3),
- Xpasswd(4),
- Xpwconv(8),
- Xpwunconv(8)
- END_OF_FILE
- if test 2125 -ne `wc -c <'shadow.4'`; then
- echo shar: \"'shadow.4'\" unpacked with wrong size!
- fi
- # end of 'shadow.4'
- fi
- if test -f 'shadow.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'shadow.h'\"
- else
- echo shar: Extracting \"'shadow.h'\" \(1827 characters\)
- sed "s/^X//" >'shadow.h' <<'END_OF_FILE'
- X/*
- X * Copyright 1988, 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#ifndef _H_SHADOW
- X#define _H_SHADOW
- X
- X/*
- X * This information is not derived from AT&T licensed sources. Posted
- X * to the USENET 11/88, and updated 11/90 with information from SVR4.
- X *
- X * @(#)shadow.h 3.3 09:06:50 07 Dec 1990
- X */
- X
- X#ifdef ITI_AGING
- Xtypedef time_t sptime;
- X#else
- Xtypedef long sptime;
- X#endif
- X
- X/*
- X * Shadow password security file structure.
- X */
- X
- Xstruct spwd {
- X char *sp_namp; /* login name */
- X char *sp_pwdp; /* encrypted password */
- X sptime sp_lstchg; /* date of last change */
- X sptime sp_min; /* minimum number of days between changes */
- X sptime sp_max; /* maximum number of days between changes */
- X sptime sp_warn; /* number of days of warning before password
- X expires */
- X sptime sp_inact; /* number of days after password expires
- X until the account becomes unusable. */
- X sptime sp_expire; /* days since 1/1/70 until account expires */
- X unsigned long sp_flag; /* reserved for future use */
- X};
- X
- X/*
- X * Shadow password security file functions.
- X */
- X
- Xstruct spwd *getspent ();
- Xstruct spwd *getspnam ();
- Xstruct spwd *sgetspent ();
- Xstruct spwd *fgetspent ();
- Xvoid setspent ();
- Xvoid endspent ();
- Xint putspent ();
- X
- X#define SHADOW "/etc/shadow"
- X
- X/*
- X * Shadow group security file structure
- X */
- X
- Xstruct sgrp {
- X char *sg_name; /* group name */
- X char *sg_passwd; /* group password */
- X char **sg_adm; /* group administator list */
- X char **sg_mem; /* group membership list */
- X};
- X
- X/*
- X * Shadow group security file functions.
- X */
- X
- Xstruct sgrp *getsgent ();
- Xstruct sgrp *getsgnam ();
- Xstruct sgrp *sgetsgent ();
- Xstruct sgrp *fgetsgent ();
- Xvoid setsgent ();
- Xvoid endsgent ();
- Xint putsgent ();
- X
- X#define GSHADOW "/etc/gshadow"
- X#endif
- END_OF_FILE
- if test 1827 -ne `wc -c <'shadow.h'`; then
- echo shar: \"'shadow.h'\" unpacked with wrong size!
- fi
- # end of 'shadow.h'
- fi
- if test -f 'su.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'su.1'\"
- else
- echo shar: Extracting \"'su.1'\" \(1700 characters\)
- sed "s/^X//" >'su.1' <<'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.\" @(#)su.1 3.1 09:34:28 21 Nov 1990
- X.\"
- X.TH SU 1
- X.SH NAME
- Xsu \- Change user ID or become super-user
- X.SH SYNOPSIS
- X.B su
- X[ - ] [ username [ args ] ]
- X.SH DESCRIPTION
- X.I su
- Xis used to become another user during a login session.
- XInvoked without a username, \fIsu\fR defaults to becoming
- Xthe super user.
- XThe optional argument \fB\-\fR may be used to provide an
- Xenvironment similiar to what the user would expect had
- Xthe user logged in directly.
- X.PP
- XAdditional arguments may be provided after the username,
- Xin which case they are supplied to the user\'s login shell.
- XIn particular, an argument of \fB-c\fR will cause the
- Xnext argument to be treated as a command by most command
- Xinterpreters.
- XThe command will be executed under the shell specified by
- X\fB$SHELL\fR, or if undefined, by the one specified in
- X\fI/etc/passwd\fR.
- X.PP
- XThe user will be prompted for a password, if appropriate.
- XInvalid passwords will produce an error message.
- XAll attempts, both valid and invalid, are logged to detect
- Xabuses of the system.
- X.PP
- XThe current environment is passed to the new shell.
- XThe value of \fB$PATH\fR is reset to \fB/bin:/usr/bin\fR
- Xfor normal users, or \fB/bin:/usr/bin:/etc\fR for the super user.
- X.SH CAVEATS
- X.PP
- XThis version of \fIsu\fR has many compilation options, only some of which
- Xmay be in use at any particular site.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/shadow \- encrypted passwords and age information
- X.br
- X$HOME/.profile \- initialization script for default shell
- X.SH See Also
- Xlogin(1),
- Xsh(1)
- END_OF_FILE
- if test 1700 -ne `wc -c <'su.1'`; then
- echo shar: \"'su.1'\" unpacked with wrong size!
- fi
- # end of 'su.1'
- fi
- if test -f 'sub.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sub.c'\"
- else
- echo shar: Extracting \"'sub.c'\" \(1728 characters\)
- sed "s/^X//" >'sub.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 "config.h"
- X
- X#ifdef USE_SYSLOG
- X#include <syslog.h>
- X
- X#ifndef LOG_WARN
- X#define LOG_WARN LOG_WARNING
- X#endif
- X#endif
- X
- X#include "pwd.h"
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#)sub.c 3.3 09:08:19 28 May 1991";
- X#endif
- X
- X#define BAD_SUBROOT "Invalid root directory \"%s\"\n"
- X#define BAD_SUBROOT2 "invalid root `%s' for user `%s'\n"
- X#define NO_SUBROOT "Can't change root directory to \"%s\"\n"
- X#define NO_SUBROOT2 "no subsystem root `%s' for user `%s'\n"
- X
- X/*
- X * subsystem - change to subsystem root
- X *
- X * A subsystem login is indicated by the presense of a "*" as
- X * the first character of the login shell. The given home
- X * directory will be used as the root of a new filesystem which
- X * the user is actually logged into.
- X */
- X
- Xvoid subsystem (pw)
- Xstruct passwd *pw;
- X{
- X /*
- X * The new root directory must begin with a "/" character.
- X */
- X
- X if (pw->pw_dir[0] != '/') {
- X printf (BAD_SUBROOT, pw->pw_dir);
- X#ifdef USE_SYSLOG
- X syslog (LOG_WARN, BAD_SUBROOT2, pw->pw_dir, pw->pw_name);
- X closelog ();
- X#endif
- X exit (1);
- X }
- X
- X /*
- X * The directory must be accessible and the current process
- X * must be able to change into it.
- X */
- X
- X if (chdir (pw->pw_dir) || chroot (pw->pw_dir)) {
- X printf (NO_SUBROOT, pw->pw_dir);
- X#ifdef USE_SYSLOG
- X syslog (LOG_WARN, NO_SUBROOT2, pw->pw_dir, pw->pw_name);
- X closelog ();
- X#endif
- X exit (1);
- X }
- X}
- END_OF_FILE
- if test 1728 -ne `wc -c <'sub.c'`; then
- echo shar: \"'sub.c'\" unpacked with wrong size!
- fi
- # end of 'sub.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'\" \(1561 characters\)
- sed "s/^X//" >'sulog.c' <<'END_OF_FILE'
- X/*
- X * Copyright 1989, 1990, 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 * This software is provided on an AS-IS basis and the author makes
- X * no warrantee of any kind.
- 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.3 13:02:53 27 Jul 1992";
- X#endif
- X
- Xextern char name[];
- Xextern char oldname[];
- X
- Xtime_t time ();
- Xextern char *getdef_str();
- X
- X/*
- X * sulog - log a SU command execution result
- X */
- X
- Xvoid
- Xsulog (tty, success)
- Xchar *tty; /* Name of terminal SU was executed from */
- Xint success; /* Success (1) or failure (0) of command */
- X{
- X char *sulog;
- X char *cp;
- 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 (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 1561 -ne `wc -c <'sulog.c'`; then
- echo shar: \"'sulog.c'\" unpacked with wrong size!
- fi
- # end of 'sulog.c'
- fi
- if test -f 'sulogin.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sulogin.8'\"
- else
- echo shar: Extracting \"'sulogin.8'\" \(2124 characters\)
- sed "s/^X//" >'sulogin.8' <<'END_OF_FILE'
- 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.\" @(#)sulogin.8 3.3 09:42:50 20 Jan 1992
- X.\"
- X.TH SULOGIN 8
- X.SH NAME
- Xsulogin \- Single-user login
- X.SH SYNTAX
- X\fBsulogin\fR [ \fItty-device\fR ]
- X.SH DESCRIPTION
- X.I sulogin
- Xis invoked by \fB/etc/init\fR prior to allowing the user
- Xaccess to the system when in single user mode.
- XThis feature may only be available on certain systems where
- X\fIinit\fR has been modified accordingly, or where the
- X\fB/etc/inittab\fR has an entry for a single user login.
- X.PP
- XThe user is prompted
- X.IP "" .5i
- XType control-d for normal startup,
- X.br
- X(or give root password for system maintenance):
- X.PP
- XInput and output will be performed with the standard file
- Xdescriptors unless the optional device name argument is provided.
- X.PP
- XIf the user enters the correct root password, a login session
- Xis initiated.
- XWhen \fBEOF\fR is pressed instead, the system enters multi-user
- Xmode.
- X.PP
- XAfter the user exits the single-user shell, or presses \fBEOF\fR,
- Xthe system begins the initialization process required to enter
- Xmulti-user mode.
- X.SH CAVEATS
- X.PP
- XThis command can only be used if \fIinit\fR has been modified to call
- X\fB/etc/sulogin\fR instead of \fB/bin/sh\fR,
- Xor if the user has set the \fIinittab\fR to support a single user
- Xlogin.
- XFor example, the line
- X.br
- X.sp 1
- Xco:s:respawn:/etc/sulogin /dev/console
- X.br
- X.sp 1
- Xshould execute the sulogin command in single user mode.
- X.PP
- XAs complete an environment as possible is created.
- XHowever, various devices may be unmounted or uninitialized and many
- Xof the user commands may be unavailable or nonfunctional as a result.
- X.SH Files
- X/etc/passwd \- user account information
- X.br
- X/etc/shadow \- encrypted passwords and age information
- X.br
- X/.profile \- initialization script for single user shell
- X.SH See Also
- Xlogin(1),
- Xinit(1M),
- Xsh(1)
- END_OF_FILE
- if test 2124 -ne `wc -c <'sulogin.8'`; then
- echo shar: \"'sulogin.8'\" unpacked with wrong size!
- fi
- # end of 'sulogin.8'
- fi
- if test -f 'ttytype.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ttytype.c'\"
- else
- echo shar: Extracting \"'ttytype.c'\" \(1717 characters\)
- sed "s/^X//" >'ttytype.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[] = "@(#)ttytype.c 3.3 19:40:04 28 Dec 1991";
- X#endif
- X
- Xextern char *getdef_str();
- X
- X/*
- X * ttytype - set ttytype from port to terminal type mapping database
- X */
- X
- Xvoid
- Xttytype (line)
- Xchar *line;
- X{
- X FILE *fp;
- X char buf[BUFSIZ];
- X char termvar[BUFSIZ];
- X char *typefile;
- X char *cp;
- X char *type;
- X char *port;
- X char *getenv ();
- X
- X if (getenv ("TERM"))
- X return;
- X if ((typefile=getdef_str("TTYTYPE_FILE")) == NULL )
- X return;
- X if (access (typefile, 0))
- X return;
- X
- X if (! (fp = fopen (typefile, "r"))) {
- X perror (typefile);
- X return;
- X }
- X while (fgets (buf, BUFSIZ, fp)) {
- X if (buf[0] == '#')
- X continue;
- X
- X if (cp = strchr (buf, '\n'))
- X *cp = '\0';
- X
- X#if defined(SUN) || defined(BSD) || defined(SUN4)
- X if ((port = strtok (buf, "\t"))
- X && (type = strtok ((char *) 0, "\t"))
- X && (type = strtok ((char *) 0, "\t"))) {
- X if (strcmp (line, port) == 0)
- X break;
- X }
- X#else /* USG */
- X if ((type = strtok (buf, " \t"))
- X && (port = strtok ((char *) 0, " \t"))) {
- X if (strcmp (line, port) == 0)
- X break;
- X }
- X#endif
- X }
- X if (! feof (fp) && ! ferror (fp)) {
- X strcat (strcpy (termvar, "TERM="), type);
- X addenv (termvar);
- X }
- X fclose (fp);
- X}
- END_OF_FILE
- if test 1717 -ne `wc -c <'ttytype.c'`; then
- echo shar: \"'ttytype.c'\" unpacked with wrong size!
- fi
- # end of 'ttytype.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'\" \(1423 characters\)
- sed "s/^X//" >'userdel.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.\" @(#)userdel.1 3.2 08:04:38 07 May 1993
- 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 CAVEATS
- X\fBuserdel\fR will not allow you to remove an account if the user
- Xis currently logged in.
- XYou must kill any running processes which belong to an account that
- Xyou are deleting.
- 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 1423 -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 13 \(of 14\).
- cp /dev/null ark13isdone
- 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...
-