Description of problem: ypinit does not properly detect cases where a domainname is not set. Version-Release number of selected component (if applicable):ypbind-1.32-8.fc15.1 How reproducible: do not set domain name, or unset domain name. run "ypinit -m". Directory structure called "(none)" shows in /var/yp, domainname returns "(none)" Steps to Reproduce: 1. Vanilla System 2. Run "ypinit -m" 3. Test "domainname" and directory structure in /var/yp Actual results: domainname returns "(none)", maps will attempt to be built under "(none)" directory in /var/yp. Expected results: ypinit should exit with the proper message of "Domain Name not set" Additional info: Will submit updated script to package owner possibly correcting the issue.
[spetry@nyfinhost1 ~]$ git diff ypinit ./ypinit diff --git a/ypinit b/ypinit index 3c0dc1c..c76c849 100755 --- a/ypinit +++ b/ypinit @@ -149,15 +149,14 @@ then exit 1 fi -DOMAIN=`domainname` -if [ $? -ne 0 ] -then - echo "Can't find domainname. Please fix your PATH" +if [ -x /bin/domainname ] ; then + DOMAIN=`domainname` +else + echo "'domainname' command not found. Exiting." exit 1 fi -if [ -z "$DOMAIN" ] -then +if [ "${DOMAIN}x" = "x" ] || [ "${DOMAIN}" = "(none)" ] ; then echo "The local host's domain name hasn't been set. Please set it." exit 1 fi
Created attachment 531826 [details] Modified ypinit script diff is included in comments.
It would be relatively easy for me to change the ypinit script to read in /etc/sysconfig/network to determine if NISDOMAIN or YPDOMAIN is set. An option of setting the domain name inside the script could be presented to the user. In addition, I would also be able to add functionality to the ypinit script to update the NISDOMAIN in /etc/sysconfig/network, similar to Sun's original functionality with ypinit where an /etc/defaultdomain is created. This would record the settings for next boot without manual intervention. Please let me know if you want me to proceed with the additions.
Hi Shannon, thanks for the suggested fix. I've already applied the following change into Rawhide and will update it in f16 soon: -if [ -z "$DOMAIN" ] +if [ "${DOMAIN}x" = "x" ] || [ "${DOMAIN}" = "(none)" ] However, I don't think it is really necessary to apply the other one, since I don't see any use case when it should help something. If you do, describe the use case a bit, please.
ypserv-2.26-7.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/ypserv-2.26-7.fc16
ypserv-2.24-6.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/ypserv-2.24-6.fc15
ypserv-2.26-8.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/ypserv-2.26-8.fc16
Package ypserv-2.26-8.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing ypserv-2.26-8.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-16503/ypserv-2.26-8.fc16 then log in and leave karma (feedback).
ypserv-2.24-6.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
ypserv-2.26-8.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.