summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-05-24 09:33:25 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-05-24 13:35:41 -0400
commitde9fa0156b6cad1c824803283f15dfc360fb3f64 (patch)
tree1b90d9dee2e74b925360e3eac3d35f5595b814a9
parente8d1e991c34f44e7a00a8d18cef689410880e196 (diff)
downloadsssd-de9fa0156b6cad1c824803283f15dfc360fb3f64.tar.gz
sssd-de9fa0156b6cad1c824803283f15dfc360fb3f64.tar.xz
sssd-de9fa0156b6cad1c824803283f15dfc360fb3f64.zip
Display name of PAM action in pam_print_data()
-rw-r--r--src/providers/dp_pam_data_util.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/providers/dp_pam_data_util.c b/src/providers/dp_pam_data_util.c
index 308bd7c73..02eb6e91a 100644
--- a/src/providers/dp_pam_data_util.c
+++ b/src/providers/dp_pam_data_util.c
@@ -24,9 +24,31 @@
#include "providers/data_provider.h"
+
+static const char *pamcmd2str(int cmd) {
+ switch (cmd) {
+ case SSS_PAM_AUTHENTICATE:
+ return "PAM_AUTHENTICATE";
+ case SSS_PAM_SETCRED:
+ return "PAM_SETCRED";
+ case SSS_PAM_ACCT_MGMT:
+ return "PAM_ACCT_MGMT";
+ case SSS_PAM_OPEN_SESSION:
+ return "PAM_OPEN_SESSION";
+ case SSS_PAM_CLOSE_SESSION:
+ return "PAM_CLOSE_SESSION";
+ case SSS_PAM_CHAUTHTOK:
+ return "PAM_CHAUTHTOK";
+ case SSS_PAM_CHAUTHTOK_PRELIM:
+ return "PAM_CHAUTHTOK_PRELIM";
+ default:
+ return "UNKNOWN";
+ }
+}
+
void pam_print_data(int l, struct pam_data *pd)
{
- DEBUG(l, ("command: %d\n", pd->cmd));
+ DEBUG(l, ("command: %s\n", pamcmd2str(pd->cmd)));
DEBUG(l, ("domain: %s\n", pd->domain));
DEBUG(l, ("user: %s\n", pd->user));
DEBUG(l, ("service: %s\n", pd->service));