server/admin.c (a_init): Abort if we can't set socket permissions.
[tripe] / server / admin.c
index 7aa1678..32b3577 100644 (file)
@@ -2275,11 +2275,13 @@ again:
     close(fd);
     goto again;
   }
-  chmod(sun.sun_path, 0600);
+  if (chmod(sun.sun_path, 0600)) {
+    die(EXIT_FAILURE, "failed to set socket permissions: %s",
+       strerror(errno));
+  }
   if (chown(sun.sun_path, u, g)) {
-    T( trace(T_ADMIN,
-            "admin: failed to give away socket: %s",
-            strerror(errno)); )
+    die(EXIT_FAILURE, "failed to set socket owner: %s",
+       strerror(errno));
   }
   umask(omask);
   fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);