Implementing SMB_VFS_FCNTL in Samba

Anoop C S anoopcs at cryptolab.net
Mon Sep 23 09:21:24 UTC 2019


Hi all,

I am attaching a patch as an attempt to implement SMB_VFS_FCNTL(for a
background see https://bugzilla.samba.org/show_bug.cgi?id=14060). But I
have the following question.

int fcntl(int fd, int cmd, ... /* arg */ );

As per man page, fcntl(2) system call can accept a third optional
argument. If present it can be of type int, struct flock *, struct
f_owner_ex * or uint64_t *. Our current SMB_VFS_LOCK and
SMB_VFS_GETLOCK takes care of "Advisory record locking" and "Open file
description locks" commands which requires third argument of type
struct flock *. Other important fact here to notice is that in most
cases the required third argument type is int. The patch I have
prepared right now assumes third argument type to be int. 

So should we rename the call to something else(keeping third argument
as int) or change the implementation to consider optional third
argument as variable?

Thanks,
Anoop C S.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-VFS-Add-SMB_VFS_FCNTL.patch
Type: text/x-patch
Size: 8823 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190923/3647e72e/0001-s3-VFS-Add-SMB_VFS_FCNTL.bin>


More information about the samba-technical mailing list