]> gitweb.michael.orlitzky.com - apply-default-acl.git/blobdiff - src/apply-default-acl.c
Fix symlink handling and update to version 0.0.6.
[apply-default-acl.git] / src / apply-default-acl.c
index 0c43af7d975088c06019c8a44e69b66f14cdf63a..19505282c2acda17960281e966a9d347a5bc1611 100644 (file)
@@ -51,13 +51,13 @@ mode_t get_mode(const char* path) {
   }
 
   struct stat s;
-  int result = stat(path, &s);
+  int result = lstat(path, &s);
 
   if (result == 0) {
     return s.st_mode;
   }
   else {
-    /* errno will be set already by stat() */
+    /* errno will be set already by lstat() */
     return result;
   }
 }
@@ -78,7 +78,7 @@ bool is_regular_file(const char* path) {
   }
 
   struct stat s;
-  int result = stat(path, &s);
+  int result = lstat(path, &s);
   if (result == 0) {
     return S_ISREG(s.st_mode);
   }
@@ -139,7 +139,7 @@ bool is_directory(const char* path) {
   }
 
   struct stat s;
-  int result = stat(path, &s);
+  int result = lstat(path, &s);
   if (result == 0) {
     return S_ISDIR(s.st_mode);
   }
@@ -1014,7 +1014,7 @@ int main(int argc, char* argv[]) {
      * typos, too.
      */
     if (!path_accessible(target)) {
-      fprintf(stderr, "%s: %s: no such file or directory\n", argv[0], target);
+      fprintf(stderr, "%s: %s: No such file or directory\n", argv[0], target);
       result = EXIT_FAILURE;
       continue;
     }