rpms/ypbind/F-12 ypbind-mt-1.20.4-network.patch, NONE, 1.1 ypbind.spec, 1.63, 1.64

Karel Klíč kklic at fedoraproject.org
Thu Oct 29 14:03:56 UTC 2009


Author: kklic

Update of /cvs/extras/rpms/ypbind/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10138

Modified Files:
	ypbind.spec 
Added Files:
	ypbind-mt-1.20.4-network.patch 
Log Message:
Bind to domain even if not using NetworkManager

ypbind-mt-1.20.4-network.patch:
 ypbind-mt.c |   45 ++++++++++++++++++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 11 deletions(-)

--- NEW FILE ypbind-mt-1.20.4-network.patch ---
diff -up ypbind-mt-1.20.4/src/ypbind-mt.c.network ypbind-mt-1.20.4/src/ypbind-mt.c
--- ypbind-mt-1.20.4/src/ypbind-mt.c.network	2009-10-29 11:53:00.265296485 +0100
+++ ypbind-mt-1.20.4/src/ypbind-mt.c	2009-10-29 11:53:00.269297063 +0100
@@ -297,6 +299,25 @@ load_config (int check_syntax)
   return 0;
 }
 
+
+/* Load the configuration, exiting if there's an error */
+static void
+load_config_or_exit(void)
+{
+  if (load_config (0) != 0)
+    {
+      fputs (_("No NIS server and no -broadcast option specified.\n"),
+	     stderr);
+      fprintf (stderr,
+	       _("Add a NIS server to the %s configuration file,\n"),
+	       configfile);
+      fputs (_("or start ypbind with the -broadcast option.\n"),
+	     stderr);
+      exit (1);
+    }
+}
+
+
 /* Create a pidfile on startup */
 static void
 create_pidfile (void)
@@ -765,18 +803,22 @@ main (int argc, char **argv)
 	       BINDINGDIR, strerror (errno));
       exit (1);
     }
-  /*
-   * Load config if we're not using DBUS/NetworkManager, since we
-   * assume the network is available now.  If we're using NetworkManager,
-   * the config will be loaded when a network becomes available.
-   */
-  if (disable_dbus)
-    {
-      /* Load the configuration.  If the load fails, set up broadcast mode. */
-      if (!use_broadcast && (load_config (0) != 0))
-        use_broadcast = 1;
+
+  if (!use_broadcast)
+    {
+#ifdef USE_DBUS_NM
+      /* If we don't use DBUS, exit with an error if we cannot load the
+	 config. Else load the config, maybe there is a network already
+	 running. */
+      if (disable_dbus)
+	load_config_or_exit ();
+      else
+	load_config (0);
+#else
+      load_config_or_exit ();
+#endif
     }
-  if (use_broadcast)
+  else
     add_server (domain, NULL, 0);
 
   unlink_bindingdir ();


Index: ypbind.spec
===================================================================
RCS file: /cvs/extras/rpms/ypbind/F-12/ypbind.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -p -r1.63 -r1.64
--- ypbind.spec	27 Jul 2009 08:55:46 -0000	1.63
+++ ypbind.spec	29 Oct 2009 14:03:56 -0000	1.64
@@ -1,7 +1,7 @@
 Summary: The NIS daemon which binds NIS clients to an NIS domain
 Name: ypbind
 Version: 1.20.4
-Release: 19%{?dist}
+Release: 20%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2
@@ -15,6 +15,7 @@ Patch4: ypbind-mt-1.20.4-log-binds.patch
 Patch5: ypbind-mt-1.20.4-smartwrite.patch
 Patch6: ypbind-mt-1.20.4-man-port.patch
 Patch7: ypbind-mt-1.20.4-nm.patch
+Patch8: ypbind-mt-1.20.4-network.patch
 
 Requires(post): chkconfig
 Requires(preun): chkconfig
@@ -53,6 +54,7 @@ also need to install the ypserv package 
 %patch5 -p1 -b .smartwrite
 %patch6 -p1 -b .man-port
 %patch7 -p1 -b .nm
+%patch8 -p1 -b .network
 
 %build
 %configure --sbindir=/sbin
@@ -97,6 +99,11 @@ fi
 %doc README NEWS
 
 %changelog
+* Thu Oct 29 2009 Karel Klic <kklic at redhat.com> - 3:1.20.4-20
+- Bind to domain even if not using NetworkManager
+  The fix uses  only the code from upstream ypbind-mt-1.29.91
+  Resolves: #531398
+
 * Mon Jul 27 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3:1.20.4-19
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list