Bug 7415 - recycle:exclude_dir will match directory at any depth
Summary: recycle:exclude_dir will match directory at any depth
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: unspecified
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL: http://gitweb.samba.org/?p=samba.git;...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 18:38 UTC by Zrin
Modified: 2021-08-11 20:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zrin 2010-05-06 18:38:51 UTC
the problem is with the function 
static bool matchdirparam(const char **dir_exclude_list, char *path)
in modules/vfs_recycle.c

this function processes the parameter recycle:exclude_dir
in a way that it is used only to check single path element at a time.
So on one side, pattern like  "data/mail" will never match,
on the other side, pattern like "mail" will match
"/mail", "/data/mail", as well as "/data/john/important/mail" etc.

This is not described in the doc as well as it is not intuitive
and may result in data loss.

I suggest to change semantics to allow control over
what part of the path is matched and if the pattern is anchored,
e.g. pattern like /mail should be anchored and match only start
of the path (under the share or absolute).
Most important - the semantics needs to be described in the docs.