From 35e0ffd6189b1f7871884094a245fc071d32cf99 Mon Sep 17 00:00:00 2001 From: "Stiliyan Tonev (Bark)" Date: Fri, 30 Aug 2024 14:54:14 +0300 Subject: [PATCH] Do not attempt chmod on windows. --- libfreshclam/libfreshclam.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libfreshclam/libfreshclam.c b/libfreshclam/libfreshclam.c index e99257d08..c4f507763 100644 --- a/libfreshclam/libfreshclam.c +++ b/libfreshclam/libfreshclam.c @@ -150,6 +150,7 @@ int fc_upsert_logg_file(fc_config *fcConfig) ret = -1; goto cleanup; } +#ifndef _WIN32 if (current_user->pw_uid != db_owner->pw_uid) { if (lchown(current_path, db_owner->pw_uid, db_owner->pw_gid) == -1) { printf("ERROR: Failed to change owner of %s to %s. Will continue without writing in %s.\n", current_path, fcConfig->dbOwner, fcConfig->logFile); @@ -157,6 +158,7 @@ int fc_upsert_logg_file(fc_config *fcConfig) goto cleanup; } } +#endif /* _WIN32 */ } strcat(current_path, PATHSEP); } @@ -165,7 +167,9 @@ int fc_upsert_logg_file(fc_config *fcConfig) ret = -1; goto cleanup; } +#ifndef _WIN32 lchown(fcConfig->logFile, db_owner->pw_uid, db_owner->pw_gid); +#endif /* _WIN32 */ cleanup: if (token != NULL) {