aboutsummaryrefslogtreecommitdiff
path: root/lib/libpam
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2001-08-10 19:15:48 +0000
committerMark Murray <markm@FreeBSD.org>2001-08-10 19:15:48 +0000
commit0fa107a3cbc35b7304c35b484b7192a3f6d19f96 (patch)
tree8a85cde45f0fadef5b02f98dfdaa2f6d075b85fd /lib/libpam
parent65550d9b5a925c1edcdf250a36342435b83273da (diff)
downloadsrc-0fa107a3cbc35b7304c35b484b7192a3f6d19f96.tar.gz
src-0fa107a3cbc35b7304c35b484b7192a3f6d19f96.zip
Simplify code. Also verbose logging, verbose overridable error reporting.
Notes
Notes: svn path=/head/; revision=81474
Diffstat (limited to 'lib/libpam')
-rw-r--r--lib/libpam/modules/pam_rootok/pam_rootok.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libpam/modules/pam_rootok/pam_rootok.c b/lib/libpam/modules/pam_rootok/pam_rootok.c
index 71478a1b3db1..0759a26f7140 100644
--- a/lib/libpam/modules/pam_rootok/pam_rootok.c
+++ b/lib/libpam/modules/pam_rootok/pam_rootok.c
@@ -40,17 +40,16 @@ PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
struct options options;
- uid_t uid;
pam_std_option(&options, NULL, argc, argv);
PAM_LOG("Options processed");
- uid = getuid();
- if (uid == 0)
+ if (getuid() == 0)
PAM_RETURN(PAM_SUCCESS);
- PAM_LOG("User is not root");
+ PAM_VERBOSE_ERROR("Refused; not superuser");
+ PAM_LOG("User is not superuser");
PAM_RETURN(PAM_AUTH_ERR);
}
@@ -58,7 +57,13 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
PAM_EXTERN int
pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
- return PAM_SUCCESS;
+ struct options options;
+
+ pam_std_option(&options, NULL, argc, argv);
+
+ PAM_LOG("Options processed");
+
+ PAM_RETURN(PAM_SUCCESS);
}
PAM_MODULE_ENTRY("pam_rootok");