Perl_User has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to search and delete users from the /etc/passwd file. I found a module (Unix::PasswdFile) that automatically hadles file locking and getting the colons in the right places and etc. The problem is that this is a alpha version. Does anyone know another module that I can use to work with the passwd file? Please help

Replies are listed 'Best First'.
Re: passwd file
by grep (Monsignor) on Feb 08, 2002 at 22:26 UTC
    If you are concerned about the safety of Unix::PasswdFile I would recommend one of two options.
  • use a your *nix specific tool usually rmuser or such
  • to disable accounts (assuming no /etc/shadow) just prepend an '*' to the front of thier password,
  • else if you have a /etc/shadow prepend '*' to the passwd in /etc/shadow


  • UPDATE: Just noticed that this was my 100th post

    grep
    grep> chown linux:users /world
(crazyinsomniac) Re: passwd file
by crazyinsomniac (Prior) on Feb 09, 2002 at 03:42 UTC
Re: passwd file
by Juerd (Abbot) on Feb 08, 2002 at 22:22 UTC
    Do you use it just because it says it's an alpha version? Code can be good with a 0.01 version number too. Or do you only use code that had its betas, alphas and several releases before you trust it?

    On a completely different and not at all Perl related notice, userdel and deluser (they're different) are fine unix programs.

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Alpha modules (was Re: passwd file)
by gellyfish (Monsignor) on Feb 09, 2002 at 09:38 UTC

    I have had a quick look at the module and I don't think that there is anything wrong with it - if you have been using it succesfully up till I wouldn't let the 'Alpha' tag put you off too much, module authors will tend to label modules as alpha not so much as a comment on the code but rather to indicate that it is still being actively developed and that the interface and or implementation may change from release to release and even so most authors will, on a radical overhaul of the modules interface, will leave some backward compatibility path for existing users.

    /J\