2006-05-16 Robert Love <rml@novell.com>
* src/backends/NetworkManagerSuSE.c: Don't touch ypbind or autofs unless dhcp:DHCLIENT_MODIFY_NIS_CONF is set to "yes". git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1737 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1089,8 +1089,7 @@ void nm_system_activate_nis (NMIP4Config *config)
|
||||
{
|
||||
shvarFile *file;
|
||||
const char *nis_domain;
|
||||
char *name, *buf = NULL;
|
||||
int num_nis_servers = 0;
|
||||
char *name, *buf;
|
||||
struct in_addr temp_addr;
|
||||
int i;
|
||||
FILE *ypconf = NULL;
|
||||
@@ -1117,12 +1116,15 @@ void nm_system_activate_nis (NMIP4Config *config)
|
||||
goto out_close;
|
||||
|
||||
if (!strcmp (buf, "yes")) {
|
||||
int num_nis_servers;
|
||||
|
||||
num_nis_servers = nm_ip4_config_get_num_nis_servers(config);
|
||||
/* write out yp.conf and restart the daemon */
|
||||
if (num_nis_servers > 0)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
/* write out yp.conf and restart the daemon */
|
||||
|
||||
ypconf = fopen ("/etc/yp.conf", "w");
|
||||
|
||||
if (ypconf)
|
||||
@@ -1166,20 +1168,42 @@ out_gfree:
|
||||
*/
|
||||
void nm_system_shutdown_nis (void)
|
||||
{
|
||||
struct stat sb;
|
||||
char *name, *buf = NULL;
|
||||
shvarFile *file;
|
||||
|
||||
if (stat ("/usr/sbin/rcypbind", &sb) != -1)
|
||||
{
|
||||
nm_info ("Stopping ypbind.");
|
||||
nm_spawn_process ("/usr/sbin/rcypbind stop");
|
||||
}
|
||||
if (stat ("/usr/sbin/rcautofs", &sb) != -1)
|
||||
{
|
||||
nm_info ("Restarting autofs.");
|
||||
nm_spawn_process ("/usr/sbin/rcautofs restart");
|
||||
name = g_strdup_printf (SYSCONFDIR"/sysconfig/network/dhcp");
|
||||
file = svNewFile (name);
|
||||
if (!file)
|
||||
goto out_gfree;
|
||||
|
||||
buf = svGetValue (file, "DHCLIENT_MODIFY_NIS_CONF");
|
||||
if (!buf)
|
||||
goto out_close;
|
||||
|
||||
if (!strcmp (buf, "yes")) {
|
||||
struct stat sb;
|
||||
|
||||
if (stat ("/usr/sbin/rcypbind", &sb) != -1)
|
||||
{
|
||||
nm_info ("Stopping ypbind.");
|
||||
nm_spawn_process ("/usr/sbin/rcypbind stop");
|
||||
}
|
||||
|
||||
if (stat ("/usr/sbin/rcautofs", &sb) != -1)
|
||||
{
|
||||
nm_info ("Restarting autofs.");
|
||||
nm_spawn_process ("/usr/sbin/rcautofs restart");
|
||||
}
|
||||
}
|
||||
|
||||
free (buf);
|
||||
out_close:
|
||||
svCloseFile (file);
|
||||
out_gfree:
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_system_set_hostname
|
||||
*
|
||||
|
Reference in New Issue
Block a user