library/socket.c
void check_sockdir(const char *path)
{
  struct stat st;

  if (lstat(path, &st) < 0)
    err(110, "stat(\"%s\")", path);
  if (! S_ISDIR(st.st_mode))
    errx(111, "%s is not a directory", path);
  if (st.st_mode & S_IWOTH)
    errx(112, "%s is world-writable", path);
}
// Basic security checks for the IPC directory
Basic security checks for the IPC directory
Basic security checks for the IPC directory
void check_sockdir(const char *path)
{
  struct stat st;
  if (lstat(path, &st) < 0)
    err(110, "stat(\"%s\")", path);
  if (! S_ISDIR(st.st_mode))
    errx(111, "%s is not a directory", path);
  if (st.st_mode & S_IWOTH)
    errx(112, "%s is world-writable", path);
}
void check_sockdir ( const char * path ) { struct stat st ; if ( lstat ( path , & st ) < 0 ) err ( 110 , " \" \" " , path ) ; if ( ! S_ISDIR ( st . st_mode ) ) errx ( 111 , " " , path ) ; if ( st . st_mode & S_IWOTH ) errx ( 112 , " " , path ) ; }
Basic security checks for the IPC directory
Basic security checks for the IPC directory