summaryrefslogtreecommitdiff
path: root/source3/nsswitch/libwbclient/wbc_pam.c
diff options
context:
space:
mode:
authorcoffeedude <coffeedude@drizzt.ad.plainjoe.org>2008-05-13 12:52:20 -0500
committercoffeedude <coffeedude@drizzt.ad.plainjoe.org>2008-05-13 12:56:36 -0500
commit9cd646c166f2c9511158c09354e4f103ff681bcf (patch)
tree47ba883f9f4249f8ec25d65d1d8f43d4c2b9a571 /source3/nsswitch/libwbclient/wbc_pam.c
parent44b7f672b87f103a2fd5cffeff48d2f7819042f8 (diff)
downloadsamba-9cd646c166f2c9511158c09354e4f103ff681bcf.tar.gz
samba-9cd646c166f2c9511158c09354e4f103ff681bcf.tar.bz2
samba-9cd646c166f2c9511158c09354e4f103ff681bcf.zip
libwbclient: Add wbcLogoffUser() and wbcLookupDomainController().
Add new APIs calls for WINBINDD_PAM_LOGOFF and WINBINDD_DSGETDCNAME ops. (This used to be commit cb5e8f60ac3313aec726c01687a040e6e0e42c10)
Diffstat (limited to 'source3/nsswitch/libwbclient/wbc_pam.c')
-rw-r--r--source3/nsswitch/libwbclient/wbc_pam.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/source3/nsswitch/libwbclient/wbc_pam.c b/source3/nsswitch/libwbclient/wbc_pam.c
index a0e91faaf3..a3fb212d53 100644
--- a/source3/nsswitch/libwbclient/wbc_pam.c
+++ b/source3/nsswitch/libwbclient/wbc_pam.c
@@ -470,3 +470,55 @@ wbcErr wbcCheckTrustCredentials(const char *domain,
done:
return wbc_status;
}
+
+/** @brief Trigger a logoff notification to Winbind for a specific user
+ *
+ * @param username Name of user to remove from Winbind's list of
+ * logged on users.
+ * @param uid Uid assigned to the username
+ * @param ccfilename Absolute path to the Krb5 credentials cache to
+ * be removed
+ *
+ * @return #wbcErr
+ *
+ **/
+
+wbcErr wbcLogoffUser(const char *username,
+ uid_t uid,
+ const char *ccfilename)
+{
+ struct winbindd_request request;
+ struct winbindd_response response;
+ wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
+ struct passwd *pw = NULL;
+
+ /* validate input */
+
+ if (!username) {
+ wbc_status = WBC_ERR_INVALID_PARAM;
+ BAIL_ON_WBC_ERROR(wbc_status);
+ }
+
+ ZERO_STRUCT(request);
+ ZERO_STRUCT(response);
+
+ strncpy(request.data.logoff.user, username,
+ sizeof(request.data.logoff.user)-1);
+ request.data.logoff.uid = uid;
+
+ if (ccfilename) {
+ strncpy(request.data.logoff.krb5ccname, ccfilename,
+ sizeof(request.data.logoff.krb5ccname)-1);
+ }
+
+ /* Send request */
+
+ wbc_status = wbcRequestResponse(WINBINDD_PAM_LOGOFF,
+ &request,
+ &response);
+
+ /* Take the response above and return it to the caller */
+
+ done:
+ return wbc_status;
+}