llow for open(..., O_CREATE, 444)
This commit is contained in:
parent
35ba2db45a
commit
c5872e5833
@ -1,6 +1,11 @@
|
|||||||
ChangeLog for davfs2
|
ChangeLog for davfs2
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
2009-05-01 Werner Baumann (werner.baumann@onlinehome.de)
|
||||||
|
* cache.h, dav_open:
|
||||||
|
Add parameter open_create to allow
|
||||||
|
for open(..., O_CREATE, 444).
|
||||||
|
|
||||||
2009-04-30 Werner Baumann (werner.baumann@onlinehome.de)
|
2009-04-30 Werner Baumann (werner.baumann@onlinehome.de)
|
||||||
* cache.c, dav_close:
|
* cache.c, dav_close:
|
||||||
if delay_upload == 0 save to server immediately.
|
if delay_upload == 0 save to server immediately.
|
||||||
|
@ -1062,7 +1062,8 @@ dav_mkdir(dav_node **nodep, dav_node *parent, const char *name, uid_t uid,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
dav_open(int *fd, dav_node *node, int flags, pid_t pid, pid_t pgid, uid_t uid)
|
dav_open(int *fd, dav_node *node, int flags, pid_t pid, pid_t pgid, uid_t uid,
|
||||||
|
int open_create)
|
||||||
{
|
{
|
||||||
if (!is_valid(node))
|
if (!is_valid(node))
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
@ -1079,7 +1080,7 @@ dav_open(int *fd, dav_node *node, int flags, pid_t pid, pid_t pgid, uid_t uid)
|
|||||||
} else {
|
} else {
|
||||||
how = R_OK | W_OK;
|
how = R_OK | W_OK;
|
||||||
}
|
}
|
||||||
if (!has_permission(node, uid, how))
|
if (!open_create && !has_permission(node, uid, how))
|
||||||
return EACCES;
|
return EACCES;
|
||||||
|
|
||||||
if (is_dir(node)) {
|
if (is_dir(node)) {
|
||||||
|
@ -335,9 +335,14 @@ dav_mkdir(dav_node **nodep, dav_node *parent, const char *name, uid_t uid,
|
|||||||
Permissions:
|
Permissions:
|
||||||
uid must have execute permission for parent and all of its ancestors, as
|
uid must have execute permission for parent and all of its ancestors, as
|
||||||
as well as read and/or write permission for node, according to the
|
as well as read and/or write permission for node, according to the
|
||||||
accessmode. */
|
accessmode.
|
||||||
|
If open_create is set to 1, permissions will not be checked. This flag must
|
||||||
|
only be set when the call to dav_open is part of an open-call with flag
|
||||||
|
O_CREATE. It allows dav_open to succeed if when the file mode would not
|
||||||
|
allow this. */
|
||||||
int
|
int
|
||||||
dav_open(int *fd, dav_node *node, int flags, pid_t pid, pid_t pgid, uid_t uid);
|
dav_open(int *fd, dav_node *node, int flags, pid_t pid, pid_t pgid, uid_t uid,
|
||||||
|
int open_create);
|
||||||
|
|
||||||
/* Reads size bytes from file descriptor fd, starting at position offset
|
/* Reads size bytes from file descriptor fd, starting at position offset
|
||||||
and copies them into buf.
|
and copies them into buf.
|
||||||
|
@ -603,7 +603,7 @@ coda_open_by_fd(void)
|
|||||||
}
|
}
|
||||||
flags |= (in->flags & C_O_TRUNC) ? O_TRUNC : 0;
|
flags |= (in->flags & C_O_TRUNC) ? O_TRUNC : 0;
|
||||||
|
|
||||||
oh->result = dav_open(&out->fd, node, flags, ih->pid, ih->pgid, ih->uid);
|
oh->result = dav_open(&out->fd, node, flags, ih->pid, ih->pgid, ih->uid, 0);
|
||||||
|
|
||||||
if (oh->result || !out->fd) {
|
if (oh->result || !out->fd) {
|
||||||
if (!oh->result)
|
if (!oh->result)
|
||||||
|
@ -479,7 +479,7 @@ fuse_create(void)
|
|||||||
|
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
oh->error = dav_open(&fd, node, in->flags & ~(O_EXCL | O_CREAT), ih->pid,
|
oh->error = dav_open(&fd, node, in->flags & ~(O_EXCL | O_CREAT), ih->pid,
|
||||||
0, ih->uid);
|
0, ih->uid, 1);
|
||||||
|
|
||||||
if (oh->error || !fd) {
|
if (oh->error || !fd) {
|
||||||
if (created)
|
if (created)
|
||||||
@ -806,7 +806,7 @@ fuse_open(void)
|
|||||||
|
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
oh->error = dav_open(&fd, (dav_node *) ((size_t) ih->nodeid), in->flags,
|
oh->error = dav_open(&fd, (dav_node *) ((size_t) ih->nodeid), in->flags,
|
||||||
ih->pid, 0, ih->uid);
|
ih->pid, 0, ih->uid, 0);
|
||||||
|
|
||||||
if (oh->error || !fd) {
|
if (oh->error || !fd) {
|
||||||
if (!oh->error)
|
if (!oh->error)
|
||||||
|
Loading…
Reference in New Issue
Block a user