[PATCH] First step in changing VFS interfaces from const char * to const struct smb_filename *

Jeremy Allison jra at samba.org
Fri Feb 12 21:20:36 UTC 2016


Re: Removing lp_posix_pathnames().

I thought I'd start with one of the more difficult
interfaces just to prove the change works, so here
is a patch to change SMB_VFS_GET_NT_ACL() from
taking a 'const char *' to a 'const struct smb_filename *'

It's mostly boilerplate, except for a couple of things.

1). When changing a function call to take the longer
parameter name, if the resulting line went over 80
chars I changed the call format from:

	param_call(with, a long, list, of, parameters);

 to:

	param_call(with,
		a,
		long,
		list,
		of,
		parameters);

theoritically I coud have done a first pass patch
that did this first, or a second pass patch that
tidies up after the change, but as this only happened in
a few places I thought it made more sense to do it
inline. Let me know if you disagree.

2). There were 4 modules that transform the incoming
pathname before passing to a subsequent SMB_VFS_GET_NT_ACL()
or SMB_VFS_NEXT_GET_NT_ACL() call. These are:

vfs_catia.c
vfs_media_harmony.c
vfs_shadow_copy2.c
vfs_unityed_media.c

so for these I use a boilerplate transform of:

+       struct smb_filename *mapped_smb_fname = NULL;
...
+       mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       mapped_name,
+                                       NULL,
+                                       NULL);
+       if (mapped_smb_fname == NULL) {
+               TALLOC_FREE(mapped_name);
+               return NT_STATUS_NO_MEMORY;
+       }
+

before calling SMB_VFS_NEXT_GET_NT_ACL() with the
new mapped_smb_fname struct pointer.

Works fine here in testing. Please review and
push if happy. Once this is in I'll post follow-ups
for the other 'const char *' VFS interfaces.

Cheers,

	Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-VFS-Modify-SMB_VFS_GET_NT_ACL-to-take-a-const-str.patch
Type: text/x-diff
Size: 25971 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160212/dfee18f4/0001-s3-VFS-Modify-SMB_VFS_GET_NT_ACL-to-take-a-const-str.diff>


More information about the samba-technical mailing list