diff --git a/src/protocol/bittorrent/piececache.c b/src/protocol/bittorrent/piececache.c index 340d6f99f..3c2dc0b60 100644 --- a/src/protocol/bittorrent/piececache.c +++ b/src/protocol/bittorrent/piececache.c @@ -676,14 +676,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); diff --git a/src/protocol/file/cgi.c b/src/protocol/file/cgi.c index 74e3c9b8b..67d8744af 100644 --- a/src/protocol/file/cgi.c +++ b/src/protocol/file/cgi.c @@ -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; }