Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84 chuqui version 1.7 9/23/84; site nsc.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!nsc!glenn From: glenn@nsc.UUCP (Glenn Skinner) Newsgroups: net.sources.bugs Subject: 5 bug fixes for the nu (new user) program Message-ID: <1931@nsc.UUCP> Date: Sat, 1-Dec-84 16:54:46 EST Article-I.D.: nsc.1931 Posted: Sat Dec 1 16:54:46 1984 Date-Received: Sun, 2-Dec-84 05:58:30 EST Distribution: net Organization: National Semiconductor, Sunnyvale Lines: 160 I've just installed the new user program (nu) that Brian Reid distributed recently. While doing so, I found and fixed several bugs. They're all fairly minor. What follows is a set of bug fixes for each of the five bugs I found. -- Glenn Skinner National Semiconductor, Microcomputer Systems Division (408) 733-2600 x 335 ---------------------------------------------------------------- Subject: nu distribution format problem Description: Nu was distributed in shar format. The distributed material contained characters that the shell interprets as metacharacters. These characters were not protected from expansion, since the delimiters for input redirection weren't quoted. Repeat-By: Extract the archive and observe that `` pairs have disappeared from nu.8 and that all of nu.[1234].sh have been corrupted. Fix: Before extracting the archive, edit it to replace all occurrences of cat > ... << BeginBombingInFiveMinutes with cat > ... << 'BeginBombingInFiveMinutes' ---------------------------------------------------------------- Subject: nu.8 describes a nonexistent option (-d) Index: etc/nu/nu.8 Description: Nu's man page describes a "-d" option that doesn't exist. Repeat-By: Try running "nu -d". You'll get an error exit. Fix: Remove the relevant SYNOPSIS line and paragraph describing the "-d" option from nu.8. (This one's too bad. The option as described is one I'd very much like to have.) ---------------------------------------------------------------- Subject: nu's Makefile's install rule doesn't set modes correctly Index: etc/nu/Makefile Description: When running "make install", the shell files nu[1234].sh aren't made executable. This causes nu to fail when it tries to execute them. Repeat-By: Install nu using the distributed Makefile, then run "nu -a". It will update the password file, then fail when it tries to execute nu1.sh to create the new user's home directory. Fix: Replace the distributed Makefile with this one. (The diffs are as long as the Makefile itself.) This Makefile assumes you're running the 4.2bsd version of install. SHELLFILES = nu1.sh nu2.sh nu3.sh nu4.sh nu: nu.c cc -O -o nu nu.c -ldbm install: nu -mkdir /etc/nulib install -s nu /etc for i in ${SHELLFILES}; do install -c -m 555 $$i /etc/nulib; done install -c -m 444 nu.cf.debug /etc/nulib install -c -m 444 nu.cf.real /etc/nulib -ln -s /etc/nulib/nu.cf.real /etc/nu.cf install -c -m 444 nu.8 /usr/man/man8 @echo Make sure you edit /etc/nulib/nu.cf.\* for your site ---------------------------------------------------------------- Subject: nu locks the password file, but doesn't unlock it on error exit Index: etc/nu/nu.c Description: When it starts up, nu locks the password file, obeying the conventions used by vipw, passwd, etc. If invoked incorrectly, it exits without removing the lock. Repeat-By: Run the following commands: nu -x nu -x The second time around, nu will complain that the password file is locked and will then exit. Fix: Apply the change indicated by the following context diff to nu.c. Unfortunately, line numbers won't correspond to those in the original -- we add our own SCCS headers. ------- nu.c ------- *** /tmp/d20728 Sat Dec 1 13:33:30 1984 --- nu.c Sat Dec 1 13:04:13 1984 *************** *** 1447,1451 "usage: nu -a add new accounts\n"); fprintf (stderr, " nu -k user1 user2 ... kill old accounts\n"); fprintf (stderr, " nu -m modify existing accounts\n"); exit (ERROR); } --- 1447,1452 ----- "usage: nu -a add new accounts\n"); fprintf (stderr, " nu -k user1 user2 ... kill old accounts\n"); fprintf (stderr, " nu -m modify existing accounts\n"); + unlink (StrV ("Linkfile")); exit (ERROR); } ---------------------------------------------------------------- Subject: nu doesn't respect the WantMHsetup configuration variable Index: etc/nu/nu.c Description: When adding a new user ("nu -a"), nu will ask whether you want to set up a MH mailbox regardless of the value of the WantMHsetup configuration variable. Repeat-By: Edit /etc/nulib/nu.cf.real to have the WantMHsetup line look like: WantMHsetup=0 ; ask about setting up MH mailbox Then run "nu -a" and observe that you're asked about setting up a MH mailbox. Fix: Apply the change indicated by the following context diff to nu.c. Unfortunately, line numbers won't correspond to those in the original -- we add our own SCCS headers. ------- nu.c ------- *** /tmp/d20738 Sat Dec 1 13:42:18 1984 --- nu.c Sat Dec 1 13:41:54 1984 *************** *** 852,860 GetLoginSH (new.cpw_shell); if (noclobber == 0) { ! printf ("Do you want an initialized ~/Mail for MH? (y or n) [y] "); ! if (YesNo ('y')) ! whichmail = 'm'; else whichmail = 'u'; } --- 852,864 ----- GetLoginSH (new.cpw_shell); if (noclobber == 0) { ! if (IntV ("WantMHsetup")) { ! printf ("Do you want an initialized ~/Mail for MH? (y or n) [y] "); ! if (YesNo ('y')) ! whichmail = 'm'; ! else ! whichmail = 'u'; ! } else whichmail = 'u'; } ---------------------------------------------------------------- This concludes the nu bug fixes.