home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume28 / shadow / patch03 < prev    next >
Text File  |  1992-02-02  |  43KB  |  1,451 lines

  1. Newsgroups: comp.sources.misc
  2. From: jfh@rpp386.cactus.org (John F Haugh II)
  3. Subject:  v28i010:  shadow - Shadow Login Suite, Patch03
  4. Message-ID: <1992Feb2.042319.27986@sparky.imd.sterling.com>
  5. X-Md4-Signature: 6463ab6ff7db32231731c54060320de3
  6. Date: Sun, 2 Feb 1992 04:23:19 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jfh@rpp386.cactus.org (John F Haugh II)
  10. Posting-number: Volume 28, Issue 10
  11. Archive-name: shadow/patch03
  12. Environment: UNIX
  13. Patch-To: shadow: Volume 26, Issue 54-64
  14.  
  15. This is the promised patch for SunOS 4.1.1 changes.  It includes a number of
  16. files ending in .sun4 which should be read if you are using that O/S.  A few
  17. non-SunOS related changes were made also, so you must apply this patch even
  18. if you are not using SunOS 4.1.1.  You must have the 3.1.2 version of source
  19. code to make these changes.  You will have version 3.1.3 after applying this
  20. patch.
  21.  
  22. The changes were -
  23.  
  24.     Added rules to create SunOS related files
  25.     Added credit for SVR4 related work
  26.     Added #defines to support sulogin RUNLEVEL changes
  27.     Added support for MAIL_FILE configuration option
  28.     Added documentation for passwd command options
  29.     Added documentation for new sulogin options
  30.     Created Makefile.sun4 file
  31.     Created README.sun4 file
  32.     Created config.h.sun4 file
  33.     Fixed utmp file handling by login
  34.  
  35. Patch and enjoy!
  36.  
  37. Prereq: "3.1.2"
  38. Index: patchlevel.h
  39. *** rel3/patchlevel.h    Mon Jan 20 10:16:45 1992
  40. --- patchlevel.h    Mon Jan 20 10:17:08 1992
  41. ***************
  42. *** 13,20 ****
  43.    *        Added "login.defs" to Makefile
  44.    *    12/02/91    3.1.2    patchlevel 15
  45.    *        Bugs found by users
  46.    */
  47.   
  48.   #define    RELEASE        3
  49. ! #define    PATCHLEVEL    15
  50. ! #define    VERSION        "3.1.2"
  51. --- 13,22 ----
  52.    *        Added "login.defs" to Makefile
  53.    *    12/02/91    3.1.2    patchlevel 15
  54.    *        Bugs found by users
  55. +  *    12/28/91    3.1.3    patchlevel 16
  56. +  *        Changes for SunOS 4.1.1
  57.    */
  58.   
  59.   #define    RELEASE        3
  60. ! #define    PATCHLEVEL    16
  61. ! #define    VERSION        "3.1.3"
  62. Index: Makefile.sun4
  63. *** /dev/null    Mon Jan 20 10:07:06 1992
  64. --- Makefile.sun4    Mon Jan 20 10:17:11 1992
  65. ***************
  66. *** 0 ****
  67. --- 1,551 ----
  68. + #
  69. + # Copyright 1988,1989,1990,1991, John F. Haugh II
  70. + # All rights reserved.
  71. + #
  72. + # Permission is granted to copy and create derivative works for any
  73. + # non-commercial purpose, provided this copyright notice is preserved
  74. + # in all copies of source code, or included in human readable form
  75. + # and conspicuously displayed on all copies of object code or
  76. + # distribution media.
  77. + #
  78. + #    @(#)Makefile.sun4    3.1    19:49:25  - Shadow password system (SunOS 4.1.1 version)
  79. + #
  80. + #    @(#)Makefile.sun4    3.1    19:49:25    12/28/91
  81. + #
  82. + SHELL = /bin/sh
  83. + #
  84. + # Set this flag to decide what level of code "get" returns.
  85. + # The base USENET release was release 1.  It is no longer supported.
  86. + # The version with the utilities added was release 2.
  87. + # The version with database-like file access is release 3.
  88. + RELEASE = 3
  89. + GFLAGS = -t -r$(RELEASE)
  90. + # SunOS 4.1.1 uses /usr/bin
  91. + LOGINDIR = /usr/bin
  92. + # SunOS 4.1.1 requires no extra libraries
  93. + NDIR = 
  94. + # Pick your favorite C compiler and tags command
  95. + CC = /bin/cc
  96. + TAGS = ctags
  97. + # SunOS 4.1.1 is SUN4
  98. + OS = -DSUN4
  99. + # SunOS 4.1.1 uses ranlib
  100. + RANLIB = ranlib
  101. + # Configuration Flags
  102. + #
  103. + #    LIBS - system libraries
  104. + #        -lsocket - needed for TCP/IP and possibly SYSLOG
  105. + #        -ldbm or -lndbm - needed for DBM support
  106. + #        -lcrypt - needed for SCO crypt() functions
  107. + #    CFLAGS - C compiler flags
  108. + #        -DLAI_TCP - needed for SCO Xenix Lachman TCP/IP
  109. + # Flags for SunOS 4.1.1
  110. + CFLAGS = -O2 $(OS)
  111. + LIBS =
  112. + LDFLAGS = 
  113. + # Names for root user and group, and bin user and group.  See your
  114. + # /etc/passwd and /etc/group files.
  115. + RUID = root
  116. + RGID = wheel
  117. + BUID = bin
  118. + BGID = bin
  119. + # Rules for .L (lint) files.
  120. + .SUFFIXES: .L
  121. + LINT = lint
  122. + LINTFLAGS = $(OS) -Dlint
  123. + .c.L:
  124. +     $(LINT) -pxu $(LINTFLAGS) $*.c > $*.L
  125. + LOBJS = lmain.o login.o env.o valid.o setup.o shell.o age.o \
  126. +     utmp.o sub.o mail.o motd.o log.o ttytype.o failure.o \
  127. +     tz.o console.o hushed.o
  128. + LSRCS = lmain.c login.c env.c valid.c setup.c shell.c age.c \
  129. +     utmp.c sub.c mail.c motd.c log.c ttytype.c failure.c \
  130. +     tz.c console.c hushed.c
  131. + SOBJS = smain.o env.o entry.o susetup.o shell.o \
  132. +     sub.o mail.o motd.o sulog.o age.o tz.o hushed.o
  133. + SSRCS = smain.c env.c entry.c setup.c shell.c \
  134. +     pwent.c sub.c mail.c motd.c sulog.c shadow.c age.c pwpack.c rad64.c \
  135. +     tz.c hushed.c
  136. + POBJS = passwd.o obscure.o
  137. + PSRCS = passwd.c obscure.c
  138. + GPSRCS = gpmain.c
  139. + GPOBJS = gpmain.o
  140. + PWOBJS = pwconv.o
  141. + PWSRCS = pwconv.c pwent.c shadow.c pwpack.c rad64.c
  142. + PWUNOBJS = pwunconv.o
  143. + PWUNSRCS = pwunconv.c pwent.c shadow.c pwpack.c rad64.c
  144. + SULOGOBJS = sulogin.o entry.o env.o age.o setup.o \
  145. +     valid.o shell.o tz.o
  146. + SULOGSRCS = sulogin.c entry.c env.c age.c pwent.c setup.c \
  147. +     shadow.c shell.c valid.c pwpack.c tz.c
  148. + MKPWDOBJS = mkpasswd.o
  149. + MKPWDSRCS = mkpasswd.c
  150. + NGSRCS = newgrp.c env.c shell.c
  151. + NGOBJS = newgrp.o env.o shell.o
  152. + CHFNSRCS = chfn.c fields.c
  153. + CHFNOBJS = chfn.o fields.o
  154. + CHSHSRCS = chsh.c fields.c
  155. + CHSHOBJS = chsh.o fields.o
  156. + CHAGEOBJS = chage.o fields.o
  157. + CHAGESRCS = chage.c fields.c
  158. + CHPASSOBJS = chpasswd.o
  159. + CHPASSSRCS = chpasswd.c
  160. + DPSRCS = dpmain.c
  161. + DPOBJS = dpmain.o
  162. + ALLSRCS = age.c dialchk.c dialup.c entry.c env.c lmain.c log.c login.c mail.c \
  163. +     motd.c obscure.c passwd.c pwconv.c pwent.c pwunconv.c getpass.c \
  164. +     setup.c shadow.c shell.c smain.c sub.c sulog.c sulogin.c ttytype.c \
  165. +     utmp.c valid.c port.c newgrp.c gpmain.c grent.c mkpasswd.c pwpack.c \
  166. +     chfn.c chsh.c chage.c rad64.c encrypt.c chpasswd.c shadowio.c pwio.c \
  167. +     newusers.c groupio.c fields.c pwdbm.c grpack.c grdbm.c sppack.c \
  168. +     spdbm.c dpmain.c gshadow.c gsdbm.c gspack.c sgroupio.c useradd.c \
  169. +     userdel.c patchlevel.h usermod.c copydir.c mkrmdir.c groupadd.c \
  170. +     groupdel.c groupmod.c tz.c console.c hushed.c getdef.c scologin.c \
  171. +     logoutd.c groups.c
  172. + FILES1 = README patchlevel.h newgrp.c Makefile config.h pwunconv.c obscure.c \
  173. +     age.c id.c
  174. + FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
  175. + FILES3 = chfn.c chsh.c smain.c faillog.c pwconv.c shadow.c
  176. + FILES4 = gpmain.c chage.c pwent.c valid.c setup.c entry.c ttytype.c port.h
  177. + FILES5 = pwio.c encrypt.c chpasswd.c newusers.c rad64.c dialchk.c faillog.h \
  178. +     pwdbm.c grdbm.c gshadow.c sppack.c
  179. + FILES6 = gspack.c spdbm.c lastlog.h shell.c login.c sub.c dpmain.c mail.c \
  180. +     env.c pwd.h.m4 grpack.c shadow.h log.c grent.c motd.c dialup.h \
  181. +     fields.c gsdbm.c utmp.c failure.c
  182. + FILES7 = groupio.c shadowio.c sgroupio.c groups.c copydir.c mkrmdir.c \
  183. +     mkpasswd.c
  184. + FILES8 = useradd.c usermod.c login.defs
  185. + FILES9 = groupadd.c groupdel.c groupmod.c tz.c console.c hushed.c getdef.c \
  186. +     scologin.c logoutd.c sulog.c getpass.c userdel.c
  187. + MAN_1 = chage.1 chfn.1 chsh.1 id.1 login.1 newgrp.1 passwd.1 su.1 \
  188. +     useradd.1 userdel.1 usermod.1 groupadd.1 groupdel.1 groupmod.1 \
  189. +     groups.1
  190. + MAN_3 = shadow.3
  191. + MAN_4 = faillog.4 passwd.4 porttime.4 shadow.4
  192. + MAN_5 = login.5
  193. + MAN_8 = chpasswd.8 dpasswd.8 faillog.8 newusers.8 pwconv.8 pwunconv.8 \
  194. +     sulogin.8 mkpasswd.8 logoutd.8
  195. + DOCS1 = $(MAN_1) $(MAN_3) $(MAN_4)
  196. + DOCS2 = $(MAN_5) $(MAN_8)
  197. + DOCS = $(DOCS1) $(DOCS2)
  198. + BINS = su login pwconv pwunconv passwd sulogin faillog newgrp gpasswd \
  199. +     mkpasswd chfn chsh chage chpasswd newusers dpasswd id useradd \
  200. +     userdel usermod groupadd groupdel groupmod logoutd groups
  201. + all:    $(BINS) $(DOCS)
  202. + .PRECIOUS: libshadow.a
  203. + libshadow.a: \
  204. +     libshadow.a(dialchk.o) \
  205. +     libshadow.a(dialup.o) \
  206. +     libshadow.a(encrypt.o) \
  207. +     libshadow.a(getdef.o) \
  208. +     libshadow.a(getpass.o) \
  209. +     libshadow.a(grdbm.o) \
  210. +     libshadow.a(grent.o) \
  211. +     libshadow.a(groupio.o) \
  212. +     libshadow.a(grpack.o) \
  213. +     libshadow.a(gshadow.o) \
  214. +     libshadow.a(gsdbm.o) \
  215. +     libshadow.a(gspack.o) \
  216. +     libshadow.a(sgroupio.o) \
  217. +     libshadow.a(port.o) \
  218. +     libshadow.a(pwdbm.o) \
  219. +     libshadow.a(pwent.o) \
  220. +     libshadow.a(pwio.o) \
  221. +     libshadow.a(pwpack.o) \
  222. +     libshadow.a(rad64.o) \
  223. +     libshadow.a(spdbm.o) \
  224. +     libshadow.a(shadow.o) \
  225. +     libshadow.a(shadowio.o) \
  226. +     libshadow.a(sppack.o)
  227. +     $(RANLIB) libshadow.a
  228. + libsec: $(LIBSEC)(shadow.o)
  229. +     $(RANLIB) $(LIBSEC)
  230. + install: all
  231. +     strip $(BINS)
  232. +     cp login $(LOGINDIR)/login
  233. +     cp mkpasswd /etc 
  234. +     cp pwconv /etc 
  235. +     cp pwunconv /etc 
  236. +     cp sulogin /etc 
  237. +     cp chpasswd /etc 
  238. +     cp newusers /etc 
  239. +     cp useradd /etc 
  240. +     cp userdel /etc 
  241. +     cp usermod /etc 
  242. +     cp groupadd /etc 
  243. +     cp groupdel /etc 
  244. +     cp groupmod /etc 
  245. +     cp logoutd /etc
  246. +     cp su /bin
  247. +     cp passwd /bin
  248. +     cp gpasswd /bin
  249. +     cp dpasswd /bin
  250. +     cp faillog /bin
  251. +     cp newgrp /bin
  252. +     cp chfn /bin
  253. +     cp chsh /bin
  254. +     cp chage /bin
  255. +     cp id /bin
  256. +     cp dialup.h shadow.h pwd.h /usr/include
  257. +     chown $(RUID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
  258. +         /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
  259. +         /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
  260. +         /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
  261. +         /etc/groupmod /etc/logoutd
  262. +     chgrp $(RGID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
  263. +         /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
  264. +         /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
  265. +         /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
  266. +         /etc/groupmod /etc/logoutd
  267. +     chown $(BUID) /bin/faillog /bin/id /usr/include/shadow.h \
  268. +         /usr/include/dialup.h /usr/include/pwd.h
  269. +     chgrp $(BGID) /bin/faillog /bin/id /usr/include/shadow.h \
  270. +         /usr/include/dialup.h /usr/include/pwd.h
  271. +     chmod 700 /etc/pwconv /etc/pwunconv /etc/sulogin /etc/mkpasswd \
  272. +         /etc/chpasswd /etc/newusers /bin/dpasswd /bin/chage \
  273. +         /etc/useradd /etc/userdel /etc/usermod /etc/groupadd \
  274. +         /etc/groupdel /etc/groupmod /etc/logoutd
  275. +     chmod 4711 $(LOGINDIR)/login /bin/su /bin/passwd /bin/gpasswd \
  276. +         /bin/newgrp /bin/chfn /bin/chsh
  277. +     chmod 711 /bin/faillog /bin/id
  278. +     chmod 444 /usr/include/shadow.h /usr/include/dialup.h \
  279. +         /usr/include/pwd.h
  280. +     [ -f /etc/login.defs ] || (cp login.defs /etc ; \
  281. +         chown $(RUID) /etc/login.defs ; \
  282. +         chgrp $(RGID) /etc/login.defs ; \
  283. +         chmod 600 /etc/login.defs )
  284. + lint:    su.lint login.lint pwconv.lint pwunconv.lint passwd.lint sulogin.lint \
  285. +     faillog.lint newgrp.lint gpasswd.lint mkpasswd.lint chfn.lint \
  286. +     chsh.lint chage.lint dpasswd.lint id.lint useradd.lint userdel.lint \
  287. +     usermod.lint groupadd.lint groupdel.lint groupmod.lint $(ALLSRCS:.c=.L)
  288. +     logoutd.lint
  289. + tags:    $(ALLSRCS)
  290. +     $(TAGS) $(ALLSRCS)
  291. + README:
  292. +     [ -f s.README ] && get -t -r$(RELEASE) s.README
  293. +     
  294. + $(DOCS):
  295. +     [ -f s.$@ ] && get -t -r$(RELEASE) s.$@
  296. + login:    $(LOBJS) libshadow.a
  297. +     $(CC) -o login $(LDFLAGS) $(LOBJS) libshadow.a $(LIBS)
  298. + login.lint: $(LSRCS)
  299. +     $(LINT) $(LINTFLAGS) $(LSRCS) > login.lint
  300. + su:    $(SOBJS) libshadow.a
  301. +     $(CC) -o su $(LDFLAGS) $(SOBJS) libshadow.a $(LIBS)
  302. + su.lint:    $(SSRCS)
  303. +     $(LINT) $(LINTFLAGS) -DSU $(SSRCS) > su.lint
  304. + passwd:    $(POBJS) libshadow.a
  305. +     $(CC) -o passwd $(LDFLAGS) $(POBJS) libshadow.a $(LIBS)
  306. + passwd.lint: $(PSRCS)
  307. +     $(LINT) $(LINTFLAGS) -DPASSWD $(PSRCS) > passwd.lint
  308. + gpasswd: $(GPOBJS) libshadow.a
  309. +     $(CC) -o gpasswd $(LDFLAGS) $(GPOBJS) libshadow.a $(LIBS)
  310. + gpasswd.lint: $(GPSRCS)
  311. +     $(LINT) $(LINTFLAGS) $(GPSRCS) > gpasswd.lint
  312. + dpasswd: $(DPOBJS) libshadow.a
  313. +     $(CC) -o dpasswd $(LDFLAGS) $(DPOBJS) libshadow.a $(LIBS)
  314. + dpasswd.lint: $(DPSRCS)
  315. +     $(LINT) $(LINTFLAGS) $(DPSRCS) > dpasswd.lint
  316. + pwconv:    $(PWOBJS) libshadow.a config.h
  317. +     $(CC) -o pwconv $(LDFLAGS) $(PWOBJS) libshadow.a $(LIBS)
  318. + pwconv.lint: $(PWSRCS) config.h
  319. +     $(LINT) $(LINTFLAGS) -DPASSWD $(PWSRCS) > pwconv.lint
  320. + pwunconv: $(PWUNOBJS) libshadow.a config.h
  321. +     $(CC) -o pwunconv $(LDFLAGS) $(PWUNOBJS) libshadow.a $(LIBS)
  322. + pwunconv.lint: $(PWUNSRCS)
  323. +     $(LINT) $(LINTFLAGS) -DPASSWD $(PWUNSRCS) > pwunconv.lint
  324. + sulogin: $(SULOGOBJS) libshadow.a
  325. +     $(CC) -o sulogin $(LDFLAGS) $(SULOGOBJS) libshadow.a $(LIBS)
  326. + sulogin.lint: $(SULOGSRCS)
  327. +     $(LINT) $(LINTFLAGS) $(SULOGSRCS) > sulogin.lint
  328. + faillog: faillog.o
  329. +     $(CC) -o faillog $(LDFLAGS) faillog.o $(LIBS)
  330. + faillog.lint: faillog.c faillog.h config.h
  331. +     $(LINT) $(LINTFLAGS) faillog.c > faillog.lint
  332. + mkpasswd: $(MKPWDOBJS) libshadow.a
  333. +     $(CC) -o mkpasswd $(LDFLAGS) $(MKPWDOBJS) libshadow.a $(LIBS)
  334. + mkpasswd.lint: $(MKPWDSRCS)
  335. +     $(LINT) $(LINTFLAGS) $(MKPWDSRCS) > mkpasswd.lint
  336. + newgrp: $(NGOBJS) libshadow.a
  337. +     $(CC) -o newgrp $(LDFLAGS) $(NGOBJS) libshadow.a $(LIBS)
  338. + newgrp.lint: $(NGSRCS)
  339. +     $(LINT) $(LINTFLAGS) $(NGSRCS) > newgrp.lint
  340. + chfn:    $(CHFNOBJS) libshadow.a
  341. +     $(CC) -o chfn $(LDFLAGS) $(CHFNOBJS) libshadow.a $(LIBS)
  342. + chfn.lint:    $(CHFNSRCS)
  343. +     $(LINT) $(LINTFLAGS) $(CHFNSRCS) > chfn.lint
  344. + chsh:    $(CHSHOBJS) libshadow.a
  345. +     $(CC) -o chsh $(LDFLAGS) $(CHSHOBJS) libshadow.a $(LIBS)
  346. + chsh.lint: $(CHSHSRCS)
  347. +     $(LINT) $(LINTFLAGS) $(CHSHSRCS) > chsh.lint
  348. + chage:    $(CHAGEOBJS) libshadow.a
  349. +     $(CC) -o chage $(LDFLAGS) $(CHAGEOBJS) libshadow.a $(LIBS)
  350. + chage.lint: $(CHAGESRCS)
  351. +     $(LINT) $(LINTFLAGS) -DPASSWD $(CHAGESRCS) > chage.lint
  352. + chpasswd: $(CHPASSOBJS) libshadow.a
  353. +     $(CC) -o chpasswd $(LDFLAGS) $(CHPASSOBJS) libshadow.a $(LIBS)
  354. + chpasswd.lint: $(CHPASSSRCS)
  355. +     $(LINT) $(LINTFLAGS) $(CHPASSSRCS) > chpasswd.lint
  356. + newusers: newusers.o libshadow.a
  357. +     $(CC) -o newusers $(LDFLAGS) newusers.o libshadow.a $(LIBS)
  358. + newusers.lint: newusers.c
  359. +     $(LINT) $(LINTFLAGS) newusers.c > newusers.lint
  360. +     
  361. + id: id.o libshadow.a
  362. +     $(CC) -o id $(LDFLAGS) id.o libshadow.a $(LIBS)
  363. + id.lint: id.c
  364. +     $(LINT) $(LINTFLAGS) id.c > id.lint
  365. + groups: groups.o libshadow.a
  366. +     $(CC) -c $(CFLAGS) groups.o libshadow.a $(LIBS)
  367. +     $(CC) -o groups $(LDFLAGS) groups.o libshadow.a $(LIBS)
  368. + groups.lint: groups.c
  369. +     $(LINT) $(LINTFLAGS) groups.c > groups.lint
  370. + useradd: useradd.o copydir.o mkrmdir.o libshadow.a
  371. +     $(CC) -o useradd $(LDFLAGS) useradd.o copydir.o mkrmdir.o \
  372. +         libshadow.a $(LIBS) $(NDIR)
  373. + useradd.lint: useradd.c copydir.c mkrmdir.c
  374. +     $(LINT) $(LINTFLAGS) useradd.c copydir.c mkrmdir.c > useradd.lint
  375. + userdel: userdel.o copydir.o mkrmdir.o libshadow.a
  376. +     $(CC) -o userdel $(LDFLAGS) userdel.o copydir.o mkrmdir.o \
  377. +         libshadow.a $(LIBS) $(NDIR)
  378. + userdel.lint: userdel.c copydir.c mkrmdir.c
  379. +     $(LINT) $(LINTFLAGS) userdel.c copydir.c mkrmdir.c > userdel.lint
  380. + usermod: usermod.o copydir.o mkrmdir.o libshadow.a
  381. +     $(CC) -o usermod $(LDFLAGS) usermod.o copydir.o mkrmdir.o \
  382. +         libshadow.a $(LIBS) $(NDIR)
  383. + usermod.lint: usermod.c copydir.c mkrmdir.c
  384. +     $(LINT) $(LINTFLAGS) usermod.c copydir.c mkrmdir.c > usermod.lint
  385. + groupadd: groupadd.o libshadow.a
  386. +     $(CC) -o groupadd $(LDFLAGS) groupadd.o libshadow.a $(LIBS)
  387. + groupadd.lint: groupadd.c
  388. +     $(LINT) $(LINTFLAGS) groupadd.c > groupadd.lint
  389. + groupdel: groupdel.o libshadow.a
  390. +     $(CC) -o groupdel $(LDFLAGS) groupdel.o libshadow.a $(LIBS)
  391. + groupdel.lint: groupdel.c
  392. +     $(LINT) $(LINTFLAGS) groupdel.c > groupdel.lint
  393. + groupmod: groupmod.o libshadow.a
  394. +     $(CC) -o groupmod $(LDFLAGS) groupmod.o libshadow.a $(LIBS)
  395. + groupmod.lint: groupmod.c
  396. +     $(LINT) $(LINTFLAGS) groupmod.c > groupmod.lint
  397. + pwd.h.m4:
  398. +     [ -f s.pwd.h.m4 ] && get -t -r$(RELEASE) s.pwd.h.m4
  399. + pwd.h: pwd.h.m4
  400. +     m4 $(OS) pwd.h.m4 >pwd.h
  401. + logoutd: logoutd.o libshadow.a
  402. +     $(CC) -o logoutd $(LDFLAGS) logoutd.o libshadow.a
  403. + logoutd.lint: logoutd.c
  404. +     $(LINT) $(LINTFLAGS) logoutd.c > logoutd.lint
  405. + sulog.o: config.h
  406. + susetup.c: setup.c
  407. +     cp setup.c susetup.c
  408. + susetup.o: config.h setup.c pwd.h
  409. +     $(CC) -c $(CFLAGS) -DSU susetup.c
  410. + scologin: scologin.o
  411. +     $(CC) -o scologin $(LDFLAGS) scologin.o -lsocket
  412. + passwd.o: config.h shadow.h pwd.h
  413. + lmain.o: config.h lastlog.h faillog.h pwd.h
  414. + smain.o: config.h lastlog.h pwd.h shadow.h
  415. + sub.o: pwd.h
  416. + setup.o: config.h pwd.h
  417. + mkrmdir.o: config.h
  418. + utmp.o: config.h
  419. + mail.o: config.h
  420. + motd.o: config.h
  421. + age.o: config.h pwd.h
  422. + log.o: config.h lastlog.h pwd.h
  423. + shell.o: config.h
  424. + entry.o: config.h shadow.h pwd.h
  425. + hushed.o: config.h pwd.h
  426. + valid.o: config.h pwd.h
  427. + failure.o: faillog.h config.h
  428. + faillog.o: faillog.h config.h pwd.h
  429. + newgrp.o: config.h shadow.h pwd.h
  430. + mkpasswd.o: config.h shadow.h pwd.h
  431. + gpmain.o: config.h pwd.h
  432. + chfn.o: config.h pwd.h
  433. + chsh.o: config.h pwd.h
  434. + chage.o: config.h shadow.h pwd.h
  435. + pwconv.o: config.h shadow.h
  436. + pwunconv.o: config.h shadow.h pwd.h
  437. + chpasswd.o: config.h shadow.h pwd.h
  438. + id.o: pwd.h
  439. + newusers.o: config.h shadow.h pwd.h
  440. + dpmain.o: dialup.h
  441. + useradd.o: config.h shadow.h pwd.h
  442. + userdel.o: config.h shadow.h pwd.h
  443. + usermod.o: config.h shadow.h pwd.h
  444. + groupadd.o: config.h shadow.h
  445. + groupdel.o: config.h shadow.h
  446. + groupmod.o: config.h shadow.h
  447. + logoutd.o:
  448. + libshadow.a(shadow.o): shadow.h config.h
  449. + libshadow.a(shadowio.o): shadow.h
  450. + libshadow.a(grent.o): config.h shadow.h
  451. + libshadow.a(sgroupio.o): shadow.h
  452. + libshadow.a(dialup.o): dialup.h
  453. + libshadow.a(dialchk.o): dialup.h config.h
  454. + libshadow.a(getdef.o): config.h
  455. + libshadow.a(pwdbm.o): config.h pwd.h
  456. + libshadow.a(pwpack.o): config.h pwd.h
  457. + libshadow.a(pwent.o): config.h pwd.h
  458. + libshadow.a(pwio.o): pwd.h
  459. + libshadow.a(getpass.o): config.h
  460. + libshadow.a(encrypt.o): config.h
  461. + libshadow.a(port.o): port.h
  462. + clean:
  463. +     -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir
  464. + clobber: clean
  465. +     -rm -f $(BINS) *.lint *.L libshadow.a
  466. + nuke:    clobber
  467. +     -for file in * ; do \
  468. +         if [ -f s.$$file -a ! -f p.$$file ] ; then \
  469. +             rm -f $$file ;\
  470. +         fi ;\
  471. +     done
  472. + shar:    login.sh.01 login.sh.02 login.sh.03 login.sh.04 login.sh.05 \
  473. +     login.sh.06 login.sh.07 login.sh.08 login.sh.09 login.sh.10 \
  474. +     login.sh.11
  475. + login.sh.01: $(FILES1) Makefile
  476. +     shar -a $(FILES1) > login.sh.01
  477. + login.sh.02: $(FILES2) Makefile
  478. +     shar -a $(FILES2) > login.sh.02
  479. + login.sh.03: $(FILES3) Makefile
  480. +     shar -a $(FILES3) > login.sh.03
  481. + login.sh.04: $(FILES4) Makefile
  482. +     shar -a $(FILES4) > login.sh.04
  483. + login.sh.05: $(FILES5) Makefile
  484. +     shar -a $(FILES5) > login.sh.05
  485. + login.sh.06: $(FILES6) Makefile
  486. +     shar -a $(FILES6) > login.sh.06
  487. + login.sh.07: $(FILES7) Makefile
  488. +     shar -a $(FILES7) > login.sh.07
  489. + login.sh.08: $(FILES8) Makefile
  490. +     shar -a $(FILES8) > login.sh.08
  491. + login.sh.09: $(FILES9) Makefile
  492. +     shar -a $(FILES9) > login.sh.09
  493. + login.sh.10: $(DOCS1) Makefile
  494. +     shar -a $(DOCS1) > login.sh.10
  495. + login.sh.11: $(DOCS2) Makefile
  496. +     shar -a $(DOCS2) > login.sh.11
  497. Index: config.h.sun4
  498. *** /dev/null    Mon Jan 20 10:07:06 1992
  499. --- config.h.sun4    Mon Jan 20 10:17:17 1992
  500. ***************
  501. *** 0 ****
  502. --- 1,125 ----
  503. + /*
  504. +  * Copyright 1989, 1990, 1991, John F. Haugh II
  505. +  * All rights reserved.
  506. +  *
  507. +  * Permission is granted to copy and create derivative works for any
  508. +  * non-commercial purpose, provided this copyright notice is preserved
  509. +  * in all copies of source code, or included in human readable form
  510. +  * and conspicuously displayed on all copies of object code or
  511. +  * distribution media.
  512. +  */
  513. + /*
  514. +  * Configuration file for login.
  515. +  *
  516. +  *    @(#)config.h.sun4    3.1    19:49:35    12/28/91 (SunOS 4.1.1)
  517. +  */
  518. + /*
  519. +  * Pathname to the run-time configuration definitions file.
  520. +  */
  521. + #define LOGINDEFS "/etc/login.defs"
  522. + /*
  523. +  * Define SHADOWPWD to use shadow [ unreadable ] password file.
  524. +  * Release 3 has a requirement that SHADOWPWD always be defined.
  525. +  */
  526. + #define    SHADOWPWD
  527. + /*
  528. +  * Define AUTOSHADOW to have root always copy sp_pwdp to pw_passwd
  529. +  * for getpwuid() and getpwnam().  This provides compatibility for
  530. +  * privileged applications which are shadow-ignorant.  YOU ARE
  531. +  * ENCOURAGED TO NOT USE THIS OPTION UNLESS ABSOLUTELY NECESSARY.
  532. +  */
  533. + #undef    AUTOSHADOW
  534. + /*
  535. +  * Define SHADOWGRP to user shadowed group files.  This feature adds
  536. +  * the concept of a group administrator.
  537. +  */
  538. + #define    SHADOWGRP /**/
  539. + /*
  540. +  * Define DOUBLESIZE to use 16 character passwords
  541. +  */
  542. + #define DOUBLESIZE
  543. + /*
  544. +  * Define AGING if you want the password aging checks made.
  545. +  * Release 3 has a requirement that AGING always be defined.
  546. +  */
  547. + #define    AGING
  548. + /*
  549. +  * Pick your version of DBM.  If you define either DBM or NDBM, you must
  550. +  * define GETPWENT.  If you define NDBM you must define GETGRENT as well.
  551. +  */
  552. + /* #define    DBM    /**/
  553. + #define    NDBM    /**/
  554. + /*
  555. +  * Define USE_SYSLOG if you want to have SYSLOG functions included in your code.
  556. +  */
  557. + #define    USE_SYSLOG
  558. + /*
  559. +  * Enable RLOGIN to support the "-r" and "-h" options.
  560. +  * Also enable UT_HOST if your /etc/utmp provides for a host name.
  561. +  */
  562. + #define RLOGIN
  563. + #define UT_HOST
  564. + /*
  565. +  * Select one of the following
  566. +  */
  567. + /* #define DIR_XENIX    /* include <sys/ndir.h>, use (struct direct)    */
  568. + /* #define DIR_BSD    /* include <ndir.h>, use (struct direct)    */
  569. + #define DIR_SYSV    /* include <dirent.h>, use (struct dirent)    */
  570. + /*
  571. +  * Various system environment definitions.
  572. +  */
  573. + #define    HAVE_ULIMIT    /* Define if your UNIX supports ulimit()    */
  574. + #define    GETPWENT    /* Define if you want my GETPWENT(3) routines    */
  575. + #define    GETGRENT    /* Define if you want my GETGRENT(3) routines    */
  576. + #undef    NEED_AL64    /* Define if library does not include a64l()    */
  577. + #undef    NEED_MKDIR    /* Define if system does not have mkdir()    */
  578. + #undef    NEED_RMDIR    /* Define if system does not have rmdir()    */
  579. + #undef    NEED_RENAME    /* Define if system does not have rename()    */
  580. + #define    NEED_STRSTR    /* Define if library does not include strstr()    */
  581. + #define    SIGTYPE    void    /* Type returned by signal()                    */
  582. + /*
  583. +  * These definitions MUST agree with the values defined in <pwd.h>.
  584. +  */
  585. + #undef    BSD_QUOTA    /* the pw_quota field exists */
  586. + #define    ATT_AGE        /* the pw_age field exists */
  587. + #define    ATT_COMMENT    /* the pw_comment field exists */
  588. + /*
  589. +  * Define NDEBUG for production versions
  590. +  */
  591. + #define    NDEBUG
  592. + /*
  593. +  * Define PWDFILE and GRPFILE to the names of the password and
  594. +  * group files.
  595. +  */
  596. + #define    PWDFILE    "/etc/passwd"
  597. + #define    GRPFILE    "/etc/group"
  598. Index: README.sun4
  599. *** /dev/null    Mon Jan 20 10:07:06 1992
  600. --- README.sun4    Mon Jan 20 10:17:18 1992
  601. ***************
  602. *** 0 ****
  603. --- 1,39 ----
  604. + [ @(#)README.sun4    3.1    19:49:15    12/28/91 ]
  605. + You'll need to do the following to get the shadow password dist to
  606. + compile on a sun 4.1.1 system.
  607. + copy Makefile.sun4 to Makefile, and make any system specific changes.
  608. + copy config.h.sun4 config.h, and make any system specific changes.
  609. + You may have to edit the pwd.h.m4 file by hand, as the sunos m4 may
  610. + not grok the pwd.h.m4 file corectly.  If you have the /usr/5bin/m4,
  611. + substitute that.  Be sure to delete the pwd.h file before typeing 
  612. + 'make' again, as there will be an empty one left from the failed attempt
  613. + to use the standard sunos m4.
  614. + type 'make'.  If everything goes well, then type 'make install'
  615. + If using csh, then type 'rehash'.  cd to the /etc directory and type
  616. + 'pwconv'.  This will create two files,  nshadow and npasswd.
  617. + now type 'mkpasswd -f nshadow' and 'mkpasswd -f npasswd'.  This will
  618. + create the shadow password file.
  619. + Note: The shadow group stuff does not work with sunos.  
  620. + Note: ftp will still use the old password file.
  621. + Note: if you run suns pcnfs, be aware that it will still be looking at the
  622. +       old password file as well.  I may work out a patch for this, as I am
  623. +       fairly certain the stuff on the sun side comes with source.
  624. + Note: I have compiled this package with the standard c compiler and
  625. +       suns unbundled c compiler at an optomization level of 2 in
  626. +       both casses.  Haven't tried gcc yet, so I don't know wether it
  627. +       works.  Same goes for suns C++ compiler.
  628. + Note: has been compiled on a sun 3/75 running sunos 4.1.1.  Should compile
  629. +       fine on sun 4's running 4.1.1, and may compile on suns running
  630. +       4.1.  Have no idea what sort of success people will have that
  631. +       are running 4.03 and older versions.
  632. Index: getdef.c
  633. *** rel3/getdef.c    Mon Jan 20 10:16:08 1992
  634. --- getdef.c    Mon Jan 20 10:17:19 1992
  635. ***************
  636. *** 10,16 ****
  637.    */
  638.   
  639.   #ifndef lint
  640. ! static    char    sccsid[] = "@(#)getdef.c    3.2    20:54:06    9/18/91";
  641.   #endif
  642.   
  643.   #include <stdio.h>
  644. --- 10,16 ----
  645.    */
  646.   
  647.   #ifndef lint
  648. ! static    char    sccsid[] = "@(#)getdef.c    3.3    19:51:46    12/28/91";
  649.   #endif
  650.   
  651.   #include <stdio.h>
  652. ***************
  653. *** 61,66 ****
  654. --- 61,67 ----
  655.       { "LOG_UNKFAIL_ENAB",        NULL },
  656.       { "MAIL_CHECK_ENAB",        NULL },
  657.       { "MAIL_DIR",            NULL },
  658. +     { "MAIL_FILE",            NULL },
  659.       { "MOTD_FILE",            NULL },
  660.       { "NOLOGINS_FILE",        NULL },
  661.       { "NOLOGIN_STR",        NULL },
  662. Index: login.defs
  663. *** rel3/login.defs    Mon Jan 20 10:16:37 1992
  664. --- login.defs    Mon Jan 20 10:17:21 1992
  665. ***************
  666. *** 1,7 ****
  667.   #
  668.   # /etc/login.defs - Configuration control definitions for the login package.
  669.   #
  670. ! #    @(#)login.defs    3.1    07:47:58    9/17/91
  671.   #
  672.   # Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
  673.   # If unspecified, some arbitrary (and possibly incorrect) value will
  674. --- 1,7 ----
  675.   #
  676.   # /etc/login.defs - Configuration control definitions for the login package.
  677.   #
  678. ! #    @(#)login.defs    3.2    19:51:49    12/28/91
  679.   #
  680.   # Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
  681.   # If unspecified, some arbitrary (and possibly incorrect) value will
  682. ***************
  683. *** 94,102 ****
  684.   NOLOGINS_FILE    /etc/nologins
  685.   
  686.   #
  687. ! # *REQUIRED*  Directory where mailboxes reside, to set MAIL env parameter.
  688.   #
  689.   MAIL_DIR    /usr/spool/mail
  690.   
  691.   #
  692.   # If defined, file which inhibits all the usual chatter during the login
  693. --- 94,105 ----
  694.   NOLOGINS_FILE    /etc/nologins
  695.   
  696.   #
  697. ! # *REQUIRED*
  698. ! #   Directory where mailboxes reside, _or_ name of file, relative to the
  699. ! #   home directory.  If you _do_ define both, MAIL_DIR takes precedence.
  700.   #
  701.   MAIL_DIR    /usr/spool/mail
  702. + #MAIL_FILE    .mail
  703.   
  704.   #
  705.   # If defined, file which inhibits all the usual chatter during the login
  706. Index: passwd.1
  707. *** rel3/passwd.1    Mon Jan 20 10:16:21 1992
  708. --- passwd.1    Mon Jan 20 10:17:22 1992
  709. ***************
  710. *** 1,10 ****
  711. ! .\" Copyright 1989, 1990, John F. Haugh II
  712.   .\" All rights reserved.
  713.   .\"
  714. ! .\" Use, duplication, and disclosure prohibited without
  715. ! .\" the express written permission of the author.
  716.   .\"
  717. ! .\"    @(#)passwd.1    3.1    09:34:23    11/21/90
  718.   .\"
  719.   .TH PASSWD 1
  720.   .SH NAME
  721. --- 1,13 ----
  722. ! .\" Copyright 1989, 1990, 1991, John F. Haugh II
  723.   .\" All rights reserved.
  724.   .\"
  725. ! .\" Permission is granted to copy and create derivative works for any
  726. ! .\" non-commercial purpose, provided this copyright notice is preserved
  727. ! .\" in all copies of source code, or included in human readable form
  728. ! .\" and conspicuously displayed on all copies of object code or
  729. ! .\" distribution media.
  730.   .\"
  731. ! .\"    @(#)passwd.1    3.2    19:51:19    12/28/91
  732.   .\"
  733.   .TH PASSWD 1
  734.   .SH NAME
  735. ***************
  736. *** 13,22 ****
  737.   \fBpasswd\fR [ \fB-f\fR ] [ \fIname\fR ]
  738.   .br
  739.   \fBpasswd\fR [ \fB-g\fR ] [ \fB-r\fR ] \fIgroup\fR
  740.   .SH DESCRIPTION
  741. ! \fIpasswd\f changes passwords for user accounts.
  742.   A normal user may only change the password for their own account,
  743.   the super user may change the password for any account.
  744.   .PP
  745.   The user is first prompted for their old password,
  746.   if one is present.
  747. --- 16,31 ----
  748.   \fBpasswd\fR [ \fB-f\fR ] [ \fIname\fR ]
  749.   .br
  750.   \fBpasswd\fR [ \fB-g\fR ] [ \fB-r\fR ] \fIgroup\fR
  751. + .br
  752. + \fBpasswd\fR [ \fB-x\fR \fImax\fR ] [ \fB-n\fR \fImin\fR ]
  753. + [ \fB-w\fR \fIwarn\fR ] [ \fB-i\fR \fIinact\fR ] \fIname\fR
  754. + .br
  755. + \fBpasswd\fR { \fB-l\fR | \fB-u\fR | \fB-d\fR | \fB-S\fR } \fIname\fR
  756.   .SH DESCRIPTION
  757. ! \fIpasswd\f changes passwords for user and group accounts.
  758.   A normal user may only change the password for their own account,
  759.   the super user may change the password for any account.
  760. + The administrator of a group may change the password for the group.
  761.   .PP
  762.   The user is first prompted for their old password,
  763.   if one is present.
  764. ***************
  765. *** 26,32 ****
  766.   The super user is permitted to bypass this step so that forgotten
  767.   passwords may be changed.
  768.   .PP
  769. ! After the password has been entered password aging information
  770.   is checked to see if the user is permitted to change their password
  771.   at this time.
  772.   If not, \fIpasswd\fR refuses to change the password and exits.
  773. --- 35,41 ----
  774.   The super user is permitted to bypass this step so that forgotten
  775.   passwords may be changed.
  776.   .PP
  777. ! After the password has been entered, password aging information
  778.   is checked to see if the user is permitted to change their password
  779.   at this time.
  780.   If not, \fIpasswd\fR refuses to change the password and exits.
  781. ***************
  782. *** 58,68 ****
  783.   .PP
  784.   When the \fB-g\f option is used, the password for the named
  785.   group is changed.
  786. ! The user must either be the super user, or the first group
  787. ! member listed for the named group.
  788.   The current group password is not prompted for.
  789.   The \fB-r\f option is used with the \fB-g\f option to remove
  790.   the current password from the named group.
  791.   .SH Hints for user passwords
  792.   The security of a password depends upon the strength of the
  793.   encryption algorithm and the size of the key space.
  794. --- 67,110 ----
  795.   .PP
  796.   When the \fB-g\f option is used, the password for the named
  797.   group is changed.
  798. ! The user must either be the super user, or a group administrator
  799. ! for the named group.
  800.   The current group password is not prompted for.
  801.   The \fB-r\f option is used with the \fB-g\f option to remove
  802.   the current password from the named group.
  803. + .PP
  804. + The password aging information may be changed by the super
  805. + user with the \fB-x\fR, \fB-n\fR, \fB-w\fR, and \fB-i\fR options.
  806. + The \fB-x\fR option is used to set the maximum number of days
  807. + a password remains valid.
  808. + After \fImax\fR days, the password is required to be changed.
  809. + The \fB-n\fR option is used to set the minimum number of days
  810. + before a password may be changed.
  811. + The user will not be permitted to change the password until
  812. + \fImin\fR days have elapsed.
  813. + The \fB-w\fR option is used to set the number of days of warning
  814. + the user will receive before their password will expire.
  815. + The warning occurs \fIwarn\fR days before the expiration, telling
  816. + the user how many days until the password is set to expire.
  817. + The \fB-i\fR option is used to disable an account after the
  818. + password has been expired for a number of days.
  819. + After a user account has had an expired password for \fIinact\fR
  820. + days, the user may no longer sign on to the account.
  821. + .PP
  822. + User accounts may be locked and unlocked with the \fB-l\fR and
  823. + \fB-u\fR flags.
  824. + The \fB-l\fR option disables an account by changing the password to a
  825. + value which matches no possible encrypted value.
  826. + The \fB-u\fR option re-enables an account by changing the password
  827. + back to its previous value.
  828. + .PP
  829. + The account status may be given with the \fB-S\fR option.
  830. + The status information consists of 6 parts.
  831. + The first part indicates if the user account is locked (L), has no
  832. + password (NP), or has a usable password (P).
  833. + The second part gives the date of the last password change.
  834. + The next four parts are the minimum age, maximum age, warning period,
  835. + and inactivity period for the password.
  836.   .SH Hints for user passwords
  837.   The security of a password depends upon the strength of the
  838.   encryption algorithm and the size of the key space.
  839. Index: lmain.c
  840. *** rel3/lmain.c    Mon Jan 20 10:16:50 1992
  841. --- lmain.c    Mon Jan 20 10:17:24 1992
  842. ***************
  843. *** 1,5 ****
  844.   /*
  845. !  * Copyright 1989, 1990, 1991, John F. Haugh II
  846.    * All rights reserved.
  847.    *
  848.    * Permission is granted to copy and create derivative works for any
  849. --- 1,5 ----
  850.   /*
  851. !  * Copyright 1989, 1990, 1991, 1992, John F. Haugh II
  852.    * All rights reserved.
  853.    *
  854.    * Permission is granted to copy and create derivative works for any
  855. ***************
  856. *** 47,53 ****
  857.   #endif
  858.   
  859.   #ifndef    lint
  860. ! static    char    sccsid[] = "@(#)lmain.c    3.17    19:39:58    12/28/91";
  861.   #endif
  862.   
  863.                       /* danger - side effects */
  864. --- 47,53 ----
  865.   #endif
  866.   
  867.   #ifndef    lint
  868. ! static    char    sccsid[] = "@(#)lmain.c    3.18    21:49:57    1/19/92";
  869.   #endif
  870.   
  871.                       /* danger - side effects */
  872. ***************
  873. *** 265,271 ****
  874.        * file if there are no additional flags on the command line.
  875.        */
  876.   
  877. !     checkutmp (argc > 1 && argv[1][0] != '-');
  878.       STRFCPY (tty, utent.ut_line);
  879.   
  880.       if (Prog = strrchr (argv[0], '/'))
  881. --- 265,271 ----
  882.        * file if there are no additional flags on the command line.
  883.        */
  884.   
  885. !     checkutmp (argc == 1 || argv[1][0] != '-');
  886.       STRFCPY (tty, utent.ut_line);
  887.   
  888.       if (Prog = strrchr (argv[0], '/'))
  889. Index: README
  890. *** rel3/README    Mon Jan 20 10:16:45 1992
  891. --- README    Mon Jan 20 10:17:27 1992
  892. ***************
  893. *** 1,10 ****
  894. ! [    @(#)README    3.7    11:58:37    12/28/91    ]
  895.   
  896.   This is the explanatory document for John F. Haugh II's login replacement,
  897. ! release 3.  This document was last updated 12/28/91.
  898.   
  899. ! This software is copyright 1988, 1989, 1990, 1991, John F. Haugh II.  All
  900. ! rights reserved.  Use, duplication and disclosure is permitted according
  901.   to the guidelines listed below.
  902.   
  903.   This software is being provided as a freely redistributable login clone.
  904. --- 1,10 ----
  905. ! [    @(#)README    3.8    21:49:26    1/19/92    ]
  906.   
  907.   This is the explanatory document for John F. Haugh II's login replacement,
  908. ! release 3.  This document was last updated 1/19/92.
  909.   
  910. ! This software is copyright 1988, 1989, 1990, 1991, 1992, John F. Haugh II.
  911. ! All rights reserved.  Use, duplication and disclosure is permitted according
  912.   to the guidelines listed below.
  913.   
  914.   This software is being provided as a freely redistributable login clone.
  915. ***************
  916. *** 30,36 ****
  917.   information and to Tony Walton (olapw@olgb1.oliv.co.uk) for the System
  918.   V Release 4 changes.  Effort in porting to SunOS has been contributed
  919.   by Dr. Michael Newberry (miken@cs.adfa.oz.au) and Micheal J. Miller, Jr.
  920. ! (mke@kaberd.rain.com)
  921.   
  922.   New for Release 3:
  923.       The objects are being combined into libraries to make maintenance
  924. --- 30,37 ----
  925.   information and to Tony Walton (olapw@olgb1.oliv.co.uk) for the System
  926.   V Release 4 changes.  Effort in porting to SunOS has been contributed
  927.   by Dr. Michael Newberry (miken@cs.adfa.oz.au) and Micheal J. Miller, Jr.
  928. ! (mke@kaberd.rain.com).  Effort in porting to AT&T UNIX System V Release
  929. ! 4 has been provided by Andrew Herbert (andrew@werple.pub.uu.oz.au).
  930.   
  931.   New for Release 3:
  932.       The objects are being combined into libraries to make maintenance
  933. Index: config.h
  934. *** rel3/config.h    Mon Jan 20 10:17:04 1992
  935. --- config.h    Mon Jan 20 10:17:29 1992
  936. ***************
  937. *** 1,5 ****
  938.   /*
  939. !  * Copyright 1989, 1990, 1991, John F. Haugh II
  940.    * All rights reserved.
  941.    *
  942.    * Permission is granted to copy and create derivative works for any
  943. --- 1,5 ----
  944.   /*
  945. !  * Copyright 1989, 1990, 1991, 1992, John F. Haugh II
  946.    * All rights reserved.
  947.    *
  948.    * Permission is granted to copy and create derivative works for any
  949. ***************
  950. *** 12,18 ****
  951.   /*
  952.    * Configuration file for login.
  953.    *
  954. !  *    @(#)config.h    3.15    12:43:13    12/28/91
  955.    */
  956.   
  957.   
  958. --- 12,18 ----
  959.   /*
  960.    * Configuration file for login.
  961.    *
  962. !  *    @(#)config.h    3.16    09:42:44    1/20/92
  963.    */
  964.   
  965.   
  966. ***************
  967. *** 151,153 ****
  968. --- 151,163 ----
  969.   #define USG_UTMP
  970.   #endif    /* BSD || SYS3 || SUN */
  971.   #endif /* !USG_UTMP || !BSD_UTMP */
  972. + /*
  973. +  * Telinit program.  If your system uses /etc/telinit to change run
  974. +  * level, define TELINIT and then define the RUNLEVEL macro to be the
  975. +  * run-level to switch INIT to.  This is used by sulogin to change
  976. +  * from single user to multi-user mode.
  977. +  */
  978. + #define    TELINIT        /**/
  979. + #define    RUNLEVEL    "2"    /**/
  980. Index: sulogin.c
  981. *** rel3/sulogin.c    Mon Jan 20 10:15:04 1992
  982. --- sulogin.c    Mon Jan 20 10:17:31 1992
  983. ***************
  984. *** 1,5 ****
  985.   /*
  986. !  * Copyright 1989, 1990, 1991, John F. Haugh II
  987.    * All rights reserved.
  988.    *
  989.    * Permission is granted to copy and create derivative works for any
  990. --- 1,5 ----
  991.   /*
  992. !  * Copyright 1989, 1990, 1991, 1992, John F. Haugh II
  993.    * All rights reserved.
  994.    *
  995.    * Permission is granted to copy and create derivative works for any
  996. ***************
  997. *** 13,18 ****
  998. --- 13,19 ----
  999.   #include <stdio.h>
  1000.   #include "pwd.h"
  1001.   #include <utmp.h>
  1002. + #include <fcntl.h>
  1003.   #ifdef    BSD
  1004.   #include <strings.h>
  1005.   #define    strchr    index
  1006. ***************
  1007. *** 23,30 ****
  1008.   #endif
  1009.   #include "config.h"
  1010.   
  1011.   #ifndef    lint
  1012. ! static    char    sccsid[] = "@(#)sulogin.c    3.7    07:43:27    9/17/91";
  1013.   #endif
  1014.   
  1015.   char    name[BUFSIZ];
  1016. --- 24,39 ----
  1017.   #endif
  1018.   #include "config.h"
  1019.   
  1020. + #ifdef    USE_SYSLOG
  1021. + #include <syslog.h>
  1022. + #ifndef    LOG_WARN
  1023. + #define    LOG_WARN    LOG_WARNING
  1024. + #endif
  1025. + #endif
  1026.   #ifndef    lint
  1027. ! static    char    sccsid[] = "@(#)sulogin.c    3.8    09:42:53    1/20/92";
  1028.   #endif
  1029.   
  1030.   char    name[BUFSIZ];
  1031. ***************
  1032. *** 68,80 ****
  1033.       char    *tz ();
  1034.       char    *cp;
  1035.   
  1036.       if (access (PWDFILE, 0) == -1) { /* must be a password file! */
  1037.           printf ("No password file\n");
  1038.           exit (1);
  1039.       }
  1040. ! #ifdef    NDEBUG
  1041. !     if (getppid () != 1)        /* parent must be INIT */
  1042.           exit (1);
  1043.   #endif
  1044.       if (! isatty (0) || ! isatty (1) || ! isatty (2))
  1045.           exit (1);        /* must be a terminal */
  1046. --- 77,114 ----
  1047.       char    *tz ();
  1048.       char    *cp;
  1049.   
  1050. + #ifdef    USE_SYSLOG
  1051. +     openlog ("sulogin", LOG_PID|LOG_CONS|LOG_NOWAIT, LOG_AUTH);
  1052. + #endif
  1053. +     if (argc > 1) {
  1054. +         close (0);
  1055. +         close (1);
  1056. +         close (2);
  1057. +         if (open (argv[1], O_RDWR) >= 0) {
  1058. +             dup (0);
  1059. +             dup (0);
  1060. +         } else {
  1061. + #ifdef    USE_SYSLOG
  1062. +             syslog (LOG_WARN, "cannot open %s\n", argv[1]);
  1063. + #endif
  1064. +             exit (1);
  1065. +         }
  1066. +     }
  1067.       if (access (PWDFILE, 0) == -1) { /* must be a password file! */
  1068.           printf ("No password file\n");
  1069. + #ifdef    USE_SYSLOG
  1070. +         syslog (LOG_WARN, "No password file\n");
  1071. + #endif
  1072.           exit (1);
  1073.       }
  1074. ! #ifndef    DEBUG
  1075. !     if (getppid () != 1) {        /* parent must be INIT */
  1076. ! #ifdef    USE_SYSLOG
  1077. !         syslog (LOG_WARN, "Pid == %d, not 1\n", getppid ());
  1078. ! #endif
  1079.           exit (1);
  1080. +     }
  1081.   #endif
  1082.       if (! isatty (0) || ! isatty (1) || ! isatty (2))
  1083.           exit (1);        /* must be a terminal */
  1084. ***************
  1085. *** 93,98 ****
  1086. --- 127,135 ----
  1087.           entry (name, &pwent);    /* get entry from password file */
  1088.           if (pwent.pw_name == (char *) 0) {
  1089.               printf ("No password entry for 'root'\n");
  1090. + #ifdef    USE_SYSLOG
  1091. +             syslog (LOG_WARN, "No password entry for 'root'\n");
  1092. + #endif
  1093.               exit (1);
  1094.           }
  1095.   
  1096. ***************
  1097. *** 103,111 ****
  1098.   
  1099.                       /* get a password for root */
  1100.           if (! (cp = getpass ("Type control-d for normal startup,\n\
  1101. ! (or give root password for system maintenance):")))
  1102.               exit (0);
  1103. !         else
  1104.               strcpy (pass, cp);
  1105.   
  1106.           if (valid (pass, &pwent)) /* check encrypted passwords ... */
  1107. --- 140,154 ----
  1108.   
  1109.                       /* get a password for root */
  1110.           if (! (cp = getpass ("Type control-d for normal startup,\n\
  1111. ! (or give root password for system maintenance):"))) {
  1112. ! #ifdef    USE_SYSLOG
  1113. !             syslog (LOG_INFO, "Normal startup\n");
  1114. ! #endif
  1115. ! #ifdef    TELINIT
  1116. !             execl ("/etc/telinit", "telinit", RUNLEVEL, (char *) 0);
  1117. ! #endif
  1118.               exit (0);
  1119. !         } else
  1120.               strcpy (pass, cp);
  1121.   
  1122.           if (valid (pass, &pwent)) /* check encrypted passwords ... */
  1123. ***************
  1124. *** 112,122 ****
  1125. --- 155,171 ----
  1126.               break;        /* ... encrypted passwords matched */
  1127.   
  1128.           puts ("Login incorrect");
  1129. + #ifdef    USE_SYSLOG
  1130. +         syslog (LOG_WARN, "Incorrect root password\n");
  1131. + #endif
  1132.       }
  1133.       alarm (0);
  1134.       environ = newenvp;        /* make new environment active */
  1135.   
  1136.       puts ("Entering System Maintenance Mode");
  1137. + #ifdef    USE_SYSLOG
  1138. +     syslog (LOG_INFO, "System Maintenance Mode\n");
  1139. + #endif
  1140.   
  1141.       /*
  1142.        * Normally there would be a utmp entry for login to mung on
  1143. Index: sulogin.8
  1144. *** rel3/sulogin.8    Mon Jan 20 10:16:34 1992
  1145. --- sulogin.8    Mon Jan 20 10:17:32 1992
  1146. ***************
  1147. *** 1,14 ****
  1148. ! .\" Copyright 1989, 1990, John F. Haugh II
  1149.   .\" All rights reserved.
  1150.   .\"
  1151. ! .\" Use, duplication, and disclosure prohibited without
  1152. ! .\" the express written permission of the author.
  1153.   .\"
  1154. ! .\"    @(#)sulogin.8    3.2    07:50:00    7/13/91
  1155.   .\"
  1156.   .TH SULOGIN 8
  1157.   .SH NAME
  1158.   sulogin \- Single-user login
  1159.   .SH DESCRIPTION
  1160.   .I sulogin
  1161.   is invoked by \fB/etc/init\fR prior to allowing the user
  1162. --- 1,19 ----
  1163. ! .\" Copyright 1989, 1990, 1992, John F. Haugh II
  1164.   .\" All rights reserved.
  1165.   .\"
  1166. ! .\" Permission is granted to copy and create derivative works for any
  1167. ! .\" non-commercial purpose, provided this copyright notice is preserved
  1168. ! .\" in all copies of source code, or included in human readable form
  1169. ! .\" and conspicuously displayed on all copies of object code or
  1170. ! .\" distribution media.
  1171.   .\"
  1172. ! .\"    @(#)sulogin.8    3.3    09:42:50    1/20/92
  1173.   .\"
  1174.   .TH SULOGIN 8
  1175.   .SH NAME
  1176.   sulogin \- Single-user login
  1177. + .SH SYNTAX
  1178. + \fBsulogin\fR [ \fItty-device\fR ]
  1179.   .SH DESCRIPTION
  1180.   .I sulogin
  1181.   is invoked by \fB/etc/init\fR prior to allowing the user
  1182. ***************
  1183. *** 23,28 ****
  1184. --- 28,36 ----
  1185.   .br
  1186.   (or give root password for system maintenance):
  1187.   .PP
  1188. + Input and output will be performed with the standard file
  1189. + descriptors unless the optional device name argument is provided.
  1190. + .PP
  1191.   If the user enters the correct root password, a login session
  1192.   is initiated.
  1193.   When \fBEOF\fR is pressed instead, the system enters multi-user
  1194. ***************
  1195. *** 40,46 ****
  1196.   For example, the line
  1197.   .br
  1198.   .sp 1
  1199. ! co:s:respawn:/etc/sulogin < /dev/console > /dev/console 2>&1
  1200.   .br
  1201.   .sp 1
  1202.   should execute the sulogin command in single user mode.
  1203. --- 48,54 ----
  1204.   For example, the line
  1205.   .br
  1206.   .sp 1
  1207. ! co:s:respawn:/etc/sulogin /dev/console
  1208.   .br
  1209.   .sp 1
  1210.   should execute the sulogin command in single user mode.
  1211. Index: lastlog.h
  1212. *** rel3/lastlog.h    Mon Jan 20 10:15:38 1992
  1213. --- lastlog.h    Mon Jan 20 10:17:33 1992
  1214. ***************
  1215. *** 9,15 ****
  1216.   /*
  1217.    * lastlog.h - structure of lastlog file
  1218.    *
  1219. !  *    @(#)lastlog.h    2.3    19:23:49    7/29/90
  1220.    *
  1221.    *    This file defines a lastlog file structure which should be sufficient
  1222.    *    to hold the information required by login.  It should only be used if
  1223. --- 9,15 ----
  1224.   /*
  1225.    * lastlog.h - structure of lastlog file
  1226.    *
  1227. !  *    @(#)lastlog.h    3.1    11:30:22    12/3/91
  1228.    *
  1229.    *    This file defines a lastlog file structure which should be sufficient
  1230.    *    to hold the information required by login.  It should only be used if
  1231. Index: Makefile
  1232. *** rel3/Makefile    Mon Jan 20 10:16:46 1992
  1233. --- Makefile    Mon Jan 20 10:17:36 1992
  1234. ***************
  1235. *** 8,16 ****
  1236.   # and conspicuously displayed on all copies of object code or
  1237.   # distribution media.
  1238.   #
  1239. ! #    @(#)Makefile    3.25.1.3    19:39:43  - Shadow password system
  1240.   #
  1241. ! #    @(#)Makefile    3.25.1.3    19:39:43    12/28/91
  1242.   #
  1243.   SHELL = /bin/sh
  1244.   
  1245. --- 8,16 ----
  1246.   # and conspicuously displayed on all copies of object code or
  1247.   # distribution media.
  1248.   #
  1249. ! #    @(#)Makefile    3.25.1.4    10:13:51  - Shadow password system
  1250.   #
  1251. ! #    @(#)Makefile    3.25.1.4    10:13:51    1/20/92
  1252.   #
  1253.   SHELL = /bin/sh
  1254.   
  1255. ***************
  1256. *** 307,312 ****
  1257. --- 307,324 ----
  1258.       
  1259.   $(DOCS):
  1260.       [ -f s.$@ ] && get -t -r$(RELEASE) s.$@
  1261. + login.defs:
  1262. +     [ -f s.login.defs ] && get -t -r$(RELEASE) s.login.defs
  1263. + Makefile.sun4:
  1264. +     [ -f s.Makefile.sun4 ] && get -t -r$(RELEASE) s.Makefile.sun4
  1265. + README.sun4:
  1266. +     [ -f s.README.sun4 ] && get -t -r$(RELEASE) s.README.sun4
  1267. + config.h.sun4:
  1268. +     [ -f s.config.h.sun4 ] && get -t -r$(RELEASE) s.config.h.sun4
  1269.   
  1270.   login:    $(LOBJS) libshadow.a
  1271.       $(CC) -o login $(LDFLAGS) $(LOBJS) libshadow.a $(LIBS)
  1272. -- 
  1273. John F. Haugh II        | Every 56 days.   | UUCP: ...!cs.utexas.edu!rpp386!jfh
  1274. Ma Bell: (512) 251-2151 | Give Blood, often.    | Domain: jfh@rpp386.cactus.org
  1275.  
  1276. HI ! I'm a mutating signature virus. You cannot resist helping me spread !
  1277.  
  1278. exit 0 # Just in case...
  1279.