[Samba] Samba 3 smbstatus not as good

Tom Schaefer tom at umsl.edu
Mon Aug 2 16:31:12 GMT 2004


Andrew, I dug into it a bit and managed to steal the few relevant lines of code
from 2.2.8a status.c and replace the ones in 3.0.5 to make my own smbstatus. 

Now it works perfectly for me displaying any forced users and groups just like
it did in Samba 2.x.

I still don't really get why you took the uid/gid info out of the shares listing
in the first place.  You say the information is "not valid" but how do you mean
that?  Not valid in the sense that I'm seeing effective uids and gids and not
the "true" uid/gid of the connected user or not valid as in "screwed up"?

Tom Schaefer

bash# /usr/local/bin/diff -u status.c.orig status.c
--- status.c.orig       2004-07-20 11:28:15.000000000 -0500
+++ status.c    2004-08-02 10:42:59.590002000 -0500
@@ -540,11 +540,10 @@
                return 0;
        }
 
-       d_printf("%-10.10s   %5d   %-12s  %s",
-              crec.name,(int)crec.pid,
-              crec.machine,
-              asctime(LocalTime(&crec.start)));
-
+               d_printf("%-10.10s   %-8s %-8s %5d   %-8s (%s) %s",
+                      crec.name,uidtoname(crec.uid),gidtoname(crec.gid),(int)crec.pid,
+                      crec.machine,crec.addr,
+                      asctime(LocalTime(&crec.start)));
        return 0;
 }
 
@@ -654,8 +653,8 @@
                if (brief) 
                        exit(0);
                
-               d_printf("\nService      pid     machine       Connected at\n");
-               d_printf("-------------------------------------------------------\n");
+                       d_printf("\nService      uid      gid      pid     machine\n");
+                       d_printf("----------------------------------------------\n");
 
                tdb_traverse(tdb, traverse_fn1, NULL);
                tdb_close(tdb);





On Sat, 31 Jul 2004 22:54:27 +1000
Andrew Bartlett <abartlet at samba.org> wrote:

> On Sat, 2004-07-31 at 01:05, Tom Schaefer wrote:
> > I use a lot of "force user" and "force group" directives on various
> > shares.  With smbstatus of Samba 2 I could always verify with a glance
> > what uid and gid a particular service is being accessed as, with Samba 3
> > you can't.  I'd REALLY like to see that come back to smbstatus.
> > 
> > Here's a real world example of my complaint...
> 
> > Basically this message is just a plea to the Samba developers to put back
> > the uid and gid information.
> 
> The problem is, that information is not valid, except in
> 'security=share' and 'force user' cases.  In all other cases, the user
> that connects to the share is not necessarily connected to the user
> actually accessing the share.
> 
> This is why the information was split up the way it has been.
> 
> Andrew Bartlett
> 
> -- 
> Andrew Bartlett                                 abartlet at samba.org
> Authentication Developer, Samba Team            http://samba.org
> Student Network Administrator, Hawker College   abartlet at hawkerc.net
> 


More information about the samba mailing list