Unwriteable directories are errors
authorRich Salz <rsalz@akamai.com>
Thu, 10 Sep 2015 15:46:13 +0000 (11:46 -0400)
committerRich Salz <rsalz@openssl.org>
Thu, 10 Sep 2015 20:13:55 +0000 (16:13 -0400)
Make the script and app match the documentation.

Reviewed-by: Tim Hudson <tjh@openssl.org>
apps/rehash.c
tools/c_rehash.in

index b0d6d9cc1321250adf5e3ccb6cd4881c185388e8..fdaba6af3035c6d210b59173d262b4880e972942 100644 (file)
@@ -315,7 +315,7 @@ static int do_dir(const char *dirname, enum Hash h)
 
     if (app_access(dirname, W_OK) < 0) {
         BIO_printf(bio_err, "Skipping %s, can't write\n", dirname);
-        return 0;
+        return 1;
     }
     buflen = strlen(dirname);
     pathsep = (buflen && dirname[buflen - 1] == '/') ? "" : "/";
index 6c2ff065d1b54ede33a884458667229d7b9336a1..834de780ca247d6d5eaeccd993ffe4de2dad068d 100644 (file)
@@ -6,6 +6,7 @@
 my $dir;
 my $prefix;
 
+my $errorcount = 0;
 my $openssl = $ENV{OPENSSL} || "openssl";
 my $pwd;
 my $x509hash = "-subject_hash";
@@ -89,9 +90,11 @@ foreach (@dirlist) {
                hash_dir($_);
             } else {
                 print "Skipping $_, can't write\n";
+                $errorcount++;
             }
        }
 }
+exit($errorcount);
 
 sub hash_dir {
        my %hashlist;