[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: repeated system mail, /etc/.pwd.lock ?



On Wed, May 05, 2021 at 10:36:53AM -0500, David Wright wrote:
> OTOH perhaps monkeysphere has some reason to lock /etc/passwd et al
> during operation. Running strings on its binaries might throw up
> some 'pwd.lock' matches. Or one could inotifywatch the program to
> see how often it is run (unless it's a daemon). Just thinking aloud.

I actually looked for that filename in "strings /usr/bin/sudo" and
"strings /usr/sbin/vipw" before Google told me that it's used by those
libc functions (lckpwdf(3) and its buddy ulckpwdf(3)).

It's a bit odd that the man page doesn't contain the filename.  Usually
you'd expect it to.

> One thing I didn't learn is why .pwd.lock is in /etc/ rather than,
> say, /run/lock/. Perhaps related, why are there dotfiles in /etc/
> anyway. (.git/, .java/, .etckeeper, .gitignore are the others.)
> What are they hiding from?

This predates /run by a long time.

Also, presumably, it wants to be in /etc because that's where the file
that it's paired with lives.  Dot-lock files are usually in the same
location as the files they represent.

Why the dot?  So that it doesn't show up in a casual "ls" and cause a
bunch of n00b questions, obviously.


Reply to: