2005-12-14 Robert Love <rml@novell.com>
Patch from Stefan Scheler <sscheler@suse.de>: * src/NetworkManagerDevice.c: call backend code to activate and deactivate NIS. * src/NetworkManagerSystem.h: add new NIS interfaces. * src/backends/NetworkManagerDebian.c, src/backends/NetworkManagerGentoo.c, src/backends/NetworkManagerRedHat.c, src/backends/NetworkManagerSlackware.c: add stub functions for NIS support. * src/backends/NetworkManagerSuSE.c: add NIS support, baby. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1186 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
13
ChangeLog
13
ChangeLog
@@ -1,3 +1,16 @@
|
|||||||
|
2005-12-14 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
|
Patch from Stefan Scheler <sscheler@suse.de>:
|
||||||
|
* src/NetworkManagerDevice.c: call backend code to activate and
|
||||||
|
deactivate NIS.
|
||||||
|
* src/NetworkManagerSystem.h: add new NIS interfaces.
|
||||||
|
* src/backends/NetworkManagerDebian.c,
|
||||||
|
src/backends/NetworkManagerGentoo.c,
|
||||||
|
src/backends/NetworkManagerRedHat.c,
|
||||||
|
src/backends/NetworkManagerSlackware.c: add stub functions for NIS
|
||||||
|
support.
|
||||||
|
* src/backends/NetworkManagerSuSE.c: add NIS support, baby.
|
||||||
|
|
||||||
2005-12-14 Dan Williams <dcbw@redhat.com>
|
2005-12-14 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/nm-ap-security*.[ch]
|
* src/nm-ap-security*.[ch]
|
||||||
|
@@ -3162,6 +3162,7 @@ static gboolean nm_device_activate_stage5_ip_config_commit (NMActRequest *req)
|
|||||||
nm_device_update_ip4_address (dev);
|
nm_device_update_ip4_address (dev);
|
||||||
nm_system_device_add_ip6_link_address (dev);
|
nm_system_device_add_ip6_link_address (dev);
|
||||||
nm_system_restart_mdns_responder ();
|
nm_system_restart_mdns_responder ();
|
||||||
|
nm_system_activate_nis (dev->ip4_config);
|
||||||
nm_device_set_link_active (dev, nm_device_probe_link_state (dev));
|
nm_device_set_link_active (dev, nm_device_probe_link_state (dev));
|
||||||
nm_policy_schedule_activation_finish (req);
|
nm_policy_schedule_activation_finish (req);
|
||||||
}
|
}
|
||||||
@@ -3377,6 +3378,8 @@ gboolean nm_device_deactivate_quickly (NMDevice *dev)
|
|||||||
g_return_val_if_fail (dev != NULL, FALSE);
|
g_return_val_if_fail (dev != NULL, FALSE);
|
||||||
g_return_val_if_fail (dev->app_data != NULL, FALSE);
|
g_return_val_if_fail (dev->app_data != NULL, FALSE);
|
||||||
|
|
||||||
|
nm_system_shutdown_nis ();
|
||||||
|
|
||||||
nm_vpn_manager_deactivate_vpn_connection (dev->app_data->vpn_manager, dev);
|
nm_vpn_manager_deactivate_vpn_connection (dev->app_data->vpn_manager, dev);
|
||||||
|
|
||||||
if (nm_device_is_activated (dev))
|
if (nm_device_is_activated (dev))
|
||||||
|
@@ -73,4 +73,7 @@ GSList * nm_system_get_dialup_config (void);
|
|||||||
void nm_system_deactivate_all_dialup (GSList *list);
|
void nm_system_deactivate_all_dialup (GSList *list);
|
||||||
gboolean nm_system_activate_dialup (GSList *list, const char *dialup);
|
gboolean nm_system_activate_dialup (GSList *list, const char *dialup);
|
||||||
|
|
||||||
|
void nm_system_activate_nis (NMIP4Config *config);
|
||||||
|
void nm_system_shutdown_nis (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -717,3 +717,24 @@ GSList * nm_system_get_dialup_config (void)
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_activate_nis
|
||||||
|
*
|
||||||
|
* set up the nis domain and write a yp.conf
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_activate_nis (NMIP4Config *config)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_shutdown_nis
|
||||||
|
*
|
||||||
|
* shutdown ypbind
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_shutdown_nis (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -521,3 +521,24 @@ GSList * nm_system_get_dialup_config (void)
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_activate_nis
|
||||||
|
*
|
||||||
|
* set up the nis domain and write a yp.conf
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_activate_nis (NMIP4Config *config)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_shutdown_nis
|
||||||
|
*
|
||||||
|
* shutdown ypbind
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_shutdown_nis (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -820,3 +820,24 @@ GSList * nm_system_get_dialup_config (void)
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_activate_nis
|
||||||
|
*
|
||||||
|
* set up the nis domain and write a yp.conf
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_activate_nis (NMIP4Config *config)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_shutdown_nis
|
||||||
|
*
|
||||||
|
* shutdown ypbind
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_shutdown_nis (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -359,3 +359,24 @@ gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
|
|||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_activate_nis
|
||||||
|
*
|
||||||
|
* set up the nis domain and write a yp.conf
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_activate_nis (NMIP4Config *config)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_shutdown_nis
|
||||||
|
*
|
||||||
|
* shutdown ypbind
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_shutdown_nis (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -822,3 +822,64 @@ out_gfree:
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_activate_nis
|
||||||
|
*
|
||||||
|
* set up the nis domain and write a yp.conf
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_activate_nis (NMIP4Config *config)
|
||||||
|
{
|
||||||
|
gchar *nis_domain = NULL;
|
||||||
|
int num_nis_servers = 0;
|
||||||
|
struct in_addr temp_addr;
|
||||||
|
int i, ret;
|
||||||
|
FILE *ypconf = NULL;
|
||||||
|
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
|
||||||
|
nis_domain = nm_ip4_config_get_nis_domain(config);
|
||||||
|
num_nis_servers = nm_ip4_config_get_num_nis_servers(config);
|
||||||
|
|
||||||
|
/* set the nis domain */
|
||||||
|
if (nis_domain && setdomainname (nis_domain, strlen (nis_domain)) < 0)
|
||||||
|
nm_warning ("Could not set nis domain name.");
|
||||||
|
|
||||||
|
/* write out yp.conf and restart the daemon */
|
||||||
|
if (num_nis_servers > 0)
|
||||||
|
{
|
||||||
|
ypconf = fopen ("/etc/yp.conf", "w");
|
||||||
|
|
||||||
|
if (ypconf)
|
||||||
|
{
|
||||||
|
fprintf (ypconf, "# generated by NetworkManager, do not edit!\n\n");
|
||||||
|
for (i = 0; i < num_nis_servers; i++) {
|
||||||
|
temp_addr.s_addr = nm_ip4_config_get_nis_server (config, i);
|
||||||
|
fprintf (ypconf, "domain %s server %s\n", nis_domain, inet_ntoa (temp_addr));
|
||||||
|
}
|
||||||
|
fprintf (ypconf, "\n");
|
||||||
|
fclose (ypconf);
|
||||||
|
} else
|
||||||
|
nm_warning ("Could not commit NIS changes to /etc/yp.conf.");
|
||||||
|
nm_info ("Restarting ypbind.");
|
||||||
|
nm_spawn_process ("/usr/sbin/rcypbind restart");
|
||||||
|
nm_info ("Restarting autofs.");
|
||||||
|
nm_spawn_process ("/usr/sbin/rcautofs restart");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nm_system_shutdown_nis
|
||||||
|
*
|
||||||
|
* shutdown ypbind
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void nm_system_shutdown_nis (void)
|
||||||
|
{
|
||||||
|
nm_info ("Stopping ypbind.");
|
||||||
|
nm_spawn_process ("/usr/sbin/rcypbind stop");
|
||||||
|
nm_info ("Restarting autofs.");
|
||||||
|
nm_spawn_process ("/usr/sbin/rcautofs restart");
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user