diff --git a/conmon/conmon.c b/conmon/conmon.c index d0fd9a90..733292d1 100644 --- a/conmon/conmon.c +++ b/conmon/conmon.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -549,6 +550,8 @@ int main(int argc, char *argv[]) csfd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); if (csfd < 0) pexit("Failed to create console-socket"); + if (fchmod(csfd, 0700)) + pexit("Failed to change console-socket permissions"); /* XXX: This should be handled with a rename(2). */ if (unlink(csname) < 0) pexit("Failed to unlink temporary ranom path");