* bug in calendar(1)
@ 2000-01-07 5:00 Rui Pedro Mendes Salgueiro
0 siblings, 0 replies; only message in thread
From: Rui Pedro Mendes Salgueiro @ 2000-01-07 5:00 UTC (permalink / raw)
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 <stdio.h>
#include <pwd.h>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-01-07 5:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-01-07 5:00 bug in calendar(1) Rui Pedro Mendes Salgueiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox