Correctly set cli->raw_status for libsmbclient in SMB2 code

github at samba.org github at samba.org
Wed Apr 13 21:04:50 UTC 2016


New comment by jrasamba on Samba Github repository

https://github.com/samba-team/samba/pull/59#issuecomment-209646804
Comment:
On Sat, Apr 09, 2016 at 05:37:31AM -0700, Robin McCorkell wrote:
> The SMB2 file handling code wasn't correctly setting raw_status, which is used by libsmbclient to report file open errors etc.
> 
> The bug was originally found when attempting to do a `stat()` on a non-existing file behind a DFS link. Before this patch, the code returned was 22 (EINVAL), rather than the expected 2 (ENOENT), since the SMB result status wasn't set into the cli object. The easiest way to demonstrate this is to run the attached test program against a Samba server configured with DFS (for an easy test environment, run `docker pull xenopathic/samba-dfs && docker run -e SMB_USER=test -e SMB_PASSWORD=test --rm xenopathic/samba-dfs`). Make sure smb.conf contains `client max protocol = SMB2` or higher of course.
> 
> The fix for the actual noticed bug is the line added to `cli_smb2_create_fnum_recv()`, but I added similar lines to all other `cli_smb2_*_recv()` functions since the behaviour should be the same.

This is close, but not quite in the right place I think.

Can you give me a little time to look into this ?

Did you log a bug in bugzilla.samba.org so we can track it?

Cheers,

	Jeremy.



More information about the samba-technical mailing list