Add smbstatus test (lock file with smbclient)

Ralph Böhme slow at samba.org
Wed Mar 13 14:02:25 UTC 2019


Hi Andreas

Am 13.03.2019 um 12:08 schrieb Andreas Schneider via samba-technical <samba-technical at lists.samba.org>:
> I've created a patch for 'smbstatus -L --resolve-uids' to show usernames 
> instead of UIDs as I have a customer request for it.
> 
> However Andrew rejected the patch to go in without a test. I've tried to 
> implement a test for smbstatus but it doesn't work. My problem is that I'm not 
> able to create a lock on a file to show up with smbstatus later.
> 
> I can:
> 
> open <file>
> 
> but I can't pass the returned fnum to
> 
> lock <fnum> r 0x0 0x1
> 

Looks like lock is obly implemented for SMB1. Also, you seem to use a hardcoded fnum value of 0, for SMB2+ I seem to get 1, and for SMB1 it's worse, as you'll get a random number there.

> to create a lock. See attached patch ...
> 
> Any suggestions how to move forward?

Implement lock for SMB2?

I personally wouldn't care about a test for smbstatus output, that's an untested mess anyway. If we have something like stable JSON output, then sure.

-slow


More information about the samba-technical mailing list