Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7437
b: refs/heads/master
c: e08fc04
h: refs/heads/master
i:
  7435: db2783a
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Sep 7, 2005
1 parent 8c69e21 commit 0774127
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e922efc342d565a38eed3af377ff403f52148864
refs/heads/master: e08fc0457af28f2ebec36296ea7ada6024fde81b
27 changes: 13 additions & 14 deletions trunk/fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,23 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
return -ENOMEM;
}

if(nd) {
if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY)
desiredAccess = GENERIC_READ;
else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY) {
desiredAccess = GENERIC_WRITE;
write_only = TRUE;
} else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
/* GENERIC_ALL is too much permission to request */
/* can cause unnecessary access denied on create */
/* desiredAccess = GENERIC_ALL; */
desiredAccess = GENERIC_READ | GENERIC_WRITE;
if(nd && (nd->flags & LOOKUP_OPEN)) {
int oflags = nd->intent.open.flags;

desiredAccess = 0;
if (oflags & FMODE_READ)
desiredAccess |= GENERIC_READ;
if (oflags & FMODE_WRITE) {
desiredAccess |= GENERIC_WRITE;
if (!(oflags & FMODE_READ))
write_only = TRUE;
}

if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
if((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
disposition = FILE_CREATE;
else if((nd->intent.open.flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
else if((oflags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
disposition = FILE_OVERWRITE_IF;
else if((nd->intent.open.flags & O_CREAT) == O_CREAT)
else if((oflags & O_CREAT) == O_CREAT)
disposition = FILE_OPEN_IF;
else {
cFYI(1,("Create flag not set in create function"));
Expand Down

0 comments on commit 0774127

Please sign in to comment.