Questions regarding vfs module development

Trever L. Adams trever at
Wed Jun 8 18:15:40 UTC 2016

On 06/08/2016 12:07 PM, Jeremy Allison wrote:
> On Wed, Jun 08, 2016 at 11:37:04AM -0600, Trever L. Adams wrote:
>> I am looking at I am
>> interested in this for my own use and would love to help update it. I
>> have a few questions. Of course, all the work I am doing, I hope to get
>> committed to the authors tree.
>> 1) Is it okay to use basename and dirname (POSIX.1-2001, POSIX.1-2008)
>> in vfs modules or does there need to be ifdefs/autoconf/waf magic
>> involved? If it is not okay, are there functions that do similar in samba?
> Don't use basename/dirname. Inside smbd use parent_dirname() instead, which
> does a combination of basename/dirname.

bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
                    const char **name)

So, as I read the code, dir would be smb_fname->base_name and dirname
results would be in parent while name would be basename reults. Do I
have that correctly? Additionally, unlike POSIX definition it appears
that this function does NOT modify the original under any circumstances
and I must also TALLOC_FREE the results. Is this correct?

Thank you,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the samba-technical mailing list