better debugging for htpasswd failure, RT#78179
authorIvan Kohler <ivan@freeside.biz>
Thu, 8 Nov 2018 19:31:49 +0000 (11:31 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 8 Nov 2018 19:31:49 +0000 (11:31 -0800)
FS/FS/access_user.pm

index 9f4c34d..70cef4a 100644 (file)
@@ -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 );
+    }
+
   }
 }