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!cbosgd!ihnp4!nsc!glenn From: glenn@nsc.UUCP (Glenn Skinner) Newsgroups: net.sources.bugs Subject: Re: 5 bug fixes for the nu (new user) program Message-ID: <1957@nsc.UUCP> Date: Mon, 3-Dec-84 13:27:56 EST Article-I.D.: nsc.1957 Posted: Mon Dec 3 13:27:56 1984 Date-Received: Tue, 4-Dec-84 19:36:35 EST References: <1931@nsc.UUCP> Distribution: net Organization: National Semiconductor, Sunnyvale Lines: 70 How embarrassing! After posting some bug fixes to nu, I found a bug in one of my fixes. The bug occurs in the fix to the password locking problem. My fix as posted works except in the case when nu is invoked with no arguments. In this case, it tries to unlock the password file even thoug it hasn't been locked yet (harmless, but annoying). A fix for the fix follows. Apply it _after_ applying the original fix. -- Glenn Skinner National Semiconductor, Microcomputer Systems Division (408) 733-2600 x 335 ---------------------------------------------------------------- ------- nu.c ------- *** /tmp/d07963 Mon Dec 3 10:04:53 1984 --- nu.c Mon Dec 3 09:51:20 1984 *************** *** 1386,1392 struct passwd *pwd; if (argc == 1) ! goto uusage; incritsect = FALSE; signal (SIGINT, Catch); /* catch ^C's */ gethostname (This_host, 100); --- 1386,1392 ----- struct passwd *pwd; if (argc == 1) ! goto usage; incritsect = FALSE; signal (SIGINT, Catch); /* catch ^C's */ gethostname (This_host, 100); *************** *** 1442,1448 } unlink (StrV ("Linkfile")); exit (OK); uusage: fprintf (stderr, "usage: nu -a add new accounts\n"); fprintf (stderr, " nu -k user1 user2 ... kill old accounts\n"); --- 1442,1450 ----- } unlink (StrV ("Linkfile")); exit (OK); uusage: + unlink (StrV ("Linkfile")); + usage: fprintf (stderr, "usage: nu -a add new accounts\n"); fprintf (stderr, " nu -k user1 user2 ... kill old accounts\n"); *************** *** 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); } --- 1449,1453 ----- "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); }