chiark / gitweb /
hostnamed: check that nss-myhostname is installed
authorLennart Poettering <lennart@poettering.net>
Mon, 9 May 2011 13:26:08 +0000 (15:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 May 2011 15:19:45 +0000 (17:19 +0200)
TODO
src/hostnamed.c

diff --git a/TODO b/TODO
index 643a111bc929d4cae0b78f0aa48b5997897a62e2..a26bcbcb6c0a4b5191b3f22ca06af219c1cfbde8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -22,6 +22,8 @@ Features:
 * Make it possible to set the keymap independently from the font on
   the kernel cmdline. Right now setting one resets also the other.
 
 * Make it possible to set the keymap independently from the font on
   the kernel cmdline. Right now setting one resets also the other.
 
+* add dbus call to convert snapshot ino target
+
 * make use of TIOCVHANGUP
 
 * move /selinux to /sys/fs/selinux
 * make use of TIOCVHANGUP
 
 * move /selinux to /sys/fs/selinux
index 91a82c8255fa2962b369b9eadb2982fe628a1c7a..ce690453445ba7db8c8605cf483aa7733ce051c7 100644 (file)
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
+#include <dlfcn.h>
 
 #include "util.h"
 #include "strv.h"
 
 #include "util.h"
 #include "strv.h"
@@ -110,6 +111,18 @@ static int read_data(void) {
         return 0;
 }
 
         return 0;
 }
 
+static bool check_nss(void) {
+
+        void *dl;
+
+        if ((dl = dlopen("libnss_myhostname.so.2", RTLD_LAZY))) {
+                dlclose(dl);
+                return true;
+        }
+
+        return false;
+}
+
 static const char* fallback_icon_name(void) {
 
 #if defined(__i386__) || defined(__x86_64__)
 static const char* fallback_icon_name(void) {
 
 #if defined(__i386__) || defined(__x86_64__)
@@ -663,6 +676,9 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
                 goto finish;
         }
 
+        if (!check_nss())
+                log_warning("Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!");
+
         umask(0022);
 
         r = read_data();
         umask(0022);
 
         r = read_data();