[PATCHES BUG 13312] winbindd: Do not ignore domain in LOOKUPNAME request

Andreas Schneider asn at samba.org
Fri Mar 9 08:23:26 UTC 2018


On Wednesday, 7 March 2018 23:19:46 CET Christof Schmitt via samba-technical 
wrote:
> Is anybody interested in reviewing this change?

-	char *domname, *name, *p;
+	const char *domname, *name;
+	char *p;

If you're already modifying those, please initialize the the pointers with 
NULL.

+		if (p) {
+			*p = 0;

should be

if (p != NULL) {
	*p = '\0';

I think I would prefer if the block would look like this:

+		p = strstr(request->data.name.name, lp_winbind_separator());
+		if (p != NULL) {
+			*p = '\0';
+			domname = request->data.name.name;
+			name = p + 1;
+		} else {
+			p = strchr(request->data.name.name, '@');
+			if (p != NULL) {
+				/* upn */
+				domname = p + 1;
+				*p = '\0';
+				name = request->data.name.name;
+			} else {
+				domname = "";
+				name = request->data.name.name;
+			}
+		}




	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org





More information about the samba-technical mailing list