chiark / gitweb /
server/admin.c (a_init): Abort if we can't set socket permissions.
[tripe] / server / admin.c
index 7aa1678d33143cb90b21d1dafc06f08e00e36330..32b35772fc52788792859a3c63b2974b690f6e5a 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);