and '?' can be used to specify multiple files or directories
as in DOS wildcards.</para>
+ <para>
+ If a file or directory name is prefixed by "../USERNAME/"
+ or "../GROUPNAME/", then the subsequent filename is only hidden for the
+ given user or group. Instead of specifying users or groups by name, they
+ can also be specified by SID.
+ </para>
+
+ <para>User and group names use the same format as <smbconfoption
+ name="valid users"/>.</para>
+
<para>Each entry must be a Unix path, not a DOS path and must
not include the Unix directory separator '/'.</para>
An example of us of this parameter is:
<programlisting>
hide files = /.*/DesktopFolderDB/TrashFor%m/resource.frk/
+
+; Hide some files for anyone and some files for specific users and groups
+hide files = hideforall1/../joe/hideforuserjoe/hideforall2/../students/hideforstudents/hideforall3
+hide files = ../UNIVERSITY\Alumnis/somefile.txt/../john@university.org/anotherfile.txt
+hide files = ../S-1-5-21-123-456-789-1000/secretfile.txt
+
</programlisting>
</para>
</description>
</para>
<para>
- Each entry must be a unix path, not a DOS path and must <emphasis>not</emphasis> include the
+ If a file or directory name is prefixed by "../USERNAME/"
+ or "../GROUPNAME/", then the subsequent filename is only hidden for the
+ given user or group. Instead of specifying users or groups by name, they
+ can also be specified by SID.
+ </para>
+
+ <para>User and group names use the same format as <smbconfoption
+ name="valid users"/>.</para>
+
+ <para>
+ Each filename must be a unix path, not a DOS path and must
+ <emphasis>not</emphasis> include the
unix directory separator '/'.
</para>
; word root.
veto files = /*Security*/*.tmp/*root*/
+; Veto some files for anyone and some files for specific users and groups
+veto files = /vetoforall1/../USER/vetoforuser/vetoforall2/../GROUP/vetoforgroup/vetoforall3/
+veto files = ../UNIVERSITY\Alumnis/somefile.txt/../john@university.org/anotherfile.txt
+veto files = ../S-1-5-21-123-456-789-1000/secretfile.txt
+
; Veto the Apple specific files that a NetAtalk server
; creates.
veto files = /.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/
const char *name);
void set_namearray(TALLOC_CTX *mem_ctx,
const char *namelist,
+ const struct security_token *token,
struct name_compare_entry **_name_array);
bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type);
bool fcntl_getlock(int fd, int op, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid);
void set_namearray(TALLOC_CTX *mem_ctx,
const char *namelist_in,
+ const struct security_token *token,
struct name_compare_entry **_name_array)
{
struct name_compare_entry *name_array = NULL;
continue;
}
+ if (ISDOTDOT(p) && token != NULL) {
+ const char *username = NULL;
+ bool match;
+
+ /* Get the username */
+ p = strv_next(namelist, p);
+ if (p == NULL) {
+ DBG_ERR("Missing username\n");
+ TALLOC_FREE(namelist);
+ return;
+ }
+ username = p;
+
+ /* Get the filename */
+ p = strv_next(namelist, p);
+ if (p == NULL) {
+ DBG_ERR("Missing filename after username '%s'\n",
+ username);
+ TALLOC_FREE(namelist);
+ return;
+ }
+
+ match = token_contains_name(talloc_tos(),
+ NULL,
+ NULL,
+ NULL,
+ token,
+ username);
+ if (!match) {
+ continue;
+ }
+ }
+
e->name = p;
e->is_wild = ms_has_wild(e->name);
e++;
if (exclude_files != NULL) {
set_namearray(config,
exclude_files,
+ NULL,
&config->exclude_files);
}
if (infected_files != NULL) {
set_namearray(config,
infected_files,
+ NULL,
&config->infected_files);
}
if (!IS_IPC(conn) && !IS_PRINT(conn)) {
set_namearray(conn,
lp_veto_oplock_files(talloc_tos(), lp_sub, snum),
+ NULL,
&conn->veto_oplock_list);
set_namearray(conn,
lp_aio_write_behind(talloc_tos(), lp_sub, snum),
+ NULL,
&conn->aio_write_behind_list);
}
smb_fname_cpath = synthetic_smb_fname(talloc_tos(),
if (!IS_IPC(conn) && !IS_PRINT(conn)) {
set_namearray(conn,
lp_veto_files(talloc_tos(), lp_sub, snum),
+ session_info->security_token,
&ent->veto_list);
set_namearray(conn,
lp_hide_files(talloc_tos(), lp_sub, snum),
+ session_info->security_token,
&ent->hide_list);
}
d_fprintf(stderr, "namelist: %s\n", namelist);
- set_namearray(talloc_tos(), namelist, &name_entries);
+ set_namearray(talloc_tos(), namelist, NULL, &name_entries);
SMB_ASSERT(name_entries != NULL);
status = samba_path_matching_mswild_create(talloc_tos(),
lib/util_namearray.c
''',
deps='''
+ samba-passdb
''')
if bld.env.with_ctdb: