lckpwdf creates /etc/.pwd.lock + ulckpwdf fails to remove /etc/.pwd.lock

Bug #1252292 reported by David Favor on 2013-11-18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
shadow (Ubuntu)

Bug Description

For the simple program...

#include <stdio.h>
#include <shadow.h>
int main (void) {
   int status = lckpwdf();
   status = ulckpwdf();
   return status;

gcc -o simple simple.c

strace ./simple 2>&1 | egrep 'pwd|lckpwdf|ulckpwdf'
open("/etc/.pwd.lock", O_WRONLY|O_CREAT|O_CLOEXEC, 0600) = 3

It appears the macro lckpwdf creates /etc/.pwd.lock + macro ulckpwdf fails to delete this file.

So running a program like vipw creates both /etc/.pwd.lock + /etc/passwd.lock files or
vigr creates both /etc/.pwd.lock + /etc/group.log and in both cases after vipw or vigr
exit /etc/.pwd.lock remains.

Seth Arnold (seth-arnold) wrote :

-rw------- 1 root root 0 Aug 23 2012 /etc/.pwd.lock

Changed in shadow (Ubuntu):
status: New → Confirmed
DiagonalArg (diagonalarg) wrote :

I am running Ubuntu Gnome 16.04, and the /etc/.pwd.lock file has been on my machine since install. I checked a couple of 14.04 machines, and it's the same. That file is making duplicity backups of /etc fail.

DiagonalArg (diagonalarg) wrote :

I'll add that the same problem is reported at Red Hat:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.