From: Ivan Kohler Date: Thu, 8 Nov 2018 19:31:49 +0000 (-0800) Subject: better debugging for htpasswd failure, RT#78179 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=782c9989fba6332e28f25187da8d623bddaab466;p=freeside.git better debugging for htpasswd failure, RT#78179 --- diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm index 9f4c34ddb..70cef4a6a 100644 --- a/FS/FS/access_user.pm +++ b/FS/FS/access_user.pm @@ -149,7 +149,16 @@ sub htpasswd_kludge { { return ''; } else { - return 'htpasswd exited unsucessfully'; + + if ($? == -1) { + return "htpasswd failed to execute: $!"; + } elsif ($? & 127) { + return sprintf("htpasswd died with signal %d, %s coredump", + ($? & 127), ($? & 128) ? 'with' : 'without' ); + } else { + return sprintf("htpasswd exited with value %d", $? >> 8 ); + } + } }