Compare commits

...

9 Commits
rawhide ... f12

Author SHA1 Message Date
Fedora Release Engineering 5b24a5985d dist-git conversion 2010-07-29 16:22:31 +00:00
Karel Klíč 4bed50269d Fixed #593278 2010-05-19 14:44:31 +00:00
Karel Klíč c3750f49b8 use cp+rm instead of mv in nis.sh (#509240) 2010-04-15 14:48:56 +00:00
Karel Klíč dc39044280 Improved -nm patch to go online when no connection is available 2010-04-15 12:57:42 +00:00
Bill Nottingham c7b5c5d5ea Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:12:29 +00:00
Karel Klíč 5f4cec05c8 response from the upstream 2009-11-19 10:30:11 +00:00
Karel Klíč 32c36866f4 added signalstate patch, fixes compilation with NetworkManaged-devel
headers installed. Resolves #537064 (F-12, devel)
2009-11-13 14:39:28 +00:00
Karel Klíč 5a60cdbb17 Bind to domain even if not using NetworkManager 2009-10-29 14:03:56 +00:00
Jesse Keating 11888c8840 Initialize branch F-12 for ypbind 2009-09-29 07:27:49 +00:00
7 changed files with 142 additions and 32 deletions

View File

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: ypbind
# $Id: Makefile,v 1.1 2004/09/09 15:12:10 cvsdist Exp $
NAME := ypbind
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

16
nis.sh
View File

@ -38,12 +38,15 @@ save_config_file() {
fi
if [ -e ${origfile} ]; then
mv ${origfile} ${savefile}
# cp+rm instead of mv: preserve SELinux context
# rhbz#509240
cp -c ${origfile} ${savefile}
rm ${origfile}
else
echo > ${savefile}
fi
fixContext ${savefile}
fixContext ${savefile} # TODO: is it really needed?
}
nis_config() {
@ -53,6 +56,7 @@ nis_config() {
save_config_file ${CONF}
let contents=0
echo '# generated by /sbin/dhclient-script' > ${CONF}
fixContext ${CONF}
if [ -n "${new_nis_servers}" ]; then
for i in ${new_nis_servers} ; do
@ -73,6 +77,7 @@ nis_config() {
elif [ -n "${new_nis_servers}" ]; then
save_config_file ${CONF}
echo '# generated by /sbin/dhclient-script' > ${CONF}
fixContext ${CONF}
let contents=0
for i in ${new_nis_servers} ; do
@ -94,8 +99,11 @@ nis_restore() {
if [ ! "${PEERNIS}" = "no" ]; then
if [ -f ${SAVEDIR}/${CONF}.predhclient.${interface} ]; then
rm -f ${CONF}
mv -f ${SAVEDIR}/${CONF}.predhclient.${interface} ${CONF}
fixContext /etc/yp.conf
# cp+rm instead of mv: preserve SELinux context
# rhbz#509240
cp -c ${SAVEDIR}/${CONF}.predhclient.${interface} ${CONF}
rm ${SAVEDIR}/${CONF}.predhclient.${interface}
fixContext ${CONF}
if [ -x /etc/rc.d/init.d/ypbind ] && [ -r /var/run/ypbind.pid ]; then
service ypbind restart >/dev/null 2>&1
fi

View File

@ -0,0 +1,63 @@
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 ();

View File

@ -1,26 +1,35 @@
diff -up ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.nm ypbind-mt-1.20.4/src/ypbind_dbus_nm.c
--- ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.nm 2007-02-14 14:01:57.000000000 +0100
+++ ypbind-mt-1.20.4/src/ypbind_dbus_nm.c 2009-01-26 16:05:58.000000000 +0100
+++ ypbind-mt-1.20.4/src/ypbind_dbus_nm.c 2010-04-15 14:25:22.661754059 +0200
@@ -320,13 +320,13 @@ dbus_init (void)
if (check_online (connection) == 1)
{
if (debug_flag)
- log_msg (LOG_DEBUG, "Are already online");
- is_online = 1;
+ log_msg (LOG_DEBUG, "Network is available now");
+ go_online();
+ log_msg (LOG_DEBUG, "Network is available.");
+ go_online ();
}
else
{
if (debug_flag)
- log_msg (LOG_DEBUG, "Are offline");
+ log_msg (LOG_DEBUG, "No network is available now");
+ log_msg (LOG_DEBUG, "No network is available. Waiting...");
is_online = 0;
}
return 1;
@@ -335,7 +335,7 @@ dbus_init (void)
{
if (debug_flag)
log_msg (LOG_DEBUG, "No connection possible, assume online mode");
- is_online = 1;
+ go_online ();
return 0;
}
}
diff -up ypbind-mt-1.20.4/src/ypbind-mt.c.nm ypbind-mt-1.20.4/src/ypbind-mt.c
--- ypbind-mt-1.20.4/src/ypbind-mt.c.nm 2009-01-26 16:05:58.000000000 +0100
+++ ypbind-mt-1.20.4/src/ypbind-mt.c 2009-01-26 16:05:58.000000000 +0100
--- ypbind-mt-1.20.4/src/ypbind-mt.c.nm 2010-04-15 14:04:29.869877527 +0200
+++ ypbind-mt-1.20.4/src/ypbind-mt.c 2010-04-15 14:27:54.874878127 +0200
@@ -765,9 +765,17 @@ main (int argc, char **argv)
BINDINGDIR, strerror (errno));
exit (1);

View File

@ -0,0 +1,26 @@
diff -up ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.signalstate ypbind-mt-1.20.4/src/ypbind_dbus_nm.c
--- ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.signalstate 2009-11-13 12:32:30.639389786 +0100
+++ ypbind-mt-1.20.4/src/ypbind_dbus_nm.c 2009-11-13 12:34:30.429263750 +0100
@@ -34,11 +34,12 @@
#ifdef HAVE_NETWORKMANAGER_NETWORKMANAGER_H
#include <NetworkManager/NetworkManager.h>
+#include <NetworkManager/NetworkManagerVPN.h>
#else
#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager"
#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
-#define NM_DBUS_SIGNAL_STATE_CHANGE "StateChange"
+#define NM_DBUS_VPN_SIGNAL_STATE_CHANGE "StateChange"
typedef enum NMState {
NM_STATE_UNKNOWN = 0,
@@ -138,7 +139,7 @@ dbus_filter (DBusConnection *connection,
handled = DBUS_HANDLER_RESULT_HANDLED;
}
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE,
- NM_DBUS_SIGNAL_STATE_CHANGE))
+ NM_DBUS_VPN_SIGNAL_STATE_CHANGE))
{
NMState state = NM_STATE_UNKNOWN;

View File

@ -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: 24%{?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,10 @@ 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
# Response from upstream: the patch will be a part of next release.
# Fixes bug #537064.
Patch9: ypbind-mt-1.20.4-signalstate.patch
Requires(post): chkconfig
Requires(preun): chkconfig
@ -53,6 +57,8 @@ also need to install the ypserv package to a machine on your network.
%patch5 -p1 -b .smartwrite
%patch6 -p1 -b .man-port
%patch7 -p1 -b .nm
%patch8 -p1 -b .network
%patch9 -p1 -b .signalstate
%build
%configure --sbindir=/sbin
@ -97,6 +103,25 @@ fi
%doc README NEWS
%changelog
* Wed May 19 2010 Karel Klic <kklic@redhat.com> - 3:1.20.4-24
- Update SELinux context of /etc/yp.conf in nis.sh (rhbz#593278)
* Thu Apr 15 2010 Karel Klic <kklic@redhat.com> - 3:1.20.4-23
- use cp+rm instead of mv in nis.sh (#509240)
* Thu Apr 15 2010 Karel Klic <kklic@redhat.com> - 3:1.20.4-22
- Improved -nm patch to go online when no connection is available
#480096
* Fri Nov 13 2009 Karel Klic <kklic@redhat.com> - 3:1.20.4-21
- Added signalstate patch, which fixes compilation with
NetworkManaged-devel headers installed. Resolves #537064.
* Thu Oct 29 2009 Karel Klic <kklic@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@lists.fedoraproject.org> - 3:1.20.4-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild