git://git.openafs.org
/
openafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
0d1159c
)
uafs-fixes-20040520
author
Nickolai Zeldovich
<kolya@mit.edu>
Thu, 20 May 2004 20:15:04 +0000 (20:15 +0000)
committer
Nickolai Zeldovich
<kolya@mit.edu>
Thu, 20 May 2004 20:15:04 +0000 (20:15 +0000)
Make uafs not crash if uafs_fstat() is used. Fix open(O_RDONLY).
src/afs/UKERNEL/afs_usrops.c
patch
|
blob
|
history
diff --git
a/src/afs/UKERNEL/afs_usrops.c
b/src/afs/UKERNEL/afs_usrops.c
index
2aa393e
..
2d940ec
100644
(file)
--- a/
src/afs/UKERNEL/afs_usrops.c
+++ b/
src/afs/UKERNEL/afs_usrops.c
@@
-2751,6
+2751,10
@@
uafs_open_r(char *path, int flags, int mode)
if (flags & (O_WRONLY | O_RDWR)) {
openFlags |= FWRITE;
}
+ if ((openFlags & (FREAD | FWRITE)) == 0) {
+ /* O_RDONLY is 0, so ... */
+ openFlags |= FREAD;
+ }
/*
* Truncate if necessary
@@
-3064,7
+3068,6
@@
uafs_fstat_r(int fd, struct stat *buf)
return -1;
}
code = uafs_GetAttr(vp, buf);
- VN_RELE(vp);
if (code) {
errno = code;
return -1;