home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-28 | 44.8 KB | 1,702 lines |
-
- Here is a new version of linux-patches for the original shadow 3.3.1 version.
- You need the patches (shadow-3.3.1.dif) and the unmodified original version
- (shadow-3.3.1.tar.gz).
- Patch the original version with:
- cd shadow-3.3.1; patch -s -p0 < shadow-3.3.1.dif
-
- There are several bugs fixed. I advise to change to these new patches.
- I also tried to conform to the new Linux filesystem layout.
- They should work ok for the old Linux C library 4.4.x and also for the
- new C library 4.5.x.
- (Note: This version doesn't use the shadow routines in the new C library,
- so any maybe existing bugs in the C library do not harm. If you want to
- use them, do not include the files shadow.c and gshadow.c, when building
- the library libshadow.a.)
-
- The original Patches were from Peter McDonald (for shadow 3.2.2).
- Newer patches are also from:
- - Wolfram Gloger u7y22ab@sunmail.lrz-muenchen.de
- - Steve Robins steve@nyongwa.cam.org
- - Neal Becker neal@ctd.comsat.com
-
- Please mail any further patches to rzsfl@rz.uni-sb.de.
-
- Florian La Roche
-
- (P.S.: Install also the new libshadow.a into /usr/lib, I forgot
- that in the Makefile, I think...)
-
- (P.S.2.: Please look at the copyright!!! If you want to rewrite some
- of the programs and make them public under the GPL/LGPL, please
- contact me.)
-
-
- --- Makefile
- +++ Makefile 1994/01/10 21:33:16
- @@ -31,14 +31,14 @@
- # seems to use /bin, USG seems to use /etc, SunOS 4.1.1 seems to use /usr/bin.
- # If you define SCOLOGIN, you MUST use /etc as LOGINDIR.
- # LOGINDIR = /bin
- -LOGINDIR = /etc
- +LOGINDIR = /bin
- # LOGINDIR = /usr/bin
-
- # Define any special libraries required to access the directory routines.
- # Some systems require -lndir for the directory routines. SCO Xenix uses
- # -lx for that. Your system might need nothing.
- # NDIR = -lndir
- -NDIR = -lx
- +NDIR =
- # NDIR =
-
- # Define some stuff for Cracklib. This assumes that libcracklib.a is
- @@ -80,10 +80,9 @@
- DEST_INCLUDE_DIR = /usr/include
-
- # Flags for SCO Xenix/386
- -CFLAGS = -O -M3 -g $(OS) -I$(DEST_INCLUDE_DIR) $(CRACKDEF)
- -LIBS = -lcrypt -lndbm
- -# LIBS = -lcrypt -ldbm
- -LDFLAGS = -M3 -g
- +CFLAGS = -O2 -m486 -fomit-frame-pointer $(OS)
- +LIBS =
- +LDFLAGS = -s -v
- LTFLAGS =
-
- # Flags for normal machines
- @@ -96,24 +95,6 @@
- # LIBS =
- # LDFLAGS =
-
- -# This should be Slibsec.a for small model, or Llibsec.a for
- -# large model or whatever. MUST AGREE WITH CFLAGS!!! For non-Intel
- -# machines, just use libsec.a
- -LIBSEC = Slibsec.a
- -# LIBSEC = libsec.a
- -
- -# Names for root user and group, and bin user and group. See your
- -# /etc/passwd and /etc/group files. BSD and SUN use "wheel", most
- -# others use "root" for RGID.
- -RUID = root
- -RGID = root
- -# RGID = wheel
- -BUID = bin
- -BGID = bin
- -
- -# Where the login.defs file will be copied. Must agree with config.h
- -DEST_LOGIN_DEFS = /etc/login.defs
- -
- # Rules for .L (lint) files.
- .SUFFIXES: .L
- LINT = lint
- @@ -188,7 +169,7 @@
- groupdel.c groupmod.c tz.c console.c hushed.c getdef.c scologin.c \
- logoutd.c groups.c pwauth.c lockpw.c chowndir.c
-
- -FILES1 = README patchlevel.h newgrp.c Makefile config.h pwunconv.c obscure.c \
- +FILES1 = README patchlevel.h newgrp.c config.h pwunconv.c obscure.c \
- age.c id.c
-
- FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
- @@ -201,7 +182,7 @@
- pwdbm.c grdbm.c gshadow.c sppack.c grpck.c
-
- FILES6 = gspack.c spdbm.c lastlog.h shell.c login.c sub.c dpmain.c mail.c \
- - env.c pwd.h.m4 grpack.c shadow.h log.c grent.c motd.c dialup.h \
- + env.c pwd.h.m4 grpack.c log.c grent.c motd.c dialup.h \
- fields.c gsdbm.c utmp.c failure.c
-
- FILES7 = groupio.c shadowio.c sgroupio.c groups.c copydir.c mkrmdir.c \
- @@ -218,23 +199,28 @@
- MAN_1 = chage.1 chfn.1 chsh.1 id.1 login.1 newgrp.1 passwd.1 su.1 \
- useradd.1 userdel.1 usermod.1 groupadd.1 groupdel.1 groupmod.1 \
- groups.1 pwck.1 grpck.1
- -MAN_3 = shadow.3 pwauth.3
- +MAN_3 = shadow.3
- MAN_4 = faillog.4 passwd.4 porttime.4 shadow.4
- MAN_5 = login.5
- -MAN_8 = chpasswd.8 dpasswd.8 faillog.8 newusers.8 pwconv.8 pwunconv.8 \
- - sulogin.8 mkpasswd.8 logoutd.8 pwauth.8 lastlog.8
- +MAN_8 = dpasswd.8 faillog.8 newusers.8
-
- DOCS1 = $(MAN_1) $(MAN_3) $(MAN_4)
- DOCS2 = $(MAN_5) $(MAN_8)
- DOCS = $(DOCS1) $(DOCS2)
-
- -BINS = su login pwconv pwunconv passwd sulogin faillog newgrp sg gpasswd \
- - mkpasswd chfn chsh chage chpasswd newusers dpasswd id useradd \
- - userdel usermod groupadd groupdel groupmod $(SCOLOGIN) logoutd \
- +BINS = su login passwd faillog newgrp sg gpasswd \
- + chfn chsh chage newusers dpasswd id useradd \
- + userdel usermod groupadd groupdel groupmod $(SCOLOGIN) \
- groups pwck grpck lastlog
-
- all: $(BINS) $(DOCS)
-
- +Linux:
- + rm -f shadow.h
- + touch Linux
- +
- +$(BINS): Linux
- +
- .PRECIOUS: libshadow.a
-
- libshadow.a: \
- @@ -262,11 +248,11 @@
- libshadow.a(shadow.o) \
- libshadow.a(shadowio.o) \
- libshadow.a(sppack.o) \
- + libshadow.a(sppwd.o) \
- libshadow.a(lockpw.o)
- $(RANLIB) libshadow.a
-
- -libsec: $(LIBSEC)(shadow.o)
- - $(RANLIB) $(LIBSEC)
- +sppwd.o: sppwd.c
-
- save:
- [ ! -d save ] && mkdir save
- @@ -278,8 +264,7 @@
- -cp /bin/su /bin/passwd /bin/gpasswd /bin/dpasswd /bin/faillog \
- /bin/newgrp /bin/chfn /bin/chsh /bin/chage /bin/id \
- /bin/scologin save
- - -cp $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/shadow.h \
- - $(DEST_INCLUDE_DIR)/pwd.h save
- + -cp $(DEST_INCLUDE_DIR)/dialup.h save
-
- restore:
- [ -d save ]
- @@ -289,49 +274,23 @@
- logoutd login.defs pwck grpck /etc)
- -(cd save ; cp su passwd gpasswd dpasswd faillog newgrp chfn chsh \
- chage id scologin /bin)
- - -(cd save ; cp dialup.h shadow.h pwd.h $(DEST_INCLUDE_DIR) )
- + -(cd save ; cp dialup.h $(DEST_INCLUDE_DIR) )
-
- install: all
- - strip $(BINS)
- - cp login $(LOGINDIR)/login
- - cp mkpasswd pwconv pwunconv sulogin chpasswd newusers \
- - useradd userdel usermod groupadd groupdel groupmod logoutd \
- - pwck grpck /etc
- - cp su passwd gpasswd dpasswd faillog newgrp chfn chsh chage id /bin
- - rm -f /bin/sg
- - ln /bin/newgrp /bin/sg
- - cp dialup.h shadow.h pwd.h $(DEST_INCLUDE_DIR)
- - chown $(RUID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
- - /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
- - /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
- - /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
- - /etc/groupmod /etc/logoutd /etc/pwck /etc/grpck
- - chgrp $(RGID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
- - /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
- - /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
- - /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
- - /etc/groupmod /etc/logoutd /etc/pwck /etc/grpck
- - chown $(BUID) /bin/faillog /bin/id $(DEST_INCLUDE_DIR)/shadow.h \
- - $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/pwd.h
- - chgrp $(BGID) /bin/faillog /bin/id $(DEST_INCLUDE_DIR)/shadow.h \
- - $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/pwd.h
- - chmod 700 /etc/pwconv /etc/pwunconv /etc/sulogin /etc/mkpasswd \
- - /etc/chpasswd /etc/newusers /bin/dpasswd /etc/logoutd \
- - /etc/useradd /etc/userdel /etc/usermod /etc/groupadd \
- - /etc/groupdel /etc/groupmod /etc/pwck /etc/grpck
- - chmod 4711 $(LOGINDIR)/login /bin/su /bin/passwd /bin/gpasswd \
- - /bin/newgrp /bin/chfn /bin/chsh /bin/chage
- - chmod 711 /bin/faillog /bin/id
- - chmod 444 $(DEST_INCLUDE_DIR)/shadow.h $(DEST_INCLUDE_DIR)/dialup.h \
- - $(DEST_INCLUDE_DIR)/pwd.h
- - [ -f $(DEST_LOGIN_DEFS) ] || (cp login.defs $(DEST_LOGIN_DEFS) ; \
- - chown $(RUID) $(DEST_LOGIN_DEFS) ; \
- - chgrp $(RGID) $(DEST_LOGIN_DEFS) ; \
- - chmod 600 $(DEST_LOGIN_DEFS) )
- - [ -z "$(SCOLOGIN)" ] || (cp scologin /bin/login ; \
- - chown $(RUID) /bin/login ; \
- - chgrp $(RGID) /bin/login ; \
- - chmod 755 /bin/login )
- + install -m 644 $(MAN_1) /usr/man/man1
- + install -m 644 $(MAN_3) /usr/man/man3
- + install -m 644 $(MAN_4) /usr/man/man4
- + install -m 644 $(MAN_5) /usr/man/man5
- + install -m 644 $(MAN_8) /usr/man/man8
- + install groups /usr/bin
- + install -m4755 chfn chsh chage /usr/bin
- + install -m4755 login $(LOGINDIR)/login
- + install -m744 newusers \
- + useradd userdel usermod groupadd groupdel groupmod \
- + pwck grpck /usr/sbin
- + install -m755 dpasswd faillog id /bin
- + install -m4755 su passwd gpasswd newgrp /bin
- + ln -sf newgrp /bin/sg
-
- lint: su.lint login.lint pwconv.lint pwunconv.lint passwd.lint sulogin.lint \
- faillog.lint newgrp.lint gpasswd.lint mkpasswd.lint chfn.lint \
- @@ -531,8 +490,8 @@
- pwd.h.m4:
- [ -f s.pwd.h.m4 ] && $(GET) $(GFLAGS) s.pwd.h.m4
-
- -pwd.h: pwd.h.m4
- - m4 $(OS) < pwd.h.m4 > pwd.h
- +#pwd.h: pwd.h.m4
- +# m4 $(OS) < pwd.h.m4 > pwd.h
-
- logoutd: logoutd.o libshadow.a
- $(CC) -o logoutd $(LDFLAGS) logoutd.o libshadow.a
- @@ -557,70 +516,70 @@
- susetup.c: setup.c
- cp setup.c susetup.c
-
- -susetup.o: config.h susetup.c pwd.h
- +susetup.o: config.h susetup.c
- $(CC) -c $(CFLAGS) -DSU susetup.c
-
- scologin: scologin.o
- $(CC) -o scologin $(LDFLAGS) scologin.o -lsocket
-
- -passwd.o: config.h shadow.h pwd.h pwauth.h
- -lmain.o: config.h lastlog.h faillog.h pwd.h pwauth.h
- -smain.o: config.h lastlog.h pwd.h shadow.h pwauth.h
- -sub.o: pwd.h
- -setup.o: config.h pwd.h
- +passwd.o: config.h pwauth.h
- +lmain.o: config.h lastlog.h faillog.h pwauth.h
- +smain.o: config.h lastlog.h pwauth.h
- +sub.o:
- +setup.o: config.h
- mkrmdir.o: config.h
- utmp.o: config.h
- mail.o: config.h
- motd.o: config.h
- -age.o: config.h pwd.h
- -log.o: config.h lastlog.h pwd.h
- +age.o: config.h
- +log.o: config.h lastlog.h
- shell.o: config.h
- -entry.o: config.h shadow.h pwd.h
- -hushed.o: config.h pwd.h
- -valid.o: config.h pwd.h
- +entry.o: config.h
- +hushed.o: config.h
- +valid.o: config.h
- failure.o: faillog.h config.h
- -faillog.o: faillog.h config.h pwd.h
- -newgrp.o: config.h shadow.h pwd.h
- -mkpasswd.o: config.h shadow.h pwd.h
- -gpmain.o: config.h pwd.h
- -chfn.o: config.h pwd.h
- -chsh.o: config.h pwd.h
- -chage.o: config.h shadow.h pwd.h
- -pwconv.o: config.h shadow.h
- -pwunconv.o: config.h shadow.h pwd.h
- -chpasswd.o: config.h shadow.h pwd.h
- -id.o: pwd.h
- -newusers.o: config.h shadow.h pwd.h
- +faillog.o: faillog.h config.h
- +newgrp.o: config.h
- +mkpasswd.o: config.h
- +gpmain.o: config.h
- +chfn.o: config.h
- +chsh.o: config.h
- +chage.o: config.h
- +pwconv.o: config.h
- +pwunconv.o: config.h
- +chpasswd.o: config.h
- +id.o:
- +newusers.o: config.h
- dpmain.o: config.h dialup.h
- -useradd.o: config.h shadow.h pwd.h pwauth.h
- -userdel.o: config.h shadow.h pwd.h pwauth.h
- -usermod.o: config.h shadow.h pwd.h pwauth.h
- -groupadd.o: config.h shadow.h
- -groupdel.o: config.h shadow.h
- -groupmod.o: config.h shadow.h
- +useradd.o: config.h pwauth.h
- +userdel.o: config.h pwauth.h
- +usermod.o: config.h pwauth.h
- +groupadd.o: config.h
- +groupdel.o: config.h
- +groupmod.o: config.h
- logoutd.o: config.h
- sulogin.o: config.h pwauth.h
- copydir.o: config.h
- chowndir.o: config.h
- -pwck.o: config.h shadow.h pwd.h
- -grpck.o: config.h shadow.h pwd.h
- +pwck.o: config.h
- +grpck.o: config.h
-
- -libshadow.a(shadow.o): shadow.h config.h
- -libshadow.a(shadowio.o): shadow.h
- -libshadow.a(grent.o): config.h shadow.h
- -libshadow.a(sgroupio.o): shadow.h
- +libshadow.a(shadow.o): config.h
- +libshadow.a(shadowio.o):
- +libshadow.a(grent.o): config.h
- +libshadow.a(sgroupio.o):
- libshadow.a(dialup.o): dialup.h
- libshadow.a(dialchk.o): dialup.h config.h
- libshadow.a(getdef.o): config.h
- -libshadow.a(pwdbm.o): config.h pwd.h
- -libshadow.a(spdbm.o): config.h shadow.h
- +libshadow.a(pwdbm.o): config.h
- +libshadow.a(spdbm.o): config.h
- libshadow.a(grdbm.o): config.h
- libshadow.a(gshadow.o): config.h
- -libshadow.a(gsdbm.o): config.h shadow.h
- +libshadow.a(gsdbm.o): config.h
- libshadow.a(pwauth.o): config.h pwauth.h
- -libshadow.a(pwpack.o): config.h pwd.h
- -libshadow.a(pwent.o): config.h pwd.h
- -libshadow.a(pwio.o): pwd.h
- +libshadow.a(pwpack.o): config.h
- +libshadow.a(pwent.o): config.h
- +libshadow.a(pwio.o):
- libshadow.a(getpass.o): config.h
- libshadow.a(encrypt.o): config.h
- libshadow.a(port.o): port.h
- @@ -628,7 +587,7 @@
- libshadow.a(lockpw.o):
-
- clean:
- - -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir pwd.h
- + -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir
-
- clobber: clean
- -rm -f $(BINS) *.lint *.L libshadow.a
- --- Makefile.Linux
- +++ Makefile.Linux 1994/01/10 21:28:40
- @@ -0,0 +1,18 @@
- +# patches by Wolfram Gloger u7y22ab@sunmail.lrz-muenchen.de (failure.c)
- +# Steve Robins steve@nyongwa.cam.org
- +# Neal Becker neal@ctd.comsat.com
- +
- +compile:
- + make all
- +
- +install: compile
- + make install
- +
- +clean:
- + make clean
- +
- +realclean:
- + make clobber
- +
- +small:
- +
- --- chage.1
- +++ chage.1 1994/01/10 21:28:40
- @@ -8,7 +8,7 @@
- .\"
- .TH CHAGE 1
- .SH NAME
- -chage \- change user password expirate information
- +chage \- change user password expire information
- .SH SYNOPSIS
- \fBchage\fR [ \fB-m \fImindays\fR ] [ \fB-M \fImaxdays\fR ]
- [ \fB-d \fIlastday\fR ] [ \fB-I \fIinactive\fR ]
- @@ -16,20 +16,20 @@
- .sp 1
- \fBchage\fR -l \fIuser\fR
- .SH DESCRIPTION
- -\fIchage\f changes the number of days between password changes and the
- +\fIchage\fR changes the number of days between password changes and the
- date of the last password change.
- This information is used by the system to determine when a user must
- change her password.
- -The \fIchage\f command is restricted to the root user, except for the
- +The \fIchage\fR command is restricted to the root user, except for the
- \fB-l\fR option, which may be used by an unprivileged user to determine
- when her password or account is due to expire.
- .PP
- -With the \fB-m\fR option, the value of \fImindays\f is the minimum number
- +With the \fB-m\fR option, the value of \fImindays\fR is the minimum number
- of days between password changes.
- A value of zero for this field indicates that the user may change
- her password at any time.
- .PP
- -With the \fB-M\fR option, the value of \fImaxdays\f is the maximum number
- +With the \fB-M\fR option, the value of \fImaxdays\fR is the maximum number
- of days during which a password is valid.
- When \fImaxdays\fR plus \fIlastday\fR is less than the current day,
- the user will be required to change her password before being
- @@ -37,7 +37,7 @@
- This occurance can be planned for in advance by use of the \fB-W\fR option,
- which provides the user with advance warning.
- .PP
- -With the \fB-d\fR option, the value of \fIlastday\f is the number of days
- +With the \fB-d\fR option, the value of \fIlastday\fR is the number of days
- since January 1st, 1970 when the password was last changed.
- The date may also be expressed in the format MM/DD/YY (or the format more
- commonly used in your area).
- @@ -63,16 +63,11 @@
- The \fIwarndays\fR option is the number of days prior to the password
- expiring that a user will be warned her password is about to expire.
- .PP
- -All of the above values are stored exactly as days when the shadow
- -password file is used, but are converted to and from weeks when the
- -standard password file is used.
- -Because of this conversion, rounding errors may result.
- -.PP
- -If none of the options are selected, \fIchage\f operates in an interactive
- +If none of the options are selected, \fIchage\fR operates in an interactive
- fashion, prompting the user with the current values for all of the fields.
- Enter the new value to change the field, or leave the line blank to use
- the current value.
- -The current value is displayed between a pair of \fB[ ]\f marks.
- +The current value is displayed between a pair of \fB[ ]\fR marks.
- .SH Files
- /etc/passwd \- user account information
- .br
- --- chfn.1
- +++ chfn.1 1994/01/10 21:28:40
- @@ -15,25 +15,25 @@
- [ \fB-w \fIwork_ph\fR ] [ \fB-h \fIhome_ph\fR ] [ \fB-o \fIother\fR ]
- [ \fIuser\fR ]
- .SH DESCRIPTION
- -\fIchfn\f changes user fullname, office number, office extension, and home
- +\fIchfn\fR changes user fullname, office number, office extension, and home
- phone number information for a user's account.
- -This information is typically printed by \fIfinger(1)\f and similiar
- +This information is typically printed by \fIfinger(1)\fR and similiar
- programs.
- A normal user may only change the fields for their own account,
- the super user may change the fields for any account.
- -Also, only the super user may use the \fB-o\f option to change the
- +Also, only the super user may use the \fB-o\fR option to change the
- undefined portions of the GCOS field.
- .PP
- The only restrictions placed on the contents of the fields is that no
- control characters may be present, nor any of comma, colon, or equal sign.
- -The \fIother\f field does not have this restriction, and is used to
- +The \fIother\fR field does not have this restriction, and is used to
- store accounting information used by other applications.
- .PP
- -If none of the options are selected, \fIchfn\f operates in an interactive
- +If none of the options are selected, \fIchfn\fR operates in an interactive
- fashion, prompting the user with the current values for all of the fields.
- Enter the new value to change the field, or leave the line blank to use
- the current value.
- -The current value is displayed between a pair of \fB[ ]\f marks.
- +The current value is displayed between a pair of \fB[ ]\fR marks.
- Without options, chfn prompts for the current user account.
- .SH Files
- /etc/passwd \- user account information
- --- config.h
- +++ config.h 1994/01/10 21:28:40
- @@ -12,6 +12,9 @@
- * no warrantee of any kind.
- */
-
- +#include <sys/types.h>
- +#include <stdio.h>
- +
- /*
- * Configuration file for login.
- *
- @@ -19,6 +22,8 @@
- */
-
-
- +#define LASTFILE "/var/adm/lastlog"
- +
- /*
- * Pathname to the run-time configuration definitions file.
- */
- @@ -53,7 +58,7 @@
- * Define DOUBLESIZE to use 16 character passwords
- */
-
- -#define DOUBLESIZE
- +#undef DOUBLESIZE
-
- /*
- * Define AGING if you want the password aging checks made.
- @@ -82,7 +87,7 @@
- */
-
- #define RLOGIN
- -#undef UT_HOST
- +#define UT_HOST
-
- /*
- * Define the "success" code from ruserok(). Most modern systems use 0
- @@ -96,9 +101,9 @@
- * Select one of the following
- */
-
- -#define DIR_XENIX /* include <sys/ndir.h>, use (struct direct) */
- +/* #define DIR_XENIX /* include <sys/ndir.h>, use (struct direct) */
- /* #define DIR_BSD /* include <ndir.h>, use (struct direct) */
- -/* #define DIR_SYSV /* include <dirent.h>, use (struct dirent) */
- +#define DIR_SYSV /* include <dirent.h>, use (struct dirent) */
-
- /*
- * Various system environment definitions.
- @@ -106,23 +111,23 @@
-
- #define HAVE_ULIMIT /* Define if your UNIX supports ulimit() */
- #undef HAVE_RLIMIT /* Define if your UNIX supports setrlimit() */
- -#define GETPWENT /* Define if you want my GETPWENT(3) routines */
- -#define GETGRENT /* Define if you want my GETGRENT(3) routines */
- +#undef GETPWENT /* Define if you want my GETPWENT(3) routines */
- +#undef GETGRENT /* Define if you want my GETGRENT(3) routines */
- #define NEED_AL64 /* Define if library does not include a64l() */
- -#define NEED_MKDIR /* Define if system does not have mkdir() */
- -#define NEED_RMDIR /* Define if system does not have rmdir() */
- -#define NEED_RENAME /* Define if system does not have rename() */
- -#define NEED_STRSTR /* Define if library does not include strstr() */
- +#undef NEED_MKDIR /* Define if system does not have mkdir() */
- +#undef NEED_RMDIR /* Define if system does not have rmdir() */
- +#undef NEED_RENAME /* Define if system does not have rename() */
- +#undef NEED_STRSTR /* Define if library does not include strstr() */
- #undef NEED_PUTPWENT /* Define if library does not include putpwent()*/
- -#define SIGTYPE int /* Type returned by signal() */
- +#define SIGTYPE void /* Type returned by signal() */
-
- /*
- * These definitions MUST agree with the values defined in <pwd.h>.
- */
-
- #undef BSD_QUOTA /* the pw_quota field exists */
- -#define ATT_AGE /* the pw_age field exists */
- -#define ATT_COMMENT /* the pw_comment field exists */
- +#undef ATT_AGE /* the pw_age field exists */
- +#undef ATT_COMMENT /* the pw_comment field exists */
-
- #define UID_T uid_t /* set to be the type of UID's */
- #define GID_T gid_t /* set to be the type of GID's */
- @@ -182,7 +187,7 @@
- * from single user to multi-user mode.
- */
-
- -#define TELINIT /**/
- +#undef TELINIT /**/
- #define RUNLEVEL "2" /**/
-
- /*
- @@ -190,5 +195,6 @@
- * HAS_CRONTAB. If your system can "atrm <user>", define HAS_ATRM.
- */
-
- -#undef HAS_CRONTAB
- -#undef HAS_ATRM
- +#define CRONTAB_REM "crontab -d -u %s"
- +#define ATRUN_REM "atrm %s"
- +
- --- copydir.c
- +++ copydir.c 1994/01/10 21:28:40
- @@ -213,8 +213,8 @@
- */
-
- mkdir (dst_name, sb.st_mode & 0777);
- - chown (dst_name, uid == -1 ? sb.st_uid:uid,
- - gid == -1 ? sb.st_gid:gid);
- + chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
- + gid == (GID_T)-1 ? sb.st_gid:gid);
-
- if (copy_tree (src_name, dst_name, uid, gid)) {
- err++;
- @@ -250,8 +250,8 @@
-
- if (! S_ISREG (sb.st_mode)) {
- if (mknod (dst_name, sb.st_mode & ~07777, sb.st_rdev) ||
- - chown (dst_name, uid == -1 ? sb.st_uid:uid,
- - gid == -1 ? sb.st_gid:gid) ||
- + chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
- + gid == (GID_T)-1 ? sb.st_gid:gid) ||
- chmod (dst_name, sb.st_mode & 07777)) {
- err++;
- break;
- @@ -269,8 +269,8 @@
- break;
- }
- if ((ofd = open (dst_name, O_WRONLY|O_CREAT, 0)) < 0 ||
- - chown (dst_name, uid == -1 ? sb.st_uid:uid,
- - gid == -1 ? sb.st_gid:gid) ||
- + chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
- + gid == (GID_T)-1 ? sb.st_gid:gid) ||
- chmod (dst_name, sb.st_mode & 07777)) {
- close (ifd);
- err++;
- --- faillog.4
- +++ faillog.4 1994/01/10 21:28:40
- @@ -31,6 +31,6 @@
-
- .DE
- .SH Files
- -/usr/adm/faillog \- login failure log
- +/var/adm/faillog \- login failure log
- .SH See Also
- faillog(8)
- --- faillog.8
- +++ faillog.8 1994/01/10 21:28:40
- @@ -13,7 +13,7 @@
- /etc/faillog [ -u uid ] [ -a ] [ -t days ] [ -m max ] [ -pr ]
- .SH DESCRIPTION
- \fIfaillog\fR formats the contents of the failure log,
- -\fI/usr/adm/faillog\fR, and maintains failure counts and
- +\fI/var/adm/faillog\fR, and maintains failure counts and
- limits.
- The order of the arguments to \fIfaillog\fR is significant.
- Each argument is processed immediately in the order given.
- @@ -31,14 +31,14 @@
- It is meaningless with the \fB-r\fR flag.
- .PP
- The \fB-r\fR flag is used to reset the count of login failures.
- -Write access to \fI/usr/adm/faillog\fR is required for
- +Write access to \fI/var/adm/faillog\fR is required for
- this option.
- Entering \fB-u login-name\fR will cause only the failure count
- for \fBlogin-name\fR to be reset.
- .PP
- The \fB-m\fR flag is used to set the maximum number of login
- failures before the account is disabled.
- -Write access to \fB/usr/adm/faillog\fR is required for this
- +Write access to \fB/var/adm/faillog\fR is required for this
- option.
- Entering \fB-m max\fR will cause all accounts to be disabled
- after \fBmax\fR failed logins occur.
- @@ -60,7 +60,7 @@
- failure, you must explicitly request the user with the \fB-u\fR flag,
- or print out all users with the \fB-a\fR flag.
- .SH Files
- -/usr/adm/faillog \- failure logging file
- +/var/adm/faillog \- failure logging file
- .SH See Also
- login(1),
- faillog(4)
- --- faillog.h
- +++ faillog.h 1994/01/10 21:28:40
- @@ -19,7 +19,7 @@
- * is indexed in that fashion.
- */
-
- -#ifdef SVR4
- +#if defined(SVR4) || defined(__linux__)
- #define FAILFILE "/var/adm/faillog"
- #else
- #define FAILFILE "/usr/adm/faillog"
- --- failure.c
- +++ failure.c 1994/01/10 21:28:40
- @@ -183,7 +183,11 @@
- char lasttimeb[32];
- char *lasttime = lasttimeb;
- #else
- +#if __STDC__
- + char lasttime[256];
- +#else
- char *lasttime;
- +#endif
- #endif
-
- if (fail->fail_cnt == 0)
- --- gpmain.c
- +++ gpmain.c 1994/01/10 21:28:40
- @@ -329,7 +329,9 @@
- struct sgrp *getsgnam ();
- #endif
- struct passwd *pw = 0;
- +#ifndef __linux__
- struct passwd *getpwuid ();
- +#endif
- struct passwd *getpwnam ();
-
- /*
- --- groups.1
- +++ groups.1 1994/01/10 21:28:40
- @@ -24,7 +24,7 @@
- If the value does not have a corresponding entry in
- \fB/etc/group\fR, the value will be displayed as the numerical group value.
- The optional \fIuser\fR parameter will display the groups for the named
- -\fIuser\R.
- +\fIuser\fR.
- .SH Note
- Systems which do not support concurrent group sets will have the information
- from \fB/etc/group\fR reported.
- --- groups.c
- +++ groups.c 1994/01/10 21:28:40
- @@ -11,6 +11,8 @@
-
- static char sccsid[] = "@(#)groups.c 3.2 09:47:19 25 Nov 1991";
-
- +#include "ngroups.h"
- +#include "config.h"
- #include "stdio.h"
- #include "pwd.h"
- #include "grp.h"
- @@ -54,16 +56,11 @@
- char **argv;
- {
- int ngroups;
- -#if NGROUPS > 0
- -#if NGROUPS > 100
- - gid_t *groups;
- -#else
- - gid_t groups[NGROUPS];
- -#endif
- +#ifdef NGROUPS_MAX
- + GID_T *groups;
- int i;
- #else
- char *logname;
- - char *getlogin();
- #endif
- struct group *gr;
- struct group *getgrgid();
- @@ -75,7 +72,7 @@
- * for the current user.
- */
-
- -#if NGROUPS > 0
- +#ifdef NGROUPS_MAX
- /*
- * This system supports concurrent group sets, so
- * I can ask the system to tell me which groups are
- @@ -83,9 +80,7 @@
- */
-
- ngroups = getgroups (0, 0);
- -#if NGROUPS > 100
- - groups = (gid_t *) malloc (ngroups * sizeof (int *));
- -#endif
- + groups = (GID_T *) malloc (ngroups * sizeof (GID_T));
- getgroups (ngroups, groups);
-
- /*
- --- gshadow.c
- +++ gshadow.c 1994/01/10 21:28:40
- @@ -135,8 +135,8 @@
- long atol ();
- int i;
-
- - strncpy (sgrbuf, string, (int) sizeof sgrbuf - 1);
- - sgrbuf[sizeof sgrbuf - 1] = '\0';
- + strncpy (sgrbuf, string, (int) sizeof (sgrbuf) - 1);
- + sgrbuf[sizeof (sgrbuf) - 1] = '\0';
-
- if (cp = strrchr (sgrbuf, '\n'))
- *cp = '\0';
- @@ -157,7 +157,7 @@
- * the line is invalid.
- */
-
- - if (cp || i != FIELDS)
- + if ((cp && *cp) || i != FIELDS)
- return 0;
-
- sgroup.sg_name = fields[0];
- --- id.c
- +++ id.c 1994/01/10 21:28:40
- @@ -20,6 +20,7 @@
- * the concurrent group set if the current system supports it.
- */
-
- +#include "ngroups.h"
- #include <sys/types.h>
- #include <stdio.h>
- #include <grp.h>
- @@ -32,11 +33,7 @@
-
- usage ()
- {
- -#if NGROUPS > 0
- fprintf (stderr, "usage: id [ -a ]\n");
- -#else
- - fprintf (stderr, "usage: id\n");
- -#endif
- exit (1);
- }
-
- @@ -46,21 +43,13 @@
- char **argv;
- {
- int id;
- -#if NGROUPS > 0
- -#if NGROUPS > 100
- GID_T *groups;
- -#else
- - GID_T groups[NGROUPS];
- -#endif
- int ngroups;
- int aflg = 0;
- -#endif
- - struct passwd *pw,
- - *getpwuid();
- - struct group *gr,
- - *getgrgid();
-
- -#if NGROUPS > 0
- + struct passwd *pw;
- + struct group *gr;
- +
- /*
- * See if the -a flag has been given to print out the
- * concurrent group set.
- @@ -72,10 +61,6 @@
- else
- aflg = 1;
- }
- -#else
- - if (argc > 1)
- - usage ();
- -#endif
-
- /*
- * Print out the real user ID and group ID. If the user or
- @@ -109,7 +94,6 @@
- else
- printf (" egid=%d", id);
- }
- -#if NGROUPS > 0
-
- /*
- * Print out the concurrent group set if the user has requested
- @@ -117,21 +101,20 @@
- * names.
- */
-
- - if (aflg && (ngroups = getgroups (0, 0)) != -1) {
- + if (aflg && NGROUPS_MAX > 1 && (ngroups = getgroups (0, 0)) > 0) {
- int i;
-
- -#if NGROUPS > 100
- /*
- * The size of the group set is determined so an array
- * large enough to hold it can be allocated.
- */
-
- - if (groups = (int *) malloc (ngroups * sizeof *groups)) {
- + if (!(groups = malloc (ngroups * sizeof *groups))) {
- putchar ('\n');
- perror ("out of memory");
- exit (1);
- }
- -#endif
- +
- /*
- * Start off the group message. It will be of the format
- *
- @@ -153,7 +136,6 @@
- printf ("%d", (int) groups[i]);
- }
- }
- -#endif
-
- /*
- * Finish off the line.
- --- lastlog.c
- +++ lastlog.c 1994/01/10 21:28:41
- @@ -26,8 +26,6 @@
- #define strrchr rindex
- #endif
-
- -#define LASTFILE "/usr/adm/lastlog"
- -
- #include "config.h"
- #include "lastlog.h"
-
- --- lastlog.h
- +++ lastlog.h 1994/01/10 21:28:41
- @@ -1,3 +1,6 @@
- +#ifndef _LASTLOG_H
- +#define _LASTLOG_H
- +
- /*
- * Copyright 1989, 1990, 1992, 1993, John F. Haugh II
- * All rights reserved.
- @@ -25,7 +28,7 @@
- struct lastlog {
- time_t ll_time;
- char ll_line[8];
- -#ifdef SVR4
- char ll_host[16];
- -#endif
- };
- +
- +#endif
- --- log.c
- +++ log.c 1994/01/10 21:28:41
- @@ -36,14 +36,6 @@
-
- #include "lastlog.h"
-
- -#ifndef LASTLOG_FILE
- -#ifdef SVR4
- -#define LASTLOG_FILE "/var/adm/lastlog"
- -#else
- -#define LASTLOG_FILE "/usr/adm/lastlog"
- -#endif /* SVR4 */
- -#endif /* LASTLOG_FILE */
- -
- extern struct utmp utent;
- #ifdef SVR4
- extern struct utmpx utxent;
- @@ -73,7 +65,7 @@
- * If the file does not exist, don't create it.
- */
-
- - if ((fd = open (LASTLOG_FILE, O_RDWR)) == -1)
- + if ((fd = open (LASTFILE, O_RDWR)) == -1)
- return;
-
- /*
- --- login.1
- +++ login.1 1994/01/10 21:28:41
- @@ -79,7 +79,7 @@
- .SH Files
- /etc/utmp \- list of current login sessions
- .br
- -/etc/wtmp \- list of previous login sessions
- +/var/adm/wtmp \- list of previous login sessions
- .br
- /etc/passwd \- user account information
- .br
- --- login.defs
- +++ login.defs 1994/01/10 21:28:41
- @@ -1,8 +1,6 @@
- #
- # /etc/login.defs - Configuration control definitions for the login package.
- #
- -# @(#)login.defs 3.7 09:32:02 30 Apr 1993
- -#
- # Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
- # If unspecified, some arbitrary (and possibly incorrect) value will
- # be assumed. All other items are optional - if not specified then
- @@ -14,25 +12,25 @@
- #
- # Delay in seconds before being allowed another attempt after a login failure
- #
- -FAIL_DELAY 5
- +FAIL_DELAY 1
-
- #
- # Enable additional passwords upon dialup lines specified in /etc/dialups.
- #
- -DIALUPS_CHECK_ENAB yes
- +DIALUPS_CHECK_ENAB no
-
- #
- -# Enable logging and display of /usr/adm/faillog login failure info.
- +# Enable logging and display of /var/adm/faillog login failure info.
- #
- FAILLOG_ENAB yes
-
- #
- # Enable display of unknown usernames when login failures are recorded.
- #
- -LOG_UNKFAIL_ENAB yes
- +LOG_UNKFAIL_ENAB no
-
- #
- -# Enable logging and display of /usr/adm/lastlog login time info.
- +# Enable logging and display of /var/adm/lastlog login time info.
- #
- LASTLOG_ENAB yes
-
- @@ -44,12 +42,12 @@
- #
- # Enable additional checks upon password changes.
- #
- -OBSCURE_CHECKS_ENAB yes
- +OBSCURE_CHECKS_ENAB no
-
- #
- # Enable checking of time restrictions specified in /etc/porttime.
- #
- -PORTTIME_CHECKS_ENAB yes
- +PORTTIME_CHECKS_ENAB no
-
- #
- # Enable setting of ulimit, umask, and niceness from passwd gecos field.
- @@ -60,32 +58,26 @@
- # Enable "syslog" logging of su activity - in addition to sulog file logging.
- # SYSLOG_SG_ENAB does the same for newgrp and sg.
- #
- -SYSLOG_SU_ENAB no
- -SYSLOG_SG_ENAB no
- +SYSLOG_SU_ENAB yes
- +SYSLOG_SG_ENAB yes
-
- #
- # If defined, either full pathname of a file containing device names or
- # a ":" delimited list of device names. Root logins will be allowed only
- # upon these devices.
- #
- -CONSOLE /etc/consoles
- -#CONSOLE console:tty01:tty02:tty03:tty04
- +CONSOLE tty1:tty2:tty3:tty4:tty5:tty6
-
- #
- # If defined, all su activity is logged to this file.
- #
- -SULOG_FILE /usr/adm/sulog
- +SULOG_FILE /var/adm/sulog
-
- #
- # If defined, ":" delimited list of "message of the day" files to
- # be displayed upon login.
- #
- MOTD_FILE /etc/motd
- -#MOTD_FILE /etc/motd:/usr/lib/news/news-motd
- -
- -#
- -# If set to "yes" /etc/issue will be output before each login prompt
- -ISSUE_FILE_ENAB yes
-
- #
- # If defined, file which maps tty line to TERM environment parameter.
- @@ -96,14 +88,14 @@
- #
- # If defined, login failures will be logged here in a utmp format.
- #
- -FTMP_FILE /etc/ftmp
- +#FTMP_FILE /etc/ftmp
-
- #
- # If defined, name of file whose presence which will inhibit non-root
- # logins. The contents of this file should be a message indicating
- # why logins are inhibited.
- #
- -NOLOGINS_FILE /etc/nologins
- +NOLOGINS_FILE /etc/nologin
-
- #
- # If defined, the command name to display when running "su -". For
- @@ -118,8 +110,8 @@
- # Directory where mailboxes reside, _or_ name of file, relative to the
- # home directory. If you _do_ define both, MAIL_DIR takes precedence.
- #
- -MAIL_DIR /usr/spool/mail
- -#MAIL_FILE .mail
- +#MAIL_DIR /var/spool/mail
- +MAIL_FILE .mail
-
- #
- # If defined, file which inhibits all the usual chatter during the login
- @@ -133,6 +125,7 @@
- #
- # If defined, the presence of this value in an /etc/passwd "shell" field will
- # disable logins for that user, although "su" will still be allowed.
- +# This option is not implemented right now...
- #
- NOLOGIN_STR NOLOGIN
-
- @@ -140,19 +133,19 @@
- # If defined, either a TZ environment parameter spec or the
- # fully-rooted pathname of a file containing such a spec.
- #
- -ENV_TZ TZ=CST6CDT
- -#ENV_TZ /etc/tzname
- +#ENV_TZ TZ=CST6CDT
- +ENV_TZ /usr/lib/zoneinfo/localtime
-
- #
- # If defined, an HZ environment parameter spec.
- #
- -ENV_HZ HZ=50
- +ENV_HZ HZ=100
-
- #
- # *REQUIRED* The default PATH settings, for superuser and normal users.
- #
- -ENV_SUPATH PATH=/etc/local:/etc:/local/bin:/usr/bin:/bin
- -ENV_PATH PATH=/local/bin:/usr/bin:/bin
- +ENV_SUPATH PATH=/sbin:/usr/sbin:/etc:/usr/bin:/bin:/usr/X386/bin:/usr/TeX/bin
- +ENV_PATH PATH=/usr/bin:/bin:/usr/X386/bin:/usr/TeX/bin
-
- #
- # Terminal permissions
- @@ -182,7 +175,7 @@
- #
- # Prefix these values with "0" to get octal, "0x" to get hexadecimal.
- #
- -ERASECHAR 010
- +ERASECHAR 127
- KILLCHAR 025
- UMASK 022
- ULIMIT 2097152
- @@ -198,5 +191,5 @@
- PASS_MAX_DAYS 99999
- PASS_MIN_DAYS 0
- PASS_MIN_LEN 5
- -PASS_WARN_AGE 7
- +PASS_WARN_AGE 14
-
- --- newgrp.c
- +++ newgrp.c 1994/01/10 21:28:41
- @@ -12,6 +12,7 @@
- * no warrantee of any kind.
- */
-
- +#include "ngroups.h"
- #include <sys/types.h>
- #ifndef BSD
- #include <string.h>
- @@ -35,9 +36,9 @@
- static char sccsid[] = "@(#)newgrp.c 3.11 07:34:23 08 Apr 1993";
- #endif
-
- -#ifdef NGROUPS
- +#ifdef NGROUPS_MAX
- int ngroups;
- -gid_t groups[NGROUPS];
- +gid_t groups[NGROUPS_MAX];
- #endif
-
- char *getpass();
- @@ -60,7 +61,9 @@
- #ifdef USE_SYSLOG
- #include <syslog.h>
-
- +#ifndef __linux__
- /*VARARGS*/ int syslog();
- +#endif
-
- #ifndef LOG_WARN
- #define LOG_WARN LOG_WARNING
- @@ -248,7 +251,6 @@
- }
- }
- }
- -#ifdef NGROUPS
-
- /*
- * get the current users groupset. the new group will be
- @@ -257,10 +259,11 @@
- * group id's are set.
- */
-
- - ngroups = getgroups (0, 0);
- - if (ngroups > 0)
- + if (NGROUPS_MAX > 1) {
- + ngroups = getgroups (0, 0);
- + if (ngroups > 0)
- getgroups (ngroups, groups);
- -#endif
- + }
-
- /*
- * now we put her in the new group. the password file entry for
- @@ -425,7 +428,7 @@
- syslog (LOG_INFO, "user `%s' switched to group `%s'\n", name, group);
- #endif
- gid = grp->gr_gid;
- -#ifdef NGROUPS
- +#ifdef NGROUPS_MAX
-
- /*
- * i am going to try to add her new group id to her concurrent
- @@ -439,7 +442,7 @@
- break;
- }
- if (i == ngroups) {
- - if (ngroups == NGROUPS) {
- + if (ngroups == NGROUPS_MAX) {
- fprintf (stderr, "too many groups\n");
- } else {
- groups[ngroups++] = gid;
- --- newusers.8
- +++ newusers.8 1994/01/10 21:28:41
- @@ -33,15 +33,13 @@
- group is given, a new group will be created having this number.
- .IP "pw_dir"
- This field will be checked for existence as a directory and a new
- -directory will the same name created if it does not already exist.
- +directory with the same name will be created if it does not already exist.
- The ownership of the directory will be set to be that of the user
- being created or updated.
- .PP
- This command is intended to be used in a large system environment where
- many accounts are updated at a single time.
- .SH CAVEATS
- -The \fImkpasswd\fR command must be executed afterwards to update the
- -DBM password files.
- The input file must be protected since it contains unencrypted passwords.
- .SH SEE ALSO
- -mkpasswd(8), passwd(1), useradd(1)
- +passwd(1), useradd(1)
- --- ngroups.h
- +++ ngroups.h 1994/01/10 21:28:41
- @@ -0,0 +1,15 @@
- +#include <unistd.h>
- +
- +#ifdef _POSIX_VERSION
- +#include <limits.h>
- +#if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
- +#undef NGROUPS_MAX
- +#define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
- +#endif /* !NGROUPS_MAX */
- +
- +#else /* not _POSIX_VERSION */
- +#include <sys/param.h>
- +#if !defined(NGROUPS_MAX) && defined(NGROUPS)
- +#define NGROUPS_MAX NGROUPS
- +#endif /* not NGROUPS_MAX and NGROUPS */
- +#endif /* not _POSIX_VERSION */
- --- obscure.c
- +++ obscure.c 1994/01/10 21:28:41
- @@ -80,8 +80,10 @@
- char *FascistCheck();
- #endif
-
- +#if 0
- if (old[0] == '\0')
- return (1);
- +#endif
-
- if ( strlen(new) < getdef_num("PASS_MIN_LEN", 0) ) {
- printf ("Too short. ");
- @@ -114,7 +116,7 @@
- if (similiar (newmono, oldmono)) /* jumbled version */
- return (0);
-
- - if (simple (old, new)) /* keyspace size */
- + if (simple (new, old)) /* keyspace size */
- return (0);
-
- strcpy (wrapped, oldmono);
- @@ -143,7 +145,7 @@
- */
-
- /*ARGSUSED*/
- -int palindrome (old, new)
- +int palindrome (new, old)
- char *old;
- char *new;
- {
- @@ -164,7 +166,7 @@
- */
-
- /*ARGSUSED*/
- -int similiar (old, new)
- +int similiar (new, old)
- char *old;
- char *new;
- {
- @@ -187,7 +189,7 @@
- */
-
- /*ARGSUSED*/
- -int simple (old, new)
- +int simple (new, old)
- char *old;
- char *new;
- {
- --- passwd.1
- +++ passwd.1 1994/01/10 21:28:41
- @@ -70,15 +70,15 @@
- Both entries are require to match in order for the password
- to be changed.
- .SS Group passwords
- -When the \fB-g\f option is used, the password for the named
- +When the \fB-g\fR option is used, the password for the named
- group is changed.
- The user must either be the super user, or a group administrator
- for the named group.
- The current group password is not prompted for.
- -The \fB-r\f option is used with the \fB-g\f option to remove
- +The \fB-r\fR option is used with the \fB-g\fR option to remove
- the current password from the named group.
- This allows group access to all members.
- -The \fB-R\f option is used with the \fB-g\f option to restrict
- +The \fB-R\fR option is used with the \fB-g\fR option to restrict
- the named group for all users.
- .SS Password expiry information
- The password aging information may be changed by the super
- --- passwd.c
- +++ passwd.c 1994/01/10 21:28:41
- @@ -295,6 +295,10 @@
- char *passwd;
- char *result;
- {
- + if (! string || ! *string) {
- + while (*passwd)
- + *result++ = *passwd++;
- + } else {
- while (*string) {
- if (string[0] == ';') {
- *result++ = *string++;
- @@ -309,6 +313,7 @@
- string++;
- }
- }
- + }
- *result = '\0';
- }
-
- @@ -361,6 +366,8 @@
- strcpy (orig, clear);
- bzero (cipher, strlen (cipher));
- bzero (clear, strlen (clear));
- + } else {
- + orig[0] = '\0';
- }
-
- /*
- @@ -371,7 +378,7 @@
- */
-
- printf (NEWPASSMSG, getdef_num ("PASS_MIN_LEN", 5));
- - for (i = 0;i < 3;i++) {
- + for (i = 0;i < 5;i++) {
- if (! (cp = getpass (NEWPASS))) {
- bzero (orig, sizeof orig);
- return -1;
- @@ -395,7 +402,7 @@
- }
- bzero (orig, sizeof orig);
-
- - if (i == 3) {
- + if (i == 5) {
- bzero (pass, sizeof pass);
- return -1;
- }
- --- pwauth.c
- +++ pwauth.c 1994/01/10 21:28:41
- @@ -38,6 +38,9 @@
- * compared.
- */
-
- +char *getpass ();
- +char *pw_encrypt ();
- +
- int
- _old_auth (cipher, user, reason, input)
- char *cipher;
- --- pwauth.h
- +++ pwauth.h 1994/01/10 21:28:41
- @@ -14,11 +14,7 @@
- * @(#)pwauth.h 3.2 17:40:49 01 May 1993
- */
-
- -#if __STDC__
- -int pw_auth (char * program, char * user, int flag, char * input);
- -#else
- int pw_auth ();
- -#endif
-
- /*
- * Local access
- --- pwck.c
- +++ pwck.c 1994/01/10 21:28:41
- @@ -75,7 +75,7 @@
- char *CANTUPDATE = "%s: cannot update file %s\n";
- char *CHANGES = "%s: the files have been updated; run mkpasswd\n";
- char *NOCHANGES = "%s: no changes\n";
- -char *NOGROUP = "user %s: no group %d\n";
- +char *_NOGROUP = "user %s: no group %d\n"; /* NOGROUP is a macro in linux */
- char *NOHOME = "user %s: directory %s does not exist\n";
- char *NOSHELL = "user %s: program %s does not exist\n";
- char *BADENTRY = "invalid password file entry\n";
- @@ -401,7 +401,7 @@
- * No primary group, just give a warning
- */
-
- - printf (NOGROUP, pwd->pw_name, pwd->pw_gid);
- + printf (_NOGROUP, pwd->pw_name, pwd->pw_gid);
- errors++;
- }
-
- --- setup.c
- +++ setup.c 1994/01/10 21:28:41
- @@ -12,6 +12,7 @@
- * no warrantee of any kind.
- */
-
- +#include "ngroups.h"
- #include <sys/types.h>
- #include <utmp.h>
-
- @@ -151,7 +152,7 @@
-
- /*
- * See if the GECOS field contains values for NICE, UMASK or ULIMIT.
- - * If this feature is enabled in /etc/login.defs, we makes those
- + * If this feature is enabled in /etc/login.defs, we make those
- * values the defaults for this login session.
- */
-
- @@ -198,14 +199,13 @@
- #endif
- exit (errno);
- }
- -#if NGROUPS > 1
-
- /*
- * For systems which support multiple concurrent groups, go get
- * the group set from the /etc/group file.
- */
-
- - if (initgroups (info->pw_name, info->pw_gid) == -1) {
- + if (NGROUPS_MAX > 1 && initgroups (info->pw_name, info->pw_gid) == -1) {
- puts ("initgroups failure");
- #ifdef USE_SYSLOG
- syslog (LOG_WARN, "initgroups failed for user `%s'\n",
- @@ -214,7 +214,6 @@
- #endif
- exit (errno);
- }
- -#endif /* NGROUPS > 1 */
-
- /*
- * Set the real UID to the UID value in the password file.
- --- shadow.4
- +++ shadow.4 1994/01/10 21:28:41
- @@ -71,6 +71,4 @@
- su(1),
- sulogin(1M),
- shadow(3),
- -passwd(4),
- -pwconv(8),
- -pwunconv(8)
- +passwd(4)
- --- shadow.c
- +++ shadow.c 1994/01/10 21:28:41
- @@ -9,9 +9,9 @@
- * distribution media.
- */
-
- -#include "shadow.h"
- #include "config.h"
- #include <stdio.h>
- +#include "shadow.h"
-
- #ifdef STDLIB_H
- #include <stdlib.h>
- @@ -201,9 +201,6 @@
-
- struct spwd
- *getspnam (name)
- -#if __STDC__
- -const
- -#endif
- char *name;
- {
- struct spwd *sp;
- --- smain.c
- +++ smain.c 1994/01/10 21:28:41
- @@ -48,7 +48,9 @@
- #ifdef USE_SYSLOG
- #include <syslog.h>
-
- +#ifndef __linux__
- /*VARARGS*/ int syslog();
- +#endif
-
- #ifndef LOG_WARN
- #define LOG_WARN LOG_WARNING
- @@ -115,9 +117,11 @@
- extern char *tz ();
- extern char *pw_encrypt();
- extern int pw_auth();
- +#ifndef __linux__
- extern struct passwd *getpwuid ();
- extern struct passwd *getpwnam ();
- extern struct spwd *getspnam ();
- +#endif
- extern char *getdef_str();
- extern int getdef_bool();
- extern char **environ;
- --- sppwd.c
- +++ sppwd.c 1994/01/10 21:28:41
- @@ -0,0 +1,58 @@
- +#undef SHADOW_PWD
- +#include <stdio.h>
- +#include <sys/types.h>
- +#include <shadow.h>
- +#include <pwd.h>
- +#include <grp.h>
- +#include <unistd.h>
- +
- +struct passwd *_spsubspwd(struct passwd *pw)
- +{
- + struct spwd *spw;
- + if (pw)
- + { spw = getspnam(pw->pw_name);
- + if (spw)
- + pw->pw_passwd = spw->sp_pwdp;
- + }
- + return(pw);
- +}
- +
- +struct group *_spsubsgrp(struct group *gr)
- +{
- + struct sgrp *sgr;
- + if (gr)
- + { sgr = getsgnam(gr->gr_name);
- + if (sgr)
- + gr->gr_passwd = sgr->sg_passwd;
- + }
- + return(gr);
- +}
- +
- +struct passwd *_spgetpwuid(uid_t uid) { return(_spsubspwd(getpwuid(uid))); }
- +
- +struct passwd *_spgetpwnam(char *name) { return(_spsubspwd(getpwnam(name))); }
- +
- +struct passwd *_spgetpwent(void) { return(_spsubspwd(getpwent())); }
- +
- +struct passwd *_spfgetpwent(FILE *F) { return(_spsubspwd(fgetpwent(F))); }
- +
- +struct group *_spgetgrgid(gid_t gid) { return(_spsubsgrp(getgrgid(gid))); }
- +
- +struct group *_spgetgrnam(char *name) { return(_spsubsgrp(getgrnam(name))); }
- +
- +struct group *_spgetgrent(void) { return(_spsubsgrp(getgrent())); }
- +
- +struct group *_spfgetgrent(FILE *F) { return(_spsubsgrp(fgetgrent(F))); }
- +
- +char *_spcrypt(char clear[], char salt[] )
- +{
- + static char buffer[30];
- + char *cp = crypt (clear, salt);
- + strcpy (buffer, cp);
- + if (strlen (clear) > 8) {
- + cp = crypt (clear + 8, salt);
- + strcat (buffer, cp + 2);
- + }
- + return(buffer);
- +}
- +
- --- sulogin.c
- +++ sulogin.c 1994/01/10 21:28:42
- @@ -102,6 +102,7 @@
- #define RETRIES 3
- #endif
-
- +SIGTYPE
- catch (sig)
- int sig;
- {
- @@ -232,7 +233,7 @@
- strcpy (pass, cp);
-
- if (pwent.pw_name && pwent.pw_passwd[0] == '@') {
- - if (pw_auth (pwent.pw_passwd + 1, name, PW_LOGIN)) {
- + if (pw_auth (pwent.pw_passwd + 1, name, PW_LOGIN, "")) {
- #ifdef USE_SYSLOG
- syslog (LOG_WARN,
- "Incorrect root authentication");
- --- tz.c
- +++ tz.c 1994/01/10 21:28:42
- @@ -27,7 +27,7 @@
- char *fname;
- {
- FILE *fp;
- - static char tzbuf[64];
- + static char tzbuf[1024];
-
- if ((fp = fopen(fname,"r")) == NULL)
- return "TZ=CST6CDT";
- --- useradd.c
- +++ useradd.c 1994/01/10 21:28:42
- @@ -16,6 +16,7 @@
- static char sccsid[] = "@(#)useradd.c 3.14 08:20:53 23 Aug 1993";
- #endif
-
- +#include "ngroups.h"
- #include "config.h"
- #include <sys/types.h>
- #include <sys/stat.h>
- @@ -59,10 +60,6 @@
- char def_file[] = "/usr/sadm/defadduser";
- #else
- char def_file[] = "/etc/default/useradd";
- -#endif
- -
- -#ifndef NGROUPS_MAX
- -#define NGROUPS_MAX 64
- #endif
-
- #if !defined(MDY_DATE) && !defined(DMY_DATE) && !defined(YMD_DATE)
- --- userdel.c
- +++ userdel.c 1994/01/10 21:28:42
- @@ -47,10 +47,6 @@
- #endif
- #endif
-
- -#ifndef NGROUPS_MAX
- -#define NGROUPS_MAX 64
- -#endif
- -
- #if defined(DIR_XENIX) || defined(DIR_BSD) || defined(DIR_SYSV)
- #define DIR_ANY
- #endif
- @@ -377,7 +373,7 @@
- struct spwd *spwd;
-
- if ((spwd = spw_locate (user_name)) && spwd->sp_pwdp[0] == '@') {
- - if (pw_auth (spwd->sp_pwdp + 1, user_name, PW_DELETE)) {
- + if (pw_auth (spwd->sp_pwdp + 1, user_name, PW_DELETE, "")) {
- #ifdef USE_SYSLOG
- syslog (LOG_ERR,
- "failed deleting auth `%s' for user `%s'\n",
- @@ -397,7 +393,7 @@
- }
- #endif /* SHADOWPWD */
- if ((pwd = pw_locate (user_name)) && pwd->pw_passwd[0] == '@') {
- - if (pw_auth (pwd->pw_passwd + 1, user_name, PW_DELETE)) {
- + if (pw_auth (pwd->pw_passwd + 1, user_name, PW_DELETE, "")) {
- #ifdef USE_SYSLOG
- syslog (LOG_ERR,
- "failed deleting auth `%s' for user `%s'\n",
- @@ -520,22 +516,22 @@
- {
- char buf[BUFSIZ];
-
- -#ifdef HAS_CRONTAB
- +#ifdef CRONTAB_REM
-
- /*
- * Remove the crontab if there is one.
- */
-
- - sprintf (buf, "/bin/crontab -r -u %s", user);
- + sprintf (buf, CRONTAB_REM, user);
- system (buf);
- #endif
- -#ifdef HAS_ATRM
- +#ifdef ATRUN_REM
-
- /*
- * Remove any at jobs as well.
- */
-
- - sprintf (buf, "/bin/atrm -f %s", user);
- + sprintf (buf, ATRUN_REM, user);
- system (buf);
- #endif
- }
- --- usermod.c
- +++ usermod.c 1994/01/10 21:28:42
- @@ -16,6 +16,7 @@
- static char sccsid[] = "@(#)usermod.c 3.16 08:11:52 07 May 1993";
- #endif
-
- +#include "ngroups.h"
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdio.h>
- @@ -48,10 +49,6 @@
- #endif
- #endif
-
- -#ifndef NGROUPS_MAX
- -#define NGROUPS_MAX 64
- -#endif
- -
- #if defined(DIR_XENIX) || defined(DIR_BSD) || defined(DIR_SYSV)
- #define DIR_ANY
- #endif
- @@ -1619,7 +1616,7 @@
- * anything to just leave it be.
- */
-
- - if ((fd = open ("/usr/adm/lastlog", O_RDWR)) != -1) {
- + if ((fd = open (LASTFILE, O_RDWR)) != -1) {
- lseek (fd, (long) user_id * sizeof ll, 0);
- if (read (fd, &ll, sizeof ll) == sizeof ll) {
- lseek (fd, (long) user_newid * sizeof ll, 0);
-