In the last episode (Jul 30), Ruslan Ermilov said:
> [Sorry for x-posting, not sure where this is more relevant.]
> I have hit the following nasty problem with
> /etc/periodic/daily/300.calendar while using NIS.  We have our NIS
> database distributed with all shells switched off to /sbin/nologin,
> and overriding shells as necessary on machines where we need it. 
> Something like this:
> +ru:::::::::/bin/tcsh
> +:::::::::
> The problem is that the "ru" entry is reported by getpwent(3) twice,
> first with /bin/tcsh shell, and second with the /sbin/nologin shell.
> The net effect is that you get your calendar mail twice.
> Is this the correct behavior of getpwent(3), and then what do we do
> with calendar(1), or getpwent(3) is in trouble?  (I've checked that
> on both 4.x and 5.0.)

It looks like the correct behaviour.  The nsswitch.conf manpage on
FreeBSD actually mentions the possibility of duplication, and I've seen
it on BSD, Tru64, Solaris, and Linux.  The Solaris manpages for
getpwnam and nsswitch.conf say that getpwent+nswwitch is inefficient
and is discouraged, but they don't suggest any alternatives.

I guess the best solution would be to keep a list of uids that have
already been processed by calendar, and ignore duplicates.

        Dan Nelson

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to