Skip to content

Commit

Permalink
because of course windows is different...
Browse files Browse the repository at this point in the history
  • Loading branch information
dovholuknf committed Dec 14, 2024
1 parent 2fee107 commit 5a7ee4c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions programs/ziti-edge-tunnel/config-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,19 @@ char* resolve_directory(const char* path) {
if (access(path, F_OK) != -1) {
//means the file exists right where it is, use realpath and normalize it and continue
if (realpath(path, resolved_path) == NULL) {
//how could we get here?
//how could we get here? seems like this shouldn't be possible but protect for it anyway
printf("path does not exist or permission denied: %s\n", resolved_path);
exit(1);
}
} else {
if (realpath(path, resolved_path) == NULL) {
//how could we get here?
printf("path does not exist or permission denied: %s\n", resolved_path);
exit(1);
}
// due to realpath not existing on windows, apparently `_fullpath` doesn't return NULL
// if the _fullpath doesn't exist... so this access is necessary for windows but redundant
// for linux/macOS
if (access(path, F_OK) == -1) {
printf("path does not exist or permission denied: %s\n", resolved_path);
exit(1);
}
Expand Down

0 comments on commit 5a7ee4c

Please sign in to comment.