From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5ca2f6cddfff7b42,start X-Google-Attributes: gidfee84,public From: Rui Pedro Mendes Salgueiro Subject: bug in calendar(1) Date: 2000/01/07 Message-ID: <855a7j$2ms$1@rena.mat.uc.pt>#1/1 X-Deja-AN: 569635648 X-Trace: rena.mat.uc.pt 947268662 2781 127.0.0.1 (7 Jan 2000 18:11:02 GMT) Organization: Universidade de Coimbra User-Agent: tin/pre-1.4-981114 ("The Watchman") (UNIX) (FreeBSD/2.2.7-RELEASE (i386)) NNTP-Posting-Date: 7 Jan 2000 18:11:02 GMT Newsgroups: comp.unix.osf.osf1 X-Complaints-To: usenet@rena.mat.uc.pt Hi. Some time ago I had to solve the following problem (and when I upgraded to Digitl Unix 4.0F I had to solve it again, which is why I am posting this). When you run: calendar - to run "calendar for all users who have a calendar file in their home directories" (I have this on the root crontab), _and_ you are using NIS (aka Yellow Pages), you get an error: /usr/bin/calendar: +:: not found ^^ Luckly, calendar is a script, so I could check what was happening. The script is 'cat'ing /etc/passwd into a loop which does the real work: cat /etc/passwd | \ sed ... | \ (long loop in the following lines) Of course, this fails with the line which refer to YP, which instead of a user name has a '+:'. Now, since this bug didn't exist in the old version of calendar (ULTRIX V4.2, circa 1991, I think), I went to check that script. Is has the same basic structure (but simpler/shorter) and that lines reads catpw | sed .... catpw is a binary, but after reading the man page it is quite easy to reimplement it. I append my version below. Two questions: 1 - Does anyone knows why Digital removed this fix from Digital Unix ? 2 - Assuming that this was indeed an oversight on their part, is there an email address to which one can submit a bug report ? :::::::::::::: catpw.c :::::::::::::: /* * catpw(1) * * Name * catpw - prints all password entries * * Syntax * catpw * * Description * The catpw command prints password entries for all users known to the * system using the format in passwd(5). Password entries are gathered * from all sources including Yellow Pages, Kerberos, and /etc/passwd. * * See Also * getpwent(3), passwd(5) * * Needed by * calendar(1) * */ #include #include main() { struct passwd *passwd; setpwent(); while ( (passwd = getpwent()) != NULL ) { putpwent(passwd, stdout); } endpwent(); } :::::::::::::: :::::::::::::: catpw.1 (from ULTRIX V4.2) :::::::::::::: .TH catpw 1 .SH Name catpw \- prints all password entries .SH Syntax .B catpw .SH Description .NXR "password" "printing with catpw" .NXR "catpw command" "reference page" The .PN catpw command prints password entries for all users known to the system using the format in .MS passwd 5 . Password entries are gathered from all sources including Yellow Pages, Kerberos, and .PN /etc/passwd . .SH See Also getpwent(3), passwd(5) :::::::::::::: -- http://www.mat.uc.pt/~rps/f1/ an half-tifoso until Canada 2000 Mark Sandman - Morphine, RIP (July 3th, 1999, Italy) .pt is Portugal| `Whom the gods love die young'-Menander (342-292 BC) Europe | Villeneuve 50-82, Toivonen 56-86, Senna 60-94