30 |
if (mkdir(hd, S_IRUSR | S_IWUSR | S_IXUSR)) |
if (mkdir(hd, S_IRUSR | S_IWUSR | S_IXUSR)) |
31 |
error("could not create directory %s; %s\n", hd, |
error("could not create directory %s; %s\n", hd, |
32 |
strerror(errno)); |
strerror(errno)); |
33 |
|
} else { |
34 |
|
check_dir_perms(hd, S_IRUSR | S_IWUSR | S_IXUSR); |
35 |
} |
} |
36 |
return 0; |
return 0; |
37 |
} |
} |
131 |
|
|
132 |
/* |
/* |
133 |
* Check the permissions of a directory. |
* Check the permissions of a directory. |
134 |
* |
*/ |
135 |
int |
int |
136 |
check_dir_perms(char *dname, mode_t mode) |
check_dir_perms(char *dname, mode_t mode) |
137 |
{ |
{ |
151 |
} |
} |
152 |
if ((ds.st_mode & 00777) != mode) { |
if ((ds.st_mode & 00777) != mode) { |
153 |
error("warning: dir's %s mode should be %o not %o\n", dname, |
error("warning: dir's %s mode should be %o not %o\n", dname, |
154 |
mode, ds.st_mode & 00777); |
mode, ds.st_mode & 00777); |
155 |
return ERROR_TRIVIAL; |
return ERROR_TRIVIAL; |
156 |
} |
} |
157 |
return 0; |
return 0; |
158 |
}*/ |
} |