[Bug 248574] rmuser pw: pw_copy(): Invalid argument

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 11 19:16:20 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248574

--- Comment #1 from Conrad Meyer <cem at freebsd.org> ---
This indicates that the failing part of rmuser.sh is in rm_user():

182         ! verbose && echo -n " passwd"
183         verbose && echo -n " from the system:"
184         ${PWCMD} userdel -n $login $pw_rswitch

And the output of 'pw userdel -n vmail' (with or without additional -r) is:

pw: entry inconsistent
pw: pw_copy(): Invalid argument

Both the warning and EINVAL come from libutil's pw_copy(), while the err()
termination comes via the pw_update() in pw(8).  The warning is produced if
pw_equal() fails between the old_pw supplied to pw_copy() and the record of the
same name parsed by pw_scan() out of /etc/master.passwd.  pw_equal looks at
pw_name, pw_uid, pw_gid, pw_class, pw_change, pw_expire, pw_gecos, pw_dir, and
pw_shell.

pw(8)'s old_pw comes from GETPWNAM(), which ... is PWF._getpwnam... which is
just getpwnam(3) for non-relocated pw(8).  getpwnam(3) goes through nsdispatch
and looks at /etc/pwd.db (or /etc/spwd.db) directly.

So it seems like your /etc/master.passwd is out of sync with your /etc/pwd.db.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list