Re: use of passwd.lock and passwd-

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

 



On January 27, 2004 08:42 pm, Kirankumar Puttur wrote:
> Hi ,
>
> You are right peter on both the occasions , but peter i found a strange
> behaviour in this line ,
>
> whenever i create a user without a passwd (in RH EL 2.4) the passwd.lock
> file would appear under etc folder but once i add passwd to the user the
> passwd lock file would disappear
>
> I think probably vipw locks the file till the user gets the passwd i
> believe
>
> I think you can throw more light on this
>
> Regards
>
> Kiran Kumar Puttur

Hi Kiran,

The lock files are interesting. There are two files, /etc/shadow.lock 
/etc/passwd.lock

They contain the PID of the command creating them (vipw or useradd) but are 
two separate files, not hardlinks. vipw also created a /etc/.pwd.lock file.

They are created when a user is made with useradd, regardless of if you feed a 
password as an arg, and are removed with userdel. If I create 2 users in a 
row, the numeric string in the files changes, if I then remove any of users, 
the files are removed.

Changing a users passwd or locking/unlocking an account does not change, 
create, or remove  the files.

In a sence they are left over/broken lock files as they are only applicable if 
the number they contain represents a running process. Once the PID is gone 
useradd or vipw exits, the locks no longer apply and should probably have 
been removed by the process that created them. There may be a bugreport on 
them, I never looked.

-- 
Pete Nesbitt, rhce


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux