Displaying 15 results from an estimated 15 matches for "o_accmod".
Did you mean:
o_accmode
2012 Jan 30
1
[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/gues...
2002 Nov 05
0
[PATCH] Add readonly mode to scp, sftp_server
.../* deny client write operations */
+ int readonly = 0;
+
/* portable attibutes, etc. */
typedef struct Stat Stat;
***************
*** 390,395 ****
--- 393,404 ----
pflags = get_int(); /* portable flags */
a = get_attrib();
flags = flags_from_portable(pflags);
+ if (((flags & O_ACCMODE) == O_RDWR) ||
+ ((flags & O_ACCMODE) == O_WRONLY)) {
+ status = SSH2_FX_PERMISSION_DENIED;
+ send_status(id, status);
+ return;
+ }
mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666;
TRACE("open id %u name %s flags %d mode 0%o", id, name, p...
2013 Jun 04
1
[PATCH] add restricted mode to sftp-server
Hello.
These patches add a new mode of operation for the sftp server.
It is located between the ordinary, unrestricted mode and read-only mode.
It allows you to add files to the server, but only if these files do
not exist on the server before.
Changes to existing files - are prohibited.
Please review them, maybe these patches will be useful not only to me.
Thank you.
-------------- next part
2011 Aug 10
1
[PATCH v2] dirent.h add fdopendir()
...S
+#include <dirent.h>
+
+DIR *fdopendir(int fd)
+{
+ DIR *dp;
+ int flags;
+ struct stat st;
+
+ if (fstat(fd, &st))
+ return NULL;
+ if (!S_ISDIR(st.st_mode)) {
+ errno = ENOTDIR;
+ return NULL;
+ }
+
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1)
+ return NULL;
+ if ((flags & O_ACCMODE) == O_WRONLY) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ dp = malloc(sizeof(DIR));
+
+ if(!dp)
+ return NULL;
+
+ dp->__fd = fd;
+ dp->next = NULL;
+ dp->bytes_left = 0;
+ return dp;
+}
diff --git a/usr/klibc/tests/Kbuild b/usr/klibc/tests/Kbuild
index a3e0254..5e6e073 100644
--- a/usr...
2019 Dec 11
0
[PATCH 15/24] compat_ioctl: scsi: move ioctl handling into drivers
...Sg_request *srp;
unsigned long iflags;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
- return -ENXIO;
-
SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,
"sg_ioctl: cmd=0x%x\n", (int) cmd_in));
read_only = (O_RDWR != (filp->f_flags & O_ACCMODE));
@@ -1145,29 +1140,44 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
cmd_in, filp->f_flags & O_NDELAY);
if (result)
return result;
+
+ return -ENOIOCTLCMD;
+}
+
+static long
+sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
+{
+ void __u...
2019 Dec 11
3
[PATCH 00/24] block, scsi: final compat_ioctl cleanup
Hi Jens, James and Martin,
This series concludes the work I did for linux-5.5 on the compat_ioctl()
cleanup, killing off fs/compat_ioctl.c and block/compat_ioctl.c by moving
everything into drivers.
Overall this would be a reduction both in complexity and line count, but
as I'm also adding documentation the overall number of lines increases
in the end.
My plan was originally to keep the
2020 Jan 02
1
[PATCH v3 13/22] compat_ioctl: scsi: move ioctl handling into drivers
...Sg_request *srp;
unsigned long iflags;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
- return -ENXIO;
-
SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,
"sg_ioctl: cmd=0x%x\n", (int) cmd_in));
read_only = (O_RDWR != (filp->f_flags & O_ACCMODE));
@@ -1146,29 +1141,44 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
cmd_in, filp->f_flags & O_NDELAY);
if (result)
return result;
+
+ return -ENOIOCTLCMD;
+}
+
+static long
+sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
+{
+ void __u...
2006 Jun 26
2
[klibc 28/43] mips support for klibc
...finitions.
+ */
+
+#ifndef _KLIBC_ARCHFCNTL_H
+#define _KLIBC_ARCHFCNTL_H
+
+#ifdef _ASM_FCNTL_H /* We were too late! */
+# error "<asm/fcntl.h> included before <klibc/archfcntl.h>"
+#endif
+#define _ASM_FCNTL_H /* Keep <asm/fcntl.h> from getting included */
+
+#define O_ACCMODE 0x0003
+#define O_RDONLY 0x0000
+#define O_WRONLY 0x0001
+#define O_RDWR 0x0002
+#define O_APPEND 0x0008
+#define O_SYNC 0x0010
+#define O_NONBLOCK 0x0080
+#define O_CREAT 0x0100
+#define O_TRUNC 0x0200
+#define O_EXCL 0x0400
+#define O_NOCTTY 0x0800
+#define FASYNC 0x1000
+#define O_...
2015 Jul 02
0
[PATCH] Fix various -Wformat problems.
...;%s, %ld, %ld", path, (long) uid, (long) gid);
+ DEBUG_CALL ("%s, %ju, %ju", path, (uintmax_t) uid, (uintmax_t) gid);
if (g->ml_read_only) return -EROFS;
@@ -630,7 +630,7 @@ mount_local_open (const char *path, struct fuse_file_info *fi)
{
int flags = fi->flags & O_ACCMODE;
DECL_G ();
- DEBUG_CALL ("%s, 0%o", path, fi->flags);
+ DEBUG_CALL ("%s, 0%o", path, (unsigned) fi->flags);
if (g->ml_read_only && flags != O_RDONLY)
return -EROFS;
diff --git a/src/handle.c b/src/handle.c
index 51b9572..12c1fb2 100644
--- a/src...
2015 Jul 02
0
[PATCH v2] Fix various -Wformat problems.
...;%s, %ld, %ld", path, (long) uid, (long) gid);
+ DEBUG_CALL ("%s, %ju, %ju", path, (uintmax_t) uid, (uintmax_t) gid);
if (g->ml_read_only) return -EROFS;
@@ -630,7 +630,7 @@ mount_local_open (const char *path, struct fuse_file_info *fi)
{
int flags = fi->flags & O_ACCMODE;
DECL_G ();
- DEBUG_CALL ("%s, 0%o", path, fi->flags);
+ DEBUG_CALL ("%s, 0%o", path, (unsigned) fi->flags);
if (g->ml_read_only && flags != O_RDONLY)
return -EROFS;
diff --git a/src/handle.c b/src/handle.c
index 51b9572..12c1fb2 100644
--- a/src...
2012 Mar 28
2
[PATCH v2] New APIs: mount-local and umount-local using FUSE
This version doesn't crash or cause hung processes or stuck
mountpoints, so that's an improvement.
Rich.
2012 Mar 27
3
[PATCH 0/3] Enable FUSE support in the API via 'mount-local' call.
This patch is just for review.
It enables FUSE support in the API via two new calls,
'guestfs_mount_local' and 'guestfs_umount_local'.
FUSE turns out to be very easy to deadlock (necessitating that the
machine be rebooted). Running the test from the third patch is
usually an effective way to demonstrate this. However I have not yet
managed to produce a simple reproducer that
2012 Mar 29
3
[PATCH v3] New APIs: mount-local, mount-local-run and umount-local using FUSE
This changes the proposed API slightly.
Previously 'mount-local' generating a 'mounted' event when the
filesystem was ready, and from the 'mounted' event you had to
effectively do a fork.
Now, 'mount-local' just initializes the mountpoint and you have to
call 'mount-local-run' to enter the FUSE main loop. Between these
calls you can do a fork or whatever
2019 Oct 12
3
[PATCH libnbd] nbdfuse: New tool to present a network block device in a FUSE filesystem.
...2) call, so we have to check the open mode is compatible with
+ * the readonly flag.
+ */
+static int
+nbdfuse_open (const char *path, struct fuse_file_info *fi)
+{
+ if (path[0] != '/' || strcmp (path+1, filename) != 0)
+ return -ENOENT;
+
+ if (readonly && (fi->flags & O_ACCMODE) != O_RDONLY)
+ return -EACCES;
+
+ return 0;
+}
+
+static int
+nbdfuse_read (const char *path, char *buf,
+ size_t count, off_t offset,
+ struct fuse_file_info *fi)
+{
+ if (path[0] != '/' || strcmp (path+1, filename) != 0)
+ return -ENOENT;
+
+ if (offs...
2006 Jun 28
35
[klibc 00/31] klibc as a historyless patchset (updated and reorganized)
I have updated the klibc patchset based on feedback received. In
particular, the patchset has been reorganized so as not to break
git-bisect.
Additionally, this updates the patch base to 2.6.17-git12
(d38b69689c349f35502b92e20dafb30c62d49d63) and klibc 1.4.8; the main
difference on the klibc side is removal of obsolete code.
This is also available as a git tree at: