Improving smbd_smb2_request_setinfo_done/smbd_smb2_request_error tracing

Andrew Bartlett abartlet at samba.org
Tue May 21 22:23:37 UTC 2024


Kia Ora Team,

I've been helping a client out who is improving the Go SMB2 client
implementation and today we got caught in the weeds just trying to set
ACLs on Samba.

We probably have something really silly wrong, as despite being root
and just setting an ACL with smbcacls, it fails. 

Anyway, it was heavy going debugging partly as our logs are sparse in
that code, and partly as even when we have logs, the very helpful
'location' macros don't work as well as we would like

So smbd2_smb2_request_error() prints the location of the failure, but
if that is just smbd_smb2_request_setinfo_done():137 we don't get many
more clues.

Is there a legitimate way this this be unwrapped (I see I'm not meant
to read the guts of the tevent_req) to be 

smbd_smb2_request_error_ex(req, status, NULL, subreq-
>internal.finish_location)

I still don't do much with tevent, so I'm wondering is that legitimate
in this code?  Will that always be filled in?  Or could it be NULL, and
can I rely on it at least being initialised?

(eg so i can do):

smbd_smb2_request_error_ex(req, status, NULL,subreq-
>internal.finish_location ? subreq->internal.finish_location
: __location__)

Anyway, just wanted to give feedback and perhaps improve debugging here
for the next person, but lost.

Thanks,

Andrew Bartlett



-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/Samba Team Member (since 2001) https://samba.orgSamba Team Lead                https://catalyst.net.nz/services/sambaCatalyst.Net Ltd
Proudly developing Samba for Catalyst.Net Ltd - a Catalyst IT group
company
Samba Development and Support: https://catalyst.net.nz/services/samba
Catalyst IT - Expert Open Source Solutions


More information about the samba-technical mailing list