Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] samba-tool syntax error?

121 views
Skip to first unread message

David Bear

unread,
Aug 5, 2014, 1:20:02 PM8/5/14
to
I am using the following syntax to create a new user

samba-tool user add user passwd --userou=Faculty --given-name=new
--surname=user --gecos=198 --mail-address=new...@myschool.edu

Which gives me the following error:

ERROR(<type 'exceptions.ValueError'>): Failed to add user 'user': - unable
to parse dn string
File "/home/vms/devbin/lib/python2.7/site-packages/samba/netcmd/user.py",
line 176, in run
uid=uid, uidnumber=uid_number, gidnumber=gid_number, gecos=gecos,
loginshell=login_shell)
File "/home/vms/devbin/lib/python2.7/site-packages/samba/samdb.py", line
407, in newuser
ldbmessage2.dn = ldb.Dn(self, user_dn)

Since it didn't detect a syntax error, I assume there is something worse..
But I don't really know why it would fail to parse the dn string --

Any ideas?



--
David Bear
mobile: (602) 903-6476
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Marc Muehlfeld

unread,
Aug 5, 2014, 2:50:01 PM8/5/14
to
Hello David,

Am 05.08.2014 19:12, schrieb David Bear:
> I am using the following syntax to create a new user
>
> samba-tool user add user passwd --userou=Faculty --given-name=new
> --surname=user --gecos=198 --mail-address=new...@myschool.edu
>
> Which gives me the following error:
>
> ERROR(<type 'exceptions.ValueError'>): Failed to add user 'user': - unable
> to parse dn string
> File "/home/vms/devbin/lib/python2.7/site-packages/samba/netcmd/user.py",
> line 176, in run
> uid=uid, uidnumber=uid_number, gidnumber=gid_number, gecos=gecos,
> loginshell=login_shell)
> File "/home/vms/devbin/lib/python2.7/site-packages/samba/samdb.py", line
> 407, in newuser
> ldbmessage2.dn = ldb.Dn(self, user_dn)
>
> Since it didn't detect a syntax error, I assume there is something worse..
> But I don't really know why it would fail to parse the dn string --



The usage is --userou='ou=testOU'
^^^^^


# samba-tool user add demoB demopass --userou='ou=testOU'
--given-name=new --surname=user --gecos=198
--mail-address=new...@myschool.edu
User 'demoB' created successfully



Attached a small patch, that hopefully makes the example in the help a
bit clearer. Please review and push, if it's OK.


Regards,
Marc
0001-Redescribe-userou-usage.patch

David Disseldorp

unread,
Aug 5, 2014, 7:30:01 PM8/5/14
to
Hi Marc,

On Tue, 05 Aug 2014 20:44:16 +0200
Marc Muehlfeld <mmueh...@samba.org> wrote:

> # samba-tool user add demoB demopass --userou='ou=testOU'
> --given-name=new --surname=user --gecos=198
> --mail-address=new...@myschool.edu
> User 'demoB' created successfully
>
>
>
> Attached a small patch, that hopefully makes the example in the help a
> bit clearer. Please review and push, if it's OK.

Thanks for the patch!
The change looks okay, but I have a few minor comments:
- please add your Signed-off-by tag
- the option help text change in the second hunk doesn't quite make
sense to me, as it refers to Example3. I'd prefer to just see single
quotes added around CN=Users instead.

Cheers, David

David Disseldorp

unread,
Aug 5, 2014, 7:50:01 PM8/5/14
to
On Wed, 6 Aug 2014 01:27:47 +0200
David Disseldorp <dd...@suse.de> wrote:

> - the option help text change in the second hunk doesn't quite make
> sense to me, as it refers to Example3. I'd prefer to just see single
> quotes added around CN=Users instead.

Ah, I see you fixed this in your follow-up patch to samba-technical.
Just the Signed-off-by tag is needed.

Marc Muehlfeld

unread,
Aug 6, 2014, 2:00:01 PM8/6/14
to
Hello David,

Am 06.08.2014 01:40, schrieb David Disseldorp:
>> - the option help text change in the second hunk doesn't quite make
>> sense to me, as it refers to Example3. I'd prefer to just see single
>> quotes added around CN=Users instead.
>
> Ah, I see you fixed this in your follow-up patch to samba-technical.
> Just the Signed-off-by tag is needed.

Now with Signed-off-by tag. I hope, it's OK now.

It's the first time I used git to create a patch. :-)


Regards,
Marc
0001-Redescribe-userou-usage.patch

David Disseldorp

unread,
Aug 6, 2014, 4:40:02 PM8/6/14
to
On Wed, 06 Aug 2014 19:55:09 +0200, Marc Muehlfeld wrote:

> Now with Signed-off-by tag. I hope, it's OK now.

Looks good, pushed to autobuild.

> It's the first time I used git to create a patch. :-)

Congrats :)
0 new messages