Bug 7415 - recycle:exclude_dir will match directory at any depth
recycle:exclude_dir will match directory at any depth
Status: NEW
Product: Samba 3.4
Classification: Unclassified
Component: VFS Modules
All All
: P3 major
: ---
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2010-05-06 18:38 UTC by Zrin
Modified: 2010-05-06 18:38 UTC (History)
0 users

See Also:


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.