[openssl] OpenSSL_1_1_1-stable update

tomas at openssl.org tomas at openssl.org
Tue Mar 30 17:13:37 UTC 2021

The branch OpenSSL_1_1_1-stable has been updated
       via  ad6a39b22728260454461a4d04ba25fc15d3520f (commit)
      from  4cd2e3c952fa5eb1f7bd8cfd410781490878bdee (commit)

- Log -----------------------------------------------------------------
commit ad6a39b22728260454461a4d04ba25fc15d3520f
Author: Alex Yursha <alexyursha at gmail.com>
Date:   Tue Mar 9 10:07:26 2021 -1000

    Print correct error message in utils/mkdir-p.pl
    Commit 70a56b914772e6b21cda2a5742817ae4bb7290f1 introduced a regression.
    If utils/mkdir-p.pl fails to create a target dir because of insufficient file system
    permissions, the subsequent test for dir existence always fails and overwrites
    the system error. As a result, a user is presented with a misleading error message.
    E.g. if a user tries to create a dir under /usr/local and does not have permissions
    for it, the reported error message is "Cannot create directory /usr/local/lib: No such file or directory",
    whereas the expected error message is "Cannot create directory /usr/local/lib: Permission denied".
    This commit introduces a fix by declaring an additional local variable to cache
    the original error message from mkdir. If -d check fails and overwrites the system
    error, the user is still presented with the original error from mkdir.
    CLA: Trivial
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14487)
    (cherry picked from commit af2e1e9c81110ca1a156430686e2f171e80ebfa0)


Summary of changes:
 util/mkdir-p.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util/mkdir-p.pl b/util/mkdir-p.pl
index 328060243f..88d8b0151f 100755
--- a/util/mkdir-p.pl
+++ b/util/mkdir-p.pl
@@ -34,11 +34,12 @@ sub do_mkdir_p {
   unless (mkdir($dir, 0777)) {
+    local($err) = $!;
     if (-d $dir) {
       # We raced against another instance doing the same thing.
-    die "Cannot create directory $dir: $!\n";
+    die "Cannot create directory $dir: $err\n";
   print "created directory `$dir'\n";

More information about the openssl-commits mailing list