Skip to content

Commit

Permalink
Try to validate filepath and warn if we can't
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Sep 19, 2024
1 parent 1eb1ab6 commit 746372b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libbu/fchmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ bu_fchmod(int fd,
char filepath[MAXPATHLEN+1];
HANDLE h = (HANDLE)_get_osfhandle(fd);
GetFileNameFromHandle(h, filepath);
if (!bu_file_exists(filepath, NULL))
bu_log("Warning: fd %d mapped by GetFileNameFromHandle to %s, but does not exist\n", fd, filepath);

/* quell flawfinder because this is a necessary evil unless/until
* someone rewrites this to use SetNamedSecurityInfo() based on
Expand Down

0 comments on commit 746372b

Please sign in to comment.