%G is not expaned in a service path. Using this in a share name: [test_sub] path = /homes/D%D/u%u/U%U/g%g/G%G does not expand %G. The following patch fixes this.
Created attachment 9461 [details] Patch for master
Comment on attachment 9461 [details] Patch for master man smb.conf says: %G primary group name of %U. If I am not mistaken, your patch will print the gid as a number. Right?
Comment on attachment 9461 [details] Patch for master This doesn't look right to me. Look at the definition of %G in the smb.conf man page: ------------------------------------------- %U session username (the username that the client wanted, not necessarily the same as the one they got). %G primary group name of %U. ------------------------------------------- This needs to be a string, not a number I think. Jeremy.
Oh then the bug is incorrect. Cause there is no %U (session username) so also no %G. There is only a %u which is the service username and %g is the service groupname.
Well there might be more broken. We pass the session username and session groupname to talloc_sub_advanced() but it should be the service username and service groupname so probably 'force user' needs to be considered, right?
Created attachment 9486 [details] Patch for master v2
Ping!
(In reply to comment #5) > Well there might be more broken. We pass the session username and session > groupname to talloc_sub_advanced() but it should be the service username and > service groupname so probably 'force user' needs to be considered, right? make_connection_snum calls make_connection_snum that replaces the information in the session info with the forced values. So we should be good in that regard.
Yes, I know that now :) I've fixed it correctly, but someone needs to review the patch ...
Patch is on its way through autobuild
Created attachment 9522 [details] v4-1-test patch
Created attachment 9523 [details] v4-0-test patch
Hi Karolin, please include in 4.0.x and 4.1.x
Pushed to autobuild-v4-1-test and autobuild-v4-0-test.
(In reply to comment #14) > Pushed to autobuild-v4-1-test and autobuild-v4-0-test. Both autobuilds failed, retrying...
Pushed to v4-1-test and v4-0-test. Closing out bug report. Thanks!
(In reply to comment #16) > Pushed to v4-1-test and v4-0-test. > Closing out bug report. > > Thanks! Pushed to v4-1-test, but not to v4-0-test yet. Retrying...
Patch for 4.0 breaks autobuild. Re-assigning to Andreas.
%G is not expaned in a service "valid users = @%G" all versions after 4.1.3 and all 4.2.x [workgroups] path = /home/samba/groups/%G valid users = @%G ---------8<----------- [2015/07/21 14:39:05.402715, 3, pid=3439, effective(0, 0), real(0, 0)] ../libcli/security/dom_sid.c:208(dom_sid_parse_endp) string_to_sid: SID @%G is not in a valid format ---------8<-----------
I also just saw another regression where logon script = %G.bat does not get resolved on a (NT4) dc.
(In reply to Michael Adam from comment #20) > I also just saw another regression where > > logon script = %G.bat > > does not get resolved on a (NT4) dc. Problem seems to be this: - talloc_sub_basic() for %G calls Get_Pwnam_alloc() on the username handed in to get the group from the group struct. - The fix in this bug report uses domain\username instead of just username to call getpwnam, if domain is not NULL. - ==> For the case of a user of the local SAM, this is not a name the will resolve. Hence the regression. I assume that the fix for this bug has only fixed the case of a non-local / domain user? Need to find out what the right thing to do (TM) is here. Possibly checking whether the domain name is our own sam name and then omitting it...
Created attachment 11784 [details] Patchset for master to fix the regression This is a proposed patchset for master to fix the regression. I yet have to test it. And I have a couple of cleanup patches on top. Should we open a new BZ for this or can we re-use this one?
Comment on attachment 11784 [details] Patchset for master to fix the regression what about this patch for master?
Comment on attachment 11784 [details] Patchset for master to fix the regression LGTM. Pushed to master.