Wanlong Gao
2012-Jan-30 07:22 UTC
[Libguestfs] [PATCH] guestmount: use O_ACCMODE instead of hard coding
Change hard code 3 to O_ACCMODE. it'll be more sensible. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- fuse/guestmount.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fuse/guestmount.c b/fuse/guestmount.c index bd7ba50..a9bf4e3 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -583,7 +583,7 @@ fg_open (const char *path, struct fuse_file_info *fi) { TRACE_CALL ("%s, 0%o", path, fi->flags); - int flags = fi->flags & 3; + int flags = fi->flags & O_ACCMODE; if (read_only && flags != O_RDONLY) return -EROFS; -- 1.7.9.rc2
Richard W.M. Jones
2012-Jan-30 10:58 UTC
[Libguestfs] [PATCH] guestmount: use O_ACCMODE instead of hard coding
On Mon, Jan 30, 2012 at 03:22:53PM +0800, Wanlong Gao wrote:> Change hard code 3 to O_ACCMODE. > it'll be more sensible. > > Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> > --- > fuse/guestmount.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fuse/guestmount.c b/fuse/guestmount.c > index bd7ba50..a9bf4e3 100644 > --- a/fuse/guestmount.c > +++ b/fuse/guestmount.c > @@ -583,7 +583,7 @@ fg_open (const char *path, struct fuse_file_info *fi) > { > TRACE_CALL ("%s, 0%o", path, fi->flags); > > - int flags = fi->flags & 3; > + int flags = fi->flags & O_ACCMODE; > > if (read_only && flags != O_RDONLY) > return -EROFS; > -- > 1.7.9.rc2Thanks, ACKed and committed. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
Apparently Analagous Threads
- [PATCH v2] New APIs: mount-local and umount-local using FUSE
- [PATCH 0/3] Enable FUSE support in the API via 'mount-local' call.
- [PATCH v3] New APIs: mount-local, mount-local-run and umount-local using FUSE
- [PATCH] Add readonly mode to scp, sftp_server
- [PATCH] add restricted mode to sftp-server