From: Chas Williams <3chas3@gmail.com> Date: Wed, 2 Dec 2015 15:38:42 +0000 (-0500) Subject: Open syscall emulation file O_RDONLY X-Git-Tag: upstream/1.6.17^2~19 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7029ed89b65e8bc903f09773f3be6fb995d18b8f;p=packages%2Fo%2Fopenafs.git 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. Reviewed-on: http://gerrit.openafs.org/12122 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Benjamin Kaduk (cherry picked from commit 359e1f2a25d242984229edfb378c0b95c3ee8570) Change-Id: I5ec9262a30c1aa40604e1265b4da00f4597c1cc8 Reviewed-on: http://gerrit.openafs.org/12124 Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- diff --git a/src/sys/glue.c b/src/sys/glue.c index dfcc84a6e..5ccda5683 100644 --- a/src/sys/glue.c +++ b/src/sys/glue.c @@ -29,9 +29,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; @@ -55,7 +55,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; @@ -137,7 +137,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; }