Fix open mode fordirs

This commit is contained in:
wbaumann 2009-05-15 18:42:00 +00:00
parent 76beee96ef
commit 1dca8d5a4a
3 changed files with 16 additions and 16 deletions

View File

@ -1090,7 +1090,7 @@ dav_open(int *fd, dav_node *node, int flags, pid_t pid, pid_t pgid, uid_t uid,
if (create_dir_cache_file(node) != 0) if (create_dir_cache_file(node) != 0)
return EIO; return EIO;
node->atime = time(NULL); node->atime = time(NULL);
return open_file(fd, node, O_RDWR, pid, pgid, uid); return open_file(fd, node, O_RDONLY, pid, pgid, uid);
} }


int ret = 0; int ret = 0;

View File

@ -219,7 +219,7 @@ dav_coda_loop(int device, size_t bufsize, time_t idle_time,
case CODA_OPEN: case CODA_OPEN:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_OPEN:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_OPEN:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_CLOSE: case CODA_CLOSE:
@ -229,7 +229,7 @@ dav_coda_loop(int device, size_t bufsize, time_t idle_time,
case CODA_IOCTL: case CODA_IOCTL:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_IOCTL:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_IOCTL:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_GETATTR: case CODA_GETATTR:
@ -261,7 +261,7 @@ dav_coda_loop(int device, size_t bufsize, time_t idle_time,
case CODA_LINK: case CODA_LINK:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_LINK:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_LINK:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_RENAME: { case CODA_RENAME: {
@ -296,13 +296,13 @@ dav_coda_loop(int device, size_t bufsize, time_t idle_time,
case CODA_SYMLINK: case CODA_SYMLINK:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_SYMLINK:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_SYMLINK:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_READLINK: case CODA_READLINK:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_READLINK:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_READLINK:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_FSYNC: { case CODA_FSYNC: {
@ -318,14 +318,14 @@ dav_coda_loop(int device, size_t bufsize, time_t idle_time,
case CODA_VGET: case CODA_VGET:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_VGET:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "CODA_VGET:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_OPEN_BY_PATH: case CODA_OPEN_BY_PATH:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
"CODA_OPEN_BY_PATH:"); "CODA_OPEN_BY_PATH:");
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
case CODA_STATFS: case CODA_STATFS:
@ -350,7 +350,7 @@ dav_coda_loop(int device, size_t bufsize, time_t idle_time,
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
"UNKNOWN CODA CALL %u", ih->opcode); "UNKNOWN CODA CALL %u", ih->opcode);
oh->result = ENOTSUP; oh->result = ENOSYS;
len = sizeof(struct coda_out_hdr); len = sizeof(struct coda_out_hdr);
break; break;
} }

View File

@ -235,13 +235,13 @@ dav_fuse_loop(int device, size_t bufsize, time_t idle_time,
case FUSE_READLINK: case FUSE_READLINK:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_READLINK:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_READLINK:");
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
case FUSE_SYMLINK: case FUSE_SYMLINK:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_SYMLINK:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_SYMLINK:");
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
case FUSE_MKNOD: case FUSE_MKNOD:
@ -284,7 +284,7 @@ dav_fuse_loop(int device, size_t bufsize, time_t idle_time,
case FUSE_LINK: case FUSE_LINK:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_LINK:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_LINK:");
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
case FUSE_OPEN: case FUSE_OPEN:
@ -317,7 +317,7 @@ dav_fuse_loop(int device, size_t bufsize, time_t idle_time,
case FUSE_SETXATTR: case FUSE_SETXATTR:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_GETXATTR:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_GETXATTR:");
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
case FUSE_GETXATTR: case FUSE_GETXATTR:
@ -329,7 +329,7 @@ dav_fuse_loop(int device, size_t bufsize, time_t idle_time,
case FUSE_REMOVEXATTR: case FUSE_REMOVEXATTR:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_REMOVEXATTR:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_REMOVEXATTR:");
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
case FUSE_FLUSH: case FUSE_FLUSH:
@ -354,7 +354,7 @@ dav_fuse_loop(int device, size_t bufsize, time_t idle_time,
case FUSE_FSYNCDIR: case FUSE_FSYNCDIR:
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_FSYNCDIR:"); syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "FUSE_FSYNCDIR:");
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
case FUSE_ACCESS: case FUSE_ACCESS:
@ -367,7 +367,7 @@ dav_fuse_loop(int device, size_t bufsize, time_t idle_time,
if (debug) if (debug)
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
"UNKNOWN FUSE CALL %i", ih->opcode); "UNKNOWN FUSE CALL %i", ih->opcode);
oh->error = -ENOTSUP; oh->error = -ENOSYS;
oh->len = sizeof(struct fuse_out_header); oh->len = sizeof(struct fuse_out_header);
break; break;
} }