From 6e223b3f7a7c752d003bf60fbd4dbbfb88395a20 Mon Sep 17 00:00:00 2001 From: john Date: Mon, 17 Aug 2020 15:20:12 +0100 Subject: [PATCH] See issue 19. This should fix the issue if uncommented again. --- src/scans/permissions_scan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scans/permissions_scan.c b/src/scans/permissions_scan.c index 470ac78..3418562 100644 --- a/src/scans/permissions_scan.c +++ b/src/scans/permissions_scan.c @@ -110,7 +110,8 @@ static void check_global_write(All_Results *ar, File_Info *fi) // add_issue(LOW, AUDIT, fi->location, ar, issue_buf, "ENUMY failed to stat the parent directory"); // return; // } - // struct passwd *data = getpwuid(stats.st_uid); + // // John: getpwuid is not re-entrant. Using getpwuid_r should fix this issue. + // struct passwd *data = getpwuid_r(stats.st_uid); // if (data == NULL) // { // log_error_errno_loc(ar, "Failed to stat directory", parent_buf, errno); @@ -319,4 +320,4 @@ static void check_readable_sen_file(All_Results *ar, char *location) /* Check if current non root users can write to fstab */ else if (access(location, R_OK) && (getuid() != 0)) add_issue(HIGH, CTF, location, ar, "Current user can read from very important file", ""); -} \ No newline at end of file +}