فهرست منبع

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)