chiark / gitweb /
main: disable NSS disabling logic for now, since this is incompatible with rpm
[elogind.git] / src / hostname-setup.c
index 3b988d4c8b68dfdad2c25c545d736e0adb4b470a..e0257166d8c267094c918d5f419a1890fabced34 100644 (file)
@@ -30,8 +30,6 @@
 #include "util.h"
 #include "log.h"
 
-#define LINE_MAX 4096
-
 #if defined(TARGET_FEDORA)
 #define FILENAME "/etc/sysconfig/network"
 #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
@@ -52,7 +50,8 @@ static char* strip_bad_chars(char *s) {
                     (*p >= 'A' && *p <= 'Z') ||
                     (*p >= '0' && *p <= '9') ||
                     *p == '-' ||
-                    *p == '_')
+                    *p == '_' ||
+                    *p == '.')
                         *(d++) = *p;
 
         *d = 0;
@@ -102,10 +101,11 @@ static int read_hostname(char **hn) {
                 }
 
                 *hn = k;
-                break;
+                r = 0;
+                goto finish;
         }
 
-        r = 0;
+        r = -ENOENT;
 
 finish:
         fclose(f);