[Bug 234972] yppasswdd cannot update passwd (rename of /var/yp to /var/yp/master. passwd.hold failed)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jan 15 12:27:30 UTC 2019


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

            Bug ID: 234972
           Summary: yppasswdd cannot update passwd (rename of /var/yp to
                    /var/yp/master. passwd.hold failed)
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: Bernard.Marshall at axiell.com

After upgrading to 12.0 RELEASE the yppasswdd RPC no longer updates passwords
successfully. When trying to update a password the following is output:

$ passwd fred
Changing NIS password for fred
New Password:
Retype New Password:
passwd: pam_chauthtok(): Error in service module

A check of /var/log/messages shows one of the following errors depending on
whether the -t option was set for nis_yppasswdd_flags in /etc/rc.conf:

rename of / to /.hold failed
rename of /var to /var/yp.hold failed
rename of /var/yp to /var/yp/master.passwd.hold failed

The error is in /usr/src/usr.sbin/rpc.yppasswdd/yppasswdd_server.c where
dirname() is used twice (line 609 and 832). Both lines have the code:

if (pw_init(dirname(passfile), passfile)) {

It looks like the implementation of dirname in 12.0 RELEASE has changed to now
apply changes to the string passed into the function. The change is to make the
call thread safe according to the updated manual entry. The problem here is
that the call to dirname() now truncates "passfile" meaning the variable no
longer holds the path to the master password file, rather just the directory
and hence the error.

In order to use dirname() now "passfile" will need to be copied before being
passed into dirname().

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


More information about the freebsd-bugs mailing list