summaryrefslogtreecommitdiff
path: root/source3/pam_smbpass/pam_smb_acct.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/pam_smbpass/pam_smb_acct.c')
-rw-r--r--source3/pam_smbpass/pam_smb_acct.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/pam_smbpass/pam_smb_acct.c b/source3/pam_smbpass/pam_smb_acct.c
index c7622fbaa2..59ed4eee8b 100644
--- a/source3/pam_smbpass/pam_smb_acct.c
+++ b/source3/pam_smbpass/pam_smb_acct.c
@@ -77,6 +77,11 @@ int pam_sm_acct_mgmt( pam_handle_t *pamh, int flags,
_log_err( LOG_DEBUG, "acct: username [%s] obtained", name );
}
+ if (geteuid() != 0) {
+ _log_err(pamh, LOG_DEBUG, "Cannot access samba password database, not running as root.");
+ return PAM_AUTHINFO_UNAVAIL;
+ }
+
/* Getting into places that might use LDAP -- protect the app
from a SIGPIPE it's not expecting */
oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);