home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: jfh@rpp386.cactus.org (John F. Haugh II)
- Subject: v39i078: shadow - Shadow Password Suite, v3.3, Patch01
- Message-ID: <1993Sep8.115808.19554@sparky.sterling.com>
- X-Md4-Signature: ed2c21933c033660bbe0825a72ce18c6
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Wed, 8 Sep 1993 11:58:08 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: jfh@rpp386.cactus.org (John F. Haugh II)
- Posting-number: Volume 39, Issue 78
- Archive-name: shadow/patch01
- Environment: UNIX
- Patch-To: shadow: Volume 38, Issue 120-133
-
- This patch brings the Shadow Password Suite from version 3.3.0 to 3.3.1.
- It corrects a deficiency in BSD-based systems which lack the getut*()
- functions for accessing the /etc/utmp file. This affects SunOS 4.1.x in
- that certain commands will not bind with the getutent() library routine.
- --
- Prereq: "3.3.0"
- Index: patchlevel.h
- *** patchlevel.h.old Thu Aug 26 08:05:43 1993
- --- patchlevel.h Thu Aug 26 08:05:42 1993
- ***************
- *** 25,32 ****
- * Bug fixes for SVR4
- * 07/23/93 3.3.0 patchlevel 23
- * New baseline release
- */
-
- #define RELEASE 3
- ! #define PATCHLEVEL 23
- ! #define VERSION "3.3.0"
- --- 25,34 ----
- * Bug fixes for SVR4
- * 07/23/93 3.3.0 patchlevel 23
- * New baseline release
- + * 08/23/93 3.3.1 patchlevel 24
- + * Bug fixes for SunOS 4.1.1
- */
-
- #define RELEASE 3
- ! #define PATCHLEVEL 24
- ! #define VERSION "3.3.1"
- Index: Makefile
- *** Makefile.old Thu Aug 26 08:05:44 1993
- --- Makefile Thu Aug 26 08:05:44 1993
- ***************
- *** 11,19 ****
- # This software is provided on an AS-IS basis and the author makes
- # no warrantee of any kind.
- #
- ! # @(#)Makefile 3.25.1.18 09:57:59 - Shadow password system
- #
- ! # @(#)Makefile 3.25.1.18 09:57:59 08 Aug 1993
- #
- SHELL = /bin/sh
-
- --- 11,19 ----
- # This software is provided on an AS-IS basis and the author makes
- # no warrantee of any kind.
- #
- ! # @(#)Makefile 3.25.1.19 07:59:43 - Shadow password system
- #
- ! # @(#)Makefile 3.25.1.19 07:59:43 26 Aug 1993
- #
- SHELL = /bin/sh
-
- ***************
- *** 23,29 ****
- # The version with the utilities added was release 2. It is now unsupported.
- # The version with database-like file access is release 3.
- RELEASE = 3
- ! VERSION = ver3.3.0
- GFLAGS = -n $(VERSION)
- GET = get_file
-
- --- 23,29 ----
- # The version with the utilities added was release 2. It is now unsupported.
- # The version with database-like file access is release 3.
- RELEASE = 3
- ! VERSION = ver3.3.1
- GFLAGS = -n $(VERSION)
- GET = get_file
-
- ***************
- *** 193,199 ****
-
- FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
-
- ! FILES3 = chfn.c chsh.c smain.c faillog.c pwconv.c shadow.c pwck.c
-
- FILES4 = gpmain.c chage.c pwent.c valid.c setup.c entry.c ttytype.c port.h
-
- --- 193,199 ----
-
- FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
-
- ! FILES3 = chfn.c chsh.c smain.c faillog.c pwconv.c shadow.c pwck.c utent.c
-
- FILES4 = gpmain.c chage.c pwent.c valid.c setup.c entry.c ttytype.c port.h
-
- Index: Makefile.sun4
- *** Makefile.sun4.old Thu Aug 26 08:05:46 1993
- --- Makefile.sun4 Thu Aug 26 08:05:46 1993
- ***************
- *** 11,19 ****
- # This software is provided on an AS-IS basis and the author makes
- # no warrantee of any kind.
- #
- ! # @(#)Makefile.sun4 3.11 08:11:03 - Shadow password system (SunOS 4.1.1 version)
- #
- ! # @(#)Makefile.sun4 3.11 08:11:03 19 Jul 1993
- #
- SHELL = /bin/sh
-
- --- 11,19 ----
- # This software is provided on an AS-IS basis and the author makes
- # no warrantee of any kind.
- #
- ! # @(#)Makefile.sun4 3.12 08:00:07 - Shadow password system (SunOS 4.1.1 version)
- #
- ! # @(#)Makefile.sun4 3.12 08:00:07 26 Aug 1993
- #
- SHELL = /bin/sh
-
- ***************
- *** 148,154 ****
- spdbm.c dpmain.c gshadow.c gsdbm.c gspack.c sgroupio.c useradd.c \
- userdel.c patchlevel.h usermod.c copydir.c mkrmdir.c groupadd.c \
- 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 \
- age.c id.c
- --- 148,154 ----
- spdbm.c dpmain.c gshadow.c gsdbm.c gspack.c sgroupio.c useradd.c \
- userdel.c patchlevel.h usermod.c copydir.c mkrmdir.c groupadd.c \
- groupdel.c groupmod.c tz.c console.c hushed.c getdef.c scologin.c \
- ! logoutd.c groups.c pwauth.c lockpw.c chowndir.c utent.c
-
- FILES1 = README patchlevel.h newgrp.c Makefile config.h pwunconv.c obscure.c \
- age.c id.c
- ***************
- *** 155,161 ****
-
- FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
-
- ! FILES3 = chfn.c chsh.c smain.c faillog.c pwconv.c shadow.c pwck.c
-
- FILES4 = gpmain.c chage.c pwent.c valid.c setup.c entry.c ttytype.c port.h
-
- --- 155,161 ----
-
- FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
-
- ! FILES3 = chfn.c chsh.c smain.c faillog.c pwconv.c shadow.c pwck.c utent.c
-
- FILES4 = gpmain.c chage.c pwent.c valid.c setup.c entry.c ttytype.c port.h
-
- ***************
- *** 224,230 ****
- libshadow.a(shadow.o) \
- libshadow.a(shadowio.o) \
- libshadow.a(sppack.o) \
- ! libshadow.a(lockpw.o)
- $(RANLIB) libshadow.a
-
- libsec: $(LIBSEC)(shadow.o)
- --- 224,231 ----
- libshadow.a(shadow.o) \
- libshadow.a(shadowio.o) \
- libshadow.a(sppack.o) \
- ! libshadow.a(lockpw.o) \
- ! libshadow.a(utent.o)
- $(RANLIB) libshadow.a
-
- libsec: $(LIBSEC)(shadow.o)
- ***************
- *** 595,600 ****
- --- 596,602 ----
- libshadow.a(port.o): port.h
- libshadow.a(rad64.o): config.h
- libshadow.a(lockpw.o):
- + libshadow.a(utent.o): config.h
-
- clean:
- -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir pwd.h
- Index: useradd.1
- *** useradd.1.old Thu Aug 26 08:05:47 1993
- --- useradd.1 Thu Aug 26 08:05:47 1993
- ***************
- *** 10,16 ****
- .\" This software is provided on an AS-IS basis and the author makes
- .\" no warrantee of any kind.
- .\"
- ! .\" @(#)useradd.1 3.4 07:58:25 06 May 1993
- .\"
- .TH USERADD 1M
- .SH NAME
- --- 10,16 ----
- .\" This software is provided on an AS-IS basis and the author makes
- .\" no warrantee of any kind.
- .\"
- ! .\" @(#)useradd.1 3.5 07:45:38 26 Aug 1993
- .\"
- .TH USERADD 1M
- .SH NAME
- ***************
- *** 35,40 ****
- --- 35,41 ----
- [ \fB-b\fI default_home\fR ]
- [ \fB-f\fI default_inactive\fR ]
- [ \fB-e\fI default_exiration\fR ]
- + [ \fB-s\fI default_shell\fR ]
- .SH DESCRIPTION
- .SS Creating New Users
- When invoked without the \fB-D\fR option, the \fIuseradd\fR command
- ***************
- *** 121,126 ****
- --- 122,130 ----
- The group name or ID for a new user's initial group.
- The named group must exist, and a numerical group ID must have
- an existing entry .
- + .IP "\fB-s \fIdefault_shell\fR"
- + The name of the new user's login shell.
- + The named program will be used for all future new user accounts.
- .PP
- If no options are specified, \fIuseradd\fR displays the current
- default values.
- Index: useradd.c
- *** useradd.c.old Thu Aug 26 08:05:49 1993
- --- useradd.c Thu Aug 26 08:05:49 1993
- ***************
- *** 13,19 ****
- */
-
- #ifndef lint
- ! static char sccsid[] = "@(#)useradd.c 3.13 07:59:56 06 May 1993";
- #endif
-
- #include "config.h"
- --- 13,19 ----
- */
-
- #ifndef lint
- ! static char sccsid[] = "@(#)useradd.c 3.14 08:20:53 23 Aug 1993";
- #endif
-
- #include "config.h"
- ***************
- *** 745,753 ****
- #endif
- if (! out_shell)
- #ifdef SVR4
- ! fprintf (ofp, "defshell=%d\n", def_shell);
- #else
- ! fprintf (ofp, "SHELL=%d\n", def_shell);
- #endif
- if (! out_skel)
- #ifdef SVR4
- --- 745,753 ----
- #endif
- if (! out_shell)
- #ifdef SVR4
- ! fprintf (ofp, "defshell=%s\n", def_shell);
- #else
- ! fprintf (ofp, "SHELL=%s\n", def_shell);
- #endif
- if (! out_skel)
- #ifdef SVR4
- ***************
- *** 860,874 ****
- fprintf (stderr, "%s: unknown group %s\n", Prog, list);
- errors++;
- }
-
- /*
- * Add the GID value from the group file to the user's
- * list of groups.
- */
-
- user_groups[user_ngroups++] = grp->gr_gid;
- -
- - list = cp;
- } while (list);
-
- /*
- --- 860,885 ----
- fprintf (stderr, "%s: unknown group %s\n", Prog, list);
- errors++;
- }
- + list = cp;
-
- + #ifdef USE_NIS
- /*
- + * Don't add this group if they are an NIS group. Tell
- + * the user to go to the server for this group.
- + */
- +
- + if (__isgrNIS ()) {
- + fprintf (stderr, "%s: group `%s' is a NIS group.\n",
- + Prog, grp->gr_name);
- + continue;
- + }
- + #endif
- + /*
- * Add the GID value from the group file to the user's
- * list of groups.
- */
-
- user_groups[user_ngroups++] = grp->gr_gid;
- } while (list);
-
- /*
- ***************
- *** 967,973 ****
- --- 978,986 ----
- pwent->pw_uid = user_id;
- pwent->pw_gid = user_gid;
- pwent->pw_gecos = user_comment;
- + #ifdef ATT_COMMENT
- pwent->pw_comment = "";
- + #endif
- pwent->pw_dir = user_home;
- pwent->pw_shell = user_shell;
- }
- ***************
- *** 1349,1355 ****
- def_expire = strtoday (optarg);
- else {
- #ifdef SHADOWPWD
- ! user_expire = strtoday (optarg);
- #ifdef ITI_AGING
- user_expire *= DAY;
- #endif
- --- 1362,1368 ----
- def_expire = strtoday (optarg);
- else {
- #ifdef SHADOWPWD
- ! user_expire = atoi (optarg);
- #ifdef ITI_AGING
- user_expire *= DAY;
- #endif
- ***************
- *** 1414,1419 ****
- --- 1427,1433 ----
- }
- sflg++;
- strncpy (user_shell, optarg, BUFSIZ);
- + strncpy (def_shell, user_shell, BUFSIZ);
- break;
- case 'u':
- uflg++;
- Index: utent.c
- *** /tmp/da000W_ Thu Aug 26 07:55:01 1993
- --- utent.c Thu Aug 26 08:05:50 1993
- ***************
- *** 0 ****
- --- 1,107 ----
- + /*
- + * Copyright 1993, John F. Haugh II
- + * All rights reserved.
- + *
- + * Permission is granted to copy and create derivative works for any
- + * non-commercial purpose, provided this copyright notice is preserved
- + * in all copies of source code, or included in human readable form
- + * and conspicuously displayed on all copies of object code or
- + * distribution media.
- + *
- + * This software is provided on an AS-IS basis and the author makes
- + * no warrantee of any kind.
- + */
- +
- + #include "config.h"
- +
- + #ifdef NEED_UTENT
- +
- + #include <stdio.h>
- + #include <fcntl.h>
- + #include <utmp.h>
- +
- + #ifndef lint
- + static char sccsid[] = "@(#)utent.c 1.1 08:19:29 23 Aug 1993";
- + #endif
- +
- + #ifndef UTMP_FILE
- + #define UTMP_FILE "/etc/utmp"
- + #endif
- +
- + static int utmp_fd = -1;
- + static struct utmp utmp_buf;
- + static struct utmp last_utmp_buf;
- +
- + /*
- + * setutent - open or rewind the utmp file
- + */
- +
- + void
- + setutent ()
- + {
- + if (utmp_fd == -1)
- + if ((utmp_fd = open (UTMP_FILE, O_RDWR)) == -1)
- + utmp_fd = open (UTMP_FILE, O_RDONLY);
- +
- + if (utmp_fd != -1)
- + lseek (utmp_fd, 0L, 0);
- + }
- +
- + /*
- + * endutent - close the utmp file
- + */
- +
- + void
- + endutent ()
- + {
- + if (utmp_fd != -1)
- + close (utmp_fd);
- +
- + utmp_fd = -1;
- + }
- +
- + /*
- + * getutent - get the next record from the utmp file
- + */
- +
- + struct utmp *
- + getutent ()
- + {
- + if (utmp_fd == -1)
- + setutent ();
- +
- + if (utmp_fd == -1)
- + return 0;
- +
- + if (read (utmp_fd, &utmp_buf, sizeof utmp_buf) != sizeof utmp_buf)
- + return 0;
- +
- + last_utmp_buf = utmp_buf;
- + return &utmp_buf;
- + }
- +
- + /*
- + * getutline - get the utmp entry matching ut_line
- + */
- +
- + struct utmp *
- + getutline (utent)
- + #if defined(__STDC__)
- + const struct utmp *utent;
- + #else
- + struct utmp *utent;
- + #endif
- + {
- + struct utmp save;
- + struct utmp *new;
- +
- + save = *utent;
- + while (new = getutent ())
- + if (strncmp (new->ut_line, save.ut_line, sizeof new->ut_line))
- + continue;
- + else
- + return new;
- +
- + return (struct utmp *) 0;
- + }
- + #endif
- --
- John F. Haugh II [ PGP 2.1 ] !'s: ...!cs.utexas.edu!rpp386!jfh
- Ma Bell: (512) 251-2151 [ DoF #17 ] [ PADI ] @'s: jfh@rpp386.cactus.org
- "The only people who will pay more income taxes are the wealthiest 2 percent,
- those living in households making over $200,000 a year." -- Bill Clinton
-
- exit 0 # Just in case...
-