#583593 passwd: disabling and enabling shadow again breaks NIS

Package:
passwd
Source:
shadow
Description:
change and administer password and group data
Submitter:
Santiago Vila
Date:
2010-05-29 11:15:07 UTC
Severity:
normal
#583593#5
Date:
2010-05-28 15:26:45 UTC
From:
To:
On a NIS client where shadow passwords have been temporarily disabled,
the command "shadowconfig on" creates /etc/shadow without the NIS entry

+::::::::

and it also creates /etc/gshadow without the entry

+:::

making NIS not to work at all.

i.e. "shadowconfig off" followed by "shadowconfig on" breaks NIS completely.

As a side effect, this script to enable NIS on a Debian system does no
longer work:

if grep -q -v "+::::::" /etc/passwd; then
  shadowconfig off
  echo "+::::::" >> /etc/passwd
  echo "+:::" >> /etc/group
  shadowconfig on
fi


Also, "shadowconfig off" on a system where NIS is enabled gives this warning:

invalid shadow group file entry
delete line '+:::'?


Both things seem like a regression to me. If I'm mistaken and it's
intentional, please document it properly.


Thanks.

#583593#10
Date:
2010-05-29 11:14:24 UTC
From:
To:
Hmm, sorry, the check would be actually like this:

if ! grep -q "+::::::" /etc/passwd; then
  shadowconfig off
  echo "+::::::" >> /etc/passwd
  echo "+:::" >> /etc/group
  shadowconfig on
fi

This is what worked in lenny and no longer works.

Thanks.