None

mike.pain.NOSPAM at bigfoot.com mike.pain.NOSPAM at bigfoot.com
Wed Jan 29 17:21:20 GMT 2003


samba-technical at samba.org
Dear all,
Thanks for the work on samba and winbind - we are moving all our network 
shares to a 2.2.7 server, and it makes my life easier.  However, I find it
very cumbersome having to put in the exact case sensitive domain and username to
look at the shares of an individual user with smbstatus -u.  For example, if I
enter smbstatus -u DOMAIN+me it will work, but smbstatus -u domain+me wont.
Since we are using winbindd default domain, it would be nice not to have to
enter the domain part, so that smbstatus -u me would work.  Also, the returned
information doesn't need to show the domain if it is the default so that
smbstatus -S -u me would show
FILES        me       mygroup  32597   mypc     (123.45.67.89) Wed Jan 29 09:02:39 2003
rather than the cluttered
FILES        DOMAIN+me DOMAIN+mygroup 32597   mypc     (123.45.67.89) Wed Jan 29 09:02:39 2003
The unix utility ls already reports just the user and group names.
The following patch against 2.2.7 (not 2.2.7a as we don't need the LFS, but I
doubt there is much changed in this area) does this, and seems to work fine,
and samba and winbind appear to be unaffected.  My knowledge of C and the
implications to the system of this change are unfortunately rather limited, so
if some kind soul could check if it is a)useful and b)not breaking anything 
else then I hope someone else could use it.  I don't know if it would be 
applicable to 3.0 or Head (or if the issue doesn't arise).

Thanks

Mike Pain  (mike.pain.NOSPAM at bigfoot.com - remove the .NOSPAM)




--- nsswitch/wb_client.c.orig	Tue Nov 19 18:44:20 2002
+++ nsswitch/wb_client.c	Wed Jan 29 11:29:39 2003
@@ -408,8 +408,12 @@
 	if (name_type != SID_NAME_USER)
 		return False;
 
-	slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name, 
-                 lp_winbind_separator(), user_name);
+	if (lp_winbind_use_default_domain() &&
+			strchr(dom_name, *lp_workgroup()))
+		slprintf(name, sizeof(fstring)-1, "%s", user_name);
+	else	
+		slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name, 
+                	 lp_winbind_separator(), user_name);
 
 	return True;
 }
@@ -431,8 +435,12 @@
 	if (name_type != SID_NAME_DOM_GRP)
 		return False;
 
-	slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name, 
-                 lp_winbind_separator(), group_name);
+	if (lp_winbind_use_default_domain() &&
+			strchr(dom_name, *lp_workgroup()))
+		slprintf(name, sizeof(fstring)-1, "%s", group_name);
+	else	
+		slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name, 
+        	         lp_winbind_separator(), group_name);
 
 	return True;
 }


More information about the samba-technical mailing list