[Samba] valid users = %S in rc4

Jeremy Allison jra at samba.org
Fri Sep 26 19:27:40 GMT 2003


On Fri, Sep 26, 2003 at 10:14:36AM -0400, Chris Smith wrote:
> On Friday 26 September 2003 00:15, Hannu Tikka wrote:
> > After upgrading rc2 -> rc4 (suse binary packages)
> > 
> > line 'valid users = %S' in [homes] section prevents user getting to his
> > homedirectory
> 
> Same change occured here when upgrading from 2.2.7a to the 3.0.0 release.

Here is the fix. Silly missing cut-n-paste bug. This will be in 3.0.1.

Sorry,

	Jeremy.

Index: smbd/password.c
===================================================================
RCS file: /data/cvs/samba/source/smbd/password.c,v
retrieving revision 1.248.2.16
diff -u -r1.248.2.16 password.c
--- smbd/password.c     5 Sep 2003 05:32:32 -0000       1.248.2.16
+++ smbd/password.c     26 Sep 2003 19:26:28 -0000
@@ -291,7 +291,9 @@
        if (lp_invalid_users(snum)) {
                str_list_copy(&invalid, lp_invalid_users(snum));
                if (invalid && str_list_substitute(invalid, "%S", lp_servicename(snum))) {
-                       ret = !user_in_list(user, (const char **)invalid, groups, n_groups);
+                       if ( invalid && str_list_sub_basic(invalid, current_user_info.smb_name) ) {
+                               ret = !user_in_list(user, (const char **)invalid, groups, n_groups);
+                       }
                }
        }
        if (invalid)
@@ -299,8 +301,10 @@

        if (ret && lp_valid_users(snum)) {
                str_list_copy(&valid, lp_valid_users(snum));
-               if ( valid && str_list_sub_basic(valid, current_user_info.smb_name) ) {
-                       ret = user_in_list(user, (const char **)valid, groups, n_groups);
+               if ( valid && str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
+                       if ( valid && str_list_sub_basic(valid, current_user_info.smb_name) ) {
+                               ret = user_in_list(user, (const char **)valid, groups, n_groups);
+                       }
                }
        }
        if (valid)




More information about the samba mailing list