瀏覽代碼

fchmod is not available for Windows

bel2125 3 年之前
父節點
當前提交
77a115665f
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/civetweb.c

+ 4 - 0
src/civetweb.c

@@ -8939,9 +8939,13 @@ mg_modify_passwords_file_ha1(const char *fname,
 		return 0;
 	}
 
+#if !defined(_WIN32)
+	/* On Linux & co., restrict file read/write permissions to the owner */
 	if (fchmod(fileno(fp), S_IRUSR | S_IWUSR) != 0) {
 		result = 0;
 	}
+#endif
+
 	if ((temp_file != NULL) && (temp_file_offs > 0)) {
 		/* Store buffered content of old file */
 		if (fwrite(temp_file, 1, temp_file_offs, fp)