diff options
author | Alex Yursha <alexyursha@gmail.com> | 2021-03-09 10:07:26 -1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-03-30 19:13:08 +0200 |
commit | af2e1e9c81110ca1a156430686e2f171e80ebfa0 (patch) | |
tree | ebb2172462b67a7469bb1359739a4197cd94f2f0 /apps/enc.c | |
parent | 1368f0cdf54fb1b7ddb9a9069b60db796abfe1b3 (diff) |
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@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14487)
Diffstat (limited to 'apps/enc.c')
0 files changed, 0 insertions, 0 deletions