From 20657af2deafbe3713e44fd62156e9127481dacd Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 18 Apr 2009 01:44:22 +0000 Subject: [PATCH] In pwmod, ctx may be empty so always pass current username --- contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in | 1 + contrib/slapd-modules/nssov/nss-ldapd/nss/pam.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in index b73538de9b..0482c75e43 100644 --- a/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in @@ -266,6 +266,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hosts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netgroup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networks.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpc.Po@am__quote@ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/pam.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/pam.c index f774655256..ba1a90f0a0 100644 --- a/contrib/slapd-modules/nssov/nss-ldapd/nss/pam.c +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/pam.c @@ -532,11 +532,11 @@ int pam_sm_close_session( } static enum nss_status pam_do_pwmod( - pld_ctx *ctx, const char *oldpw, const char *newpw, int *errnop) + pld_ctx *ctx, const char *user, const char *oldpw, const char *newpw, int *errnop) { NSS_BYGEN(NSLCD_ACTION_PAM_PWMOD, WRITE_STRING(fp,ctx->dn); - WRITE_STRING(fp,ctx->user); + WRITE_STRING(fp,user); WRITE_STRING(fp,oldpw); WRITE_STRING(fp,newpw), pam_read_authz(fp,ctx,errnop)); @@ -632,7 +632,7 @@ int pam_sm_chauthtok( if (rc != PAM_SUCCESS) return rc; } - rc = pam_do_pwmod(ctx, p, q, &err); + rc = pam_do_pwmod(ctx, username, p, q, &err); p = NULL; q = NULL; NSS2PAM_RC(rc, ignore_flags, PAM_SUCCESS); if (rc == PAM_SUCCESS) { -- 2.39.5