smb2.session.reauth4: UID/GID to use as anonymous user when modifying DACL

sprabhu at redhat.com sprabhu at redhat.com
Fri Jun 14 16:19:09 UTC 2024


Hello Team, 

I have been testing the latest vfs_ceph2(experimental) module in the
process of being written by Shachar Sharon.
I hit a failure in the test 
smb2.session.reauth4

failure: samba3.smb2.session.reauth4 [
Exception: ../../source4/torture/smb2/session.c:603: status was
NT_STATUS_ACCESS_DENIED, expected NT_STATUS_OK: smb2_setinfo_file
failed

]

>From what I understand, the test does the following
test_session_reauth4()
- SESSION setup with test user
- CREATE file
- GETINFO SEC_INFO on the file - get owner, group and dacl
- Reauthticate as anonymous - SESSION setup with anonymous user
- SETINFO on file - We copy the DACL from the earlier GETINFO and add
additional access for anonymous user.
- Reauthenticate as original user - SESSION setup with test user.
- GETINFO on the same file

The failure happend when we attempt the SETINFO as anonymous user and
an ACCESS_DENIED error is returned at
https://gitlab.com/synarete/samba/-/blob/vfs_ceph_ll/source3/modules/vfs_ceph2.c?ref_type=heads#L1039

This appears to be caused by the perms set earlier and passed to the
ceph_ll_listxattr(). These are set at
https://gitlab.com/synarete/samba/-/blob/vfs_ceph_ll/source3/modules/vfs_ceph2.c?ref_type=heads#L533
using the uid and gid in unix_token.

By adding instrumentation, we can see that the uid/gid set in the
unix_token at this time is for user nobody/nobody which is mapped to
anonymous user. This user obviously doesn't have permissions to modify
the file. 

At the same time, I can also see that getuid()/getgid() returns 0/0 and
geteuid()/getegid() also returns 0/0. Does the default plugin use
uid/gid 0/0 while performing this operation?

I have the following questions
1) What are we testing for with this smbtorture test?
2) Is the anonymous user allowed to modify the DACL of the file as done
in the test? This would obviously lead to access denied errors as we
see currently.
3) What uid/gid should be set when performing this action as the
anonymous user?

Sachin Prabhu




More information about the samba-technical mailing list