2005-01-14 Colin Walters <walters@redhat.com>

* named/nm-named-manager.c (generate_named_conf): Write config
	and pid files into NM_NAMED_DATA_DIR; this allows things to
	work better with FC3 named SELinux policy.  Also fix up silly
	format error.

	* configure.in: Add --with-named-dir option.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@376 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Colin Walters 2005-01-14 18:43:47 +00:00 committed by Colin Walters
parent e59eda1c5e
commit 0229295c83
3 changed files with 38 additions and 7 deletions

View file

@ -1,3 +1,12 @@
2005-01-14 Colin Walters <walters@redhat.com>
* named/nm-named-manager.c (generate_named_conf): Write config
and pid files into NM_NAMED_DATA_DIR; this allows things to
work better with FC3 named SELinux policy. Also fix up silly
format error.
* configure.in: Add --with-named-dir option.
2005-01-14 Colin Walters <walters@redhat.com>
* configure.in: Make named support require passing --with-named.

View file

@ -158,10 +158,12 @@ AC_SUBST(DBUS_SYS_DIR)
AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])
AC_ARG_WITH(named, AC_HELP_STRING([--with-named=<path>], [path to the named binary]))
AC_ARG_WITH(named_dir, AC_HELP_STRING([--with-named-dir=<path>], [path to the named data directory]))
if test "x${with_named}" = x; then
AC_DEFINE(NM_NO_NAMED,,[Define if you want to disable named support])
fi
AC_DEFINE_UNQUOTED(NM_NAMED_BINARY_PATH, "$with_named", [Define to path of named binary])
AC_DEFINE_UNQUOTED(NM_NAMED_DATA_DIR, "$with_named_dir", [Define to path of named data directory])
AC_ARG_ENABLE(notification-icon, [ --enable-notification-icon builds the wireless applet as a notification icon], enable_notification_icon=$enableval, enable_notification_icon=yes)

View file

@ -232,21 +232,41 @@ generate_named_conf (NMNamedManager *mgr, GError **error)
if (!mgr->priv->named_conf)
{
out_fd = g_file_open_tmp ("NetworkManager-named.conf-XXXXXX",
&mgr->priv->named_conf,
error);
mgr->priv->named_conf = g_build_filename (NM_NAMED_DATA_DIR,
"NetworkManager-named.conf",
NULL);
unlink (mgr->priv->named_conf);
out_fd = open (mgr->priv->named_conf, O_CREAT|O_EXCL, 0600);
if (out_fd < 0)
{
g_set_error (error,
G_FILE_ERROR,
G_FILE_ERROR_EXIST,
"Couldn't create %s: %s",
mgr->priv->named_conf,
g_strerror (errno));
return FALSE;
}
close (out_fd);
}
if (!mgr->priv->named_pid_file)
{
out_fd = g_file_open_tmp ("NetworkManager-named-pid-XXXXXX",
&mgr->priv->named_pid_file,
error);
mgr->priv->named_pid_file = g_build_filename (NM_NAMED_DATA_DIR,
"NetworkManager-pid-named",
NULL);
unlink (mgr->priv->named_pid_file);
out_fd = open (mgr->priv->named_pid_file, O_CREAT|O_EXCL, 0600);
if (out_fd < 0)
{
g_set_error (error,
G_FILE_ERROR,
G_FILE_ERROR_EXIST,
"Couldn't create %s: %s",
mgr->priv->named_pid_file,
g_strerror (errno));
return FALSE;
}
close (out_fd);
}
@ -525,7 +545,7 @@ rewrite_resolv_conf (NMNamedManager *mgr, GError **error)
goto lose;
}
#ifndef NM_NO_NAMED
if (fprintf (f, "%s", "; Use a local caching nameserver controlled by NetworkManager\n", searches, "\nnameserver 127.0.0.1\n") < 0) {
if (fprintf (f, "%s%s%s", "; Use a local caching nameserver controlled by NetworkManager\n", searches, "\nnameserver 127.0.0.1\n") < 0) {
goto lose;
}
#else