Bug 5540 - User variable not passed to the "set primary group script"
User variable not passed to the "set primary group script"
Status: RESOLVED FIXED
Product: Samba 3.2
Classification: Unclassified
Component: Domain Control
3.2.0
x86 Linux
: P3 normal
: ---
Assigned To: Simo Sorce
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-12 15:46 UTC by Scott K Logan
Modified: 2008-07-16 03:31 UTC (History)
0 users

See Also:


Attachments
Fix set primary group script user option substitution (864 bytes, patch)
2008-07-12 22:18 UTC, Simo Sorce
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott K Logan 2008-06-12 15:46:26 UTC
I use the script 

/usr/sbin/usermod -g %g %u

to set the primary group for users. Upon discovering its malfunction, I made a bash script to see what samba was actually executing, and found that it properly substituted the new group, but %u remained as %u.

I am using Samba version 3.2.0rc1-15.fc9

I use samba in a productivity environment, and appreciate everything you do!
Comment 1 Karolin Seeger 2008-06-17 01:57:02 UTC
Please retry with 

/usr/sbin/usermod -g %G %U

Does that work for you?
Comment 2 Scott K Logan 2008-06-17 14:14:04 UTC
(In reply to comment #1)
> Please retry with 
> 
> /usr/sbin/usermod -g %G %U
> 
> Does that work for you?
> 

I believe the uppercase G and U are used to identify the user making the remote procedure call...as those are the values passed to the script. The group variable works fine as %g. %u remains as %u and %U is the name of the user who is making the change remotely. I should mention, also, that I get an 'access is denied' message on the remote computer, even though it does attempt to execute the script. I'm not sure which problem is causing which, but I thought it might be important. Thank you.
Comment 3 Simo Sorce 2008-07-12 22:18:36 UTC
Created attachment 3406 [details]
Fix set primary group script user option substitution

This patch fixes the problem, indeed the %u variable was not substituted as it should have been.
Please test.
Comment 4 Jeremy Allison 2008-07-14 15:38:06 UTC
Pushed into 3.2 and 3.3.
Jeremy.
Comment 5 Karolin Seeger 2008-07-16 03:31:59 UTC
Closing out bug report.
Please re-open if it still an issue for you.

Thanks for the report!