How to add SeBackup privilege for make test user ?

Andrew Bartlett abartlet at samba.org
Thu Oct 25 19:44:02 MDT 2012


On Thu, 2012-10-25 at 16:48 -0700, Jeremy Allison wrote:
> Hi Andrew and Jelmer,
> 
> I'm adding a regression test for my fix for the crash
> in smbd when doing a listing for a user with SeBackup
> privilege.
> 
> However this depends on the test user being used in
> the source3/script/tests/test_smbclient_s3.sh test
> scripts having SeBackup privilege assigned.
> 
> We seem to only create the one test user ($USER)
> who is logged in, and that user doesn't have
> SeBackup privilege. How do I fix that ?
> 
> When I do:
> 
> net rpc rights grant $USERNAME SeBackupPrivilege -U$USERNAME%$PASSWORD -I $SERVER_IP
> 
> before trying the backup list, I get:
> 
> Could not connect to server 127.0.0.2
> The username or password was not correct.
> Connection failed: NT_STATUS_LOGON_FAILURE
> 
> which is plainly incorrect as this is the
> same user and password that smbclient uses
> (although I'm not sure if this user has the
> rights to add SeBackupPrivilege).
> 
> Any clues here ?

Two thoughts come to mind:

if you run the test in plugin_s4_dc, you will probably have the
privileges already, which might unblock you.

On why 'net rpc rights': the command you are running is missing
$ADDARGS, which contains a pointer to the smb.conf (we need a test
smb.conf, not the system default), and missing that might be why it
fails. 

Otherwise, playing around with make testenv is often very helpful for
this kind of thing.

SELFTEST_TESTENV=s3dc make testenv

We can also create more test users if you want, but it's a little
involved in the s3dc case.  For a privileges test, it might be worth
it. 

I can guide you on that if you want, or you can look at what the pdbtest
code does for an example.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list