always canonicalize mount point
This commit is contained in:
parent
f8e3e247ad
commit
93a8791136
@ -1,6 +1,10 @@
|
||||
ChangeLog for davfs2
|
||||
--------------------
|
||||
|
||||
2010-11-03 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* mount_davfs.c, check_mountpoint:
|
||||
Always canonicalize mount point.
|
||||
|
||||
2010-08-07 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* webdav.c:
|
||||
Added missing '\r' in constant none_match_header
|
||||
|
@ -758,13 +758,16 @@ check_mountpoint(dav_args *args)
|
||||
{
|
||||
|
||||
struct passwd *pw;
|
||||
int relative = (*mpoint != '/');
|
||||
|
||||
if (*mpoint != '/') {
|
||||
char *mp = canonicalize_file_name(mpoint);
|
||||
if (!mp)
|
||||
error(EXIT_FAILURE, 0,
|
||||
_("can't evaluate path of mount point %s"), mpoint);
|
||||
if (getuid() != 0) {
|
||||
free(mpoint);
|
||||
mpoint = mp;
|
||||
|
||||
if (relative && getuid() != 0) {
|
||||
pw = getpwuid(getuid());
|
||||
if (!pw || !pw->pw_dir)
|
||||
error(EXIT_FAILURE, 0,
|
||||
@ -773,9 +776,6 @@ check_mountpoint(dav_args *args)
|
||||
error(EXIT_FAILURE, 0, _("A relative mount point must lie "
|
||||
"within your home directory"));
|
||||
}
|
||||
free(mpoint);
|
||||
mpoint = mp;
|
||||
}
|
||||
|
||||
if (strcmp(mpoint, "/") == 0 || strlen(mpoint) < 2)
|
||||
error(EXIT_FAILURE, 0, _("invalid mount point %s"), mpoint);
|
||||
|
Loading…
Reference in New Issue
Block a user