[PATCH] wbinfo: make --verbose --pam-logon print sids

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Oct 9 10:21:11 UTC 2015


Hi!

Review&push appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From c3e60a5ea9afdbc368f16606019d6f8555ea56be Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Fri, 9 Oct 2015 12:18:53 +0200
Subject: [PATCH] wbinfo: make --verbose --pam-logon print sids

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 nsswitch/wbinfo.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c
index f45d7b5..330fa91 100644
--- a/nsswitch/wbinfo.c
+++ b/nsswitch/wbinfo.c
@@ -1831,6 +1831,7 @@ static bool wbinfo_pam_logon(char *username, bool verbose)
 
 	if (verbose && (info != NULL)) {
 		struct wbcAuthUserInfo *i = info->info;
+		uint32_t j;
 
 		if (i->account_name != NULL) {
 			d_printf("account_name: %s\n", i->account_name);
@@ -1863,6 +1864,15 @@ static bool wbinfo_pam_logon(char *username, bool verbose)
 			d_printf("home_drive: %s\n", i->home_drive);
 		}
 
+		d_printf("sids:");
+
+		for (j=0; j<i->num_sids; j++) {
+			char buf[WBC_SID_STRING_BUFLEN];
+			wbcSidToStringBuf(&i->sids[j].sid, buf, sizeof(buf));
+			d_printf(" %s", buf);
+		}
+		d_printf("\n");
+
 		wbcFreeMemory(info);
 		info = NULL;
 	}
-- 
1.7.10.4



More information about the samba-technical mailing list