How do I protect /etc/passwd and /etc/shadow from concurrent access? I don't see any locking mechanism in pwd.h
. I see the manual for pwd_mkdb
mentions obtaining a lock, but is it just locking the file for exclusive access?
Is there a convention for locking these files if I were to write a utility to modify them directly, or through the get/set/endpwent family of functions?