mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Prefer S_I?USR and S_IRWXU over obsolete S_IREAD, S_IWRITE, S_IEXEC.
This commit is contained in:
parent
88de36b8d2
commit
151bcbd3a2
@ -657,14 +657,14 @@ open_bittorrent_file(struct bittorrent_meta *meta, struct bittorrent_file *file,
|
||||
|
||||
if (!name) return -1;
|
||||
|
||||
fd = open(name, flags, S_IREAD | S_IWRITE);
|
||||
fd = open(name, flags, S_IRUSR | S_IWUSR);
|
||||
if (fd == -1) {
|
||||
/* 99% of the time the file will already exist so special case
|
||||
* the directory and file creation. */
|
||||
if (errno == ENOENT
|
||||
&& trans == BITTORRENT_WRITE
|
||||
&& create_bittorrent_path(name) == BITTORRENT_STATE_OK)
|
||||
fd = open(name, flags | O_CREAT, S_IREAD | S_IWRITE);
|
||||
fd = open(name, flags | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
}
|
||||
|
||||
mem_free(name);
|
||||
|
@ -299,7 +299,7 @@ execute_cgi(struct connection *conn)
|
||||
scriptlen = strlen(script);
|
||||
|
||||
if (stat(script, &buf) || !(S_ISREG(buf.st_mode))
|
||||
|| !(buf.st_mode & S_IEXEC)) {
|
||||
|| !(buf.st_mode & S_IXUSR)) {
|
||||
mem_free(script);
|
||||
return 1;
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ mkalldirs(const unsigned char *path)
|
||||
|
||||
p[pos] = 0;
|
||||
|
||||
ret = mkdir(p, S_IREAD | S_IWRITE | S_IEXEC);
|
||||
ret = mkdir(p, S_IRWXU);
|
||||
|
||||
p[pos] = separator;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user