fix EBADF when coda closes directory

This commit is contained in:
wbaumann 2009-08-26 19:40:58 +00:00
parent 0f5d297c48
commit 0de3396a3d
3 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,11 @@
ChangeLog for davfs2 ChangeLog for davfs2
-------------------- --------------------


2009-08-26 Werner Baumann (werner.baumann@onlinehome.de)
* cache.c, dav_close:
In call to get_file_handle set parameter accmode
to O_RDWR for directories (to avoid EBADF with coda).

2009-07-17 Werner Baumann (werner.baumann@onlinehome.de) 2009-07-17 Werner Baumann (werner.baumann@onlinehome.de)
* webdav.c, prop_result: * webdav.c, prop_result:
Remove double slashes from path. Remove double slashes from path.

1
THANKS
View File

@ -54,6 +54,7 @@ Arkadiusz Miskiewicz <arekm@users.sourceforge.net>
Maik Nijhuis <manyac@users.sourceforge.net> Maik Nijhuis <manyac@users.sourceforge.net>
Joseph Wayne Norton <natsukashi@users.sourceforge.net> Joseph Wayne Norton <natsukashi@users.sourceforge.net>
Tim Olsen <tim@brooklynpenguin.com> Tim Olsen <tim@brooklynpenguin.com>
Jan Ortgies <design@mediaworldgmbh.de>
Joe Orton <joe@manyfish.co.uk> Joe Orton <joe@manyfish.co.uk>
Panu Outinen <poutinen@users.sourceforge.net> Panu Outinen <poutinen@users.sourceforge.net>
Tero Pelander <tpeland2@users.sourceforge.net> Tero Pelander <tpeland2@users.sourceforge.net>

View File

@ -836,7 +836,9 @@ dav_close(dav_node *node, int fd, int flags, pid_t pid, pid_t pgid)
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), " close %s", node->path); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), " close %s", node->path);


dav_handle *fh = get_file_handle(node, fd, flags & O_ACCMODE, pid, pgid); dav_handle *fh = get_file_handle(node, fd,
is_dir(node) ? O_RDWR : flags & O_ACCMODE,
pid, pgid);
if (!fh) if (!fh)
return EBADF; return EBADF;