Patch submission (new version)

Ricky Nance ricky.nance at gmail.com
Tue Oct 1 14:31:48 MDT 2013


On Tue, Oct 1, 2013 at 11:06 AM, Stéphane PURNELLE <
stephane.purnelle at corman.be> wrote:

> Hi,
>
> New patch submission.
>
>
>
> change log:
> - add possibility to set gid number when create new group.
> - change parameter name for unix home directory (comment of Rowland Penny)
>
>
> I'm not a python developper, so correct me if you see something wrong
>
> group.py.diff -> python/samba/netcmd/group.py
> user.py.diff -> python/samba/netcmd/user.py
> samdb.diff -> python/samba/samdb.py
>
> source :samba-4.1.0 rc4
>
> About setup gidnumber in group add.
>
> samba permit to set a uidNumber for create a new user, why I cannot do
> that with group ?
> Anwser: my patch
>
> With the possibility to set uidNumber for user and gidnumber for group, I
> can manage unix user if and unix group id outside the samba idmap system.
>
> But I detected a BUG (in my point of view) in samba user code: samba not
> detect duplicate uidNumber.
>
> if anyone could review code and apply to GIT if OK
>
> thx
>
>    Stéphane
>
> -----------------------------------
> Stéphane PURNELLE                         Admin. Systèmes et Réseaux
> Service Informatique       Corman S.A.           Tel : 00 32 (0)87/342467



I hate to be this guy, but it could be pretty bad if the UID already exists
and you overwrite it.  Think of it in terms of security, say I give a user
uid of 500 instead of 5000 by accident, all of a sudden that user has
administrator rights (if administrator was 500 that is), there should be
some checks put in before this makes it to the main git repo in my opinion
(same for gid as well). Also you have an indentation issue with:

+          self.modify(ldbmessage2)

there should be 2 more spaces in front of it (been caught on indentation
myself a few times ;) )


My guess is that the samba devs will want the same thing here, but in my
opinion your code looks good so far.

Good luck,
Ricky


More information about the samba-technical mailing list