tenseleyflow/gitswitch / 2dad81e

Browse files

fix: allow /Users/ prefix in path validation for macOS

Authored by espadonne
SHA
2dad81eb058f811d71f4190312e56dbc719963fe
Parents
64a8fb4
Tree
defd689

1 changed file

StatusFile+-
M src/toml_parser.c 2 1
src/toml_parser.cmodified
@@ -531,7 +531,8 @@ bool toml_validate_file_path(const char *path) {
531531
     }
532532
     
533533
     /* Check for absolute paths outside user home */
534
-    if (path[0] == '/' && !string_starts_with(path, "/home/") && 
534
+    if (path[0] == '/' && !string_starts_with(path, "/home/") &&
535
+        !string_starts_with(path, "/Users/") &&
535536
         !string_starts_with(path, "/tmp/")) {
536537
         log_warning("Suspicious absolute path: %s", path);
537538
         return false;