From 359e1f2a25d242984229edfb378c0b95c3ee8570 Mon Sep 17 00:00:00 2001 From: Chas Williams <3chas3@gmail.com> Date: Wed, 2 Dec 2015 10:38:42 -0500 Subject: [PATCH] Open syscall emulation file O_RDONLY As reported on the -info mailing list, docker is now exporting the /proc filesystem as read only. ioctl() doesn't need write permissions to do its work, so change O_RDWR to O_RDONLY. Change-Id: I2068888b13b6b5e31b1a2205bbcbe43f5f9fc55a Reviewed-on: http://gerrit.openafs.org/12122 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Benjamin Kaduk --- src/sys/glue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sys/glue.c b/src/sys/glue.c index ff9ad681aa..356245975c 100644 --- a/src/sys/glue.c +++ b/src/sys/glue.c @@ -24,9 +24,9 @@ int proc_afs_syscall(long syscall, long param1, long param2, long param3, long param4, int *rval) { struct afsprocdata syscall_data; - int fd = open(PROC_SYSCALL_FNAME, O_RDWR); + int fd = open(PROC_SYSCALL_FNAME, O_RDONLY); if(fd < 0) - fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDWR); + fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDONLY); if(fd < 0) return -1; @@ -50,7 +50,7 @@ int ioctl_afs_syscall(long syscall, long param1, long param2, long param3, struct afssysargs syscall_data; void *ioctldata; int code; - int fd = open(SYSCALL_DEV_FNAME, O_RDWR); + int fd = open(SYSCALL_DEV_FNAME, O_RDONLY); int syscallnum; #ifdef AFS_DARWIN100_ENV struct afssysargs64 syscall64_data; @@ -132,7 +132,7 @@ ioctl_sun_afs_syscall(long syscall, uintptr_t param1, uintptr_t param2, callnum = VIOC_SYSCALL; # endif /* !_ILP32 */ - fd = open(SYSCALL_DEV_FNAME, O_RDWR); + fd = open(SYSCALL_DEV_FNAME, O_RDONLY); if (fd < 0) { return -1; }