#2786 Add samba group

1.330
closed
5
2007-07-06
2007-03-28
baka
No

Add new samba group, with group name - "TEST", group type -"Local group", unix group - "www", description - "test group" and privileges - "None".
Get error message:
Failed to save group : /usr/local/bin/net failed :

Can't map to an unknown group type.

but group create normally
# net -s /etc/samba/smb.conf groupmap list
TEST (S-1-5-21-3150433999-1277930913-3525719806-3001) -> www
# net -s /etc/samba/smb.conf groupmap list verbose
TEST
SID : S-1-5-21-3150433999-1277930913-3525719806-3001
Unix gid : 67
Unix group: www
Group type: Local Group
Comment : Local Unix group

OS: OpenBSD 4.0
Samba: 3.0.24

Perhaps it possibly because I'm haven't smbgroupedit.

Discussion

  • Jamie Cameron

    Jamie Cameron - 2007-03-28

    Logged In: YES
    user_id=129364
    Originator: NO

    What happens if you run the following group creation command at the shell prompt :
    net -s /etc/samba/smb.conf groupmap add rid=12345 unixgroup=www ntgroup=www type=l

     
  • baka

    baka - 2007-03-28

    Logged In: YES
    user_id=1742417
    Originator: YES

    #net -s /etc/samba/smb.conf groupmap add rid=12345 unixgroup=www ntgroup=www type=l
    Successfully added group www to the mapping db as a alias (local) group
    #

     
  • Jamie Cameron

    Jamie Cameron - 2007-03-28

    Logged In: YES
    user_id=129364
    Originator: NO

    Did you select 'Local group' when adding the group in Webmin?

     
  • baka

    baka - 2007-03-29

    Logged In: YES
    user_id=1742417
    Originator: YES

    Add new samba group, with group name - "TEST", group type -"Local group"(select),
    unix group - "www"(select), description - "test group" and privileges - "None".

     
  • baka

    baka - 2007-03-29

    Logged In: YES
    user_id=1742417
    Originator: YES

    Add new samba group, with group name - "TEST", group type -"Local group"(select),
    unix group - "www"(select), description - "test group" and privileges - "None".

     
  • Jamie Cameron

    Jamie Cameron - 2007-03-30

    Logged In: YES
    user_id=129364
    Originator: NO

    You should try editing the file samba/samba-lib.pl under the Webmin root, looking for the create_group function, and adding some code to print out the exact command it is trying to run ..

     
  • Rob H Thomas

    Rob H Thomas - 2007-07-05

    Logged In: YES
    user_id=1837002
    Originator: NO

    Hi,
    Using WBEL3.0, Samba 3.0.25a-33, Webmin 1.350-1

    I am getting the same error and I think I have tracked it down to the net groupmap modify command within the /usr/libexec/webmin/samba/samba-lib.pl script and the create_group function. Basicially this function checks whether smbgroupedit exists and if not uses the net command. The net command is used to get the maxrid and increments this by one, which is then used to create the groupmap and then that new groupmap is modified to include a description if there is one. It's the modify command which is causing the issue as it's expecting to receive a group type (as the original creation receives sucessfully) which it doesn't.

    Here is the code I've modified to fix this (I'm not a perl expert by any means so please verify)

    Original from line 871 in /usr/libexec/webmin/samba/samba-lib.pl create_group
    $out = &backquote_logged(
    "$config{'net'} groupmap modify".
    " ntgroup=".quotemeta($_[0]->{'name'}).
    ($_[0]->{'desc'} ? " comment=".quotemeta($_[0]->{'desc'})
    : " 'comment= '")." 2>&1");

    New from line 871 in /usr/libexec/webmin/samba/samba-lib.pl create_group
    $out = &backquote_logged(
    "$config{'net'} groupmap modify".
    " ntgroup=".quotemeta($_[0]->{'name'}).
    ($_[0]->{'desc'} ? " comment=".quotemeta($_[0]->{'desc'})
    : " 'comment= '").
    " type=".quotemeta($_[0]->{'type'})." 2>&1");

    I've checked the other modify_group function and that seems to be ok.
    Cheers
    Rob

     
  • Rob H Thomas

    Rob H Thomas - 2007-07-06

    Logged In: YES
    user_id=1837002
    Originator: NO

    Hi,
    Using WBEL3.0, Samba 3.0.25a-33, Webmin 1.350-1

    I am getting the same error and I think I have tracked it down to the net groupmap modify command within the /usr/libexec/webmin/samba/samba-lib.pl script and the create_group function. Basicially this function checks whether smbgroupedit exists and if not uses the net command. The net command is used to get the maxrid and increments this by one, which is then used to create the groupmap and then that new groupmap is modified to include a description if there is one. It's the modify command which is causing the issue as it's expecting to receive a group type (as the original creation receives sucessfully) which it doesn't.

    Here is the code I've modified to fix this (I'm not a perl expert by any means so please verify)

    Original from line 871 in /usr/libexec/webmin/samba/samba-lib.pl create_group
    $out = &backquote_logged(
    "$config{'net'} groupmap modify".
    " ntgroup=".quotemeta($_[0]->{'name'}).
    ($_[0]->{'desc'} ? " comment=".quotemeta($_[0]->{'desc'})
    : " 'comment= '")." 2>&1");

    New from line 871 in /usr/libexec/webmin/samba/samba-lib.pl create_group
    $out = &backquote_logged(
    "$config{'net'} groupmap modify".
    " ntgroup=".quotemeta($_[0]->{'name'}).
    ($_[0]->{'desc'} ? " comment=".quotemeta($_[0]->{'desc'})
    : " 'comment= '").
    " type=".quotemeta($_[0]->{'type'})." 2>&1");

    I've checked the other modify_group function and that seems to be ok.
    Cheers
    Rob

     
  • Jamie Cameron

    Jamie Cameron - 2007-07-06
    • status: open --> closed
     
  • Jamie Cameron

    Jamie Cameron - 2007-07-06

    Logged In: YES
    user_id=129364
    Originator: NO

    Thanks for that patch - I will include it in the next Webmin release.

     

Log in to post a comment.