- (djm) Fix early exit for root auth success when UsePAM=yes and
   PermitRootLogin=no
diff --git a/monitor.c b/monitor.c
index 97f1ee9..c4f9a48 100644
--- a/monitor.c
+++ b/monitor.c
@@ -309,7 +309,7 @@
 				authenticated = 0;
 #ifdef USE_PAM
 			/* PAM needs to perform account checks after auth */
-			if (options.use_pam) {
+			if (options.use_pam && authenticated) {
 				Buffer m;
 
 				buffer_init(&m);