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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Chas Williams 2015-12-02 10:38:42 -05:00 committed by Benjamin Kaduk
parent a86b0b4902
commit 359e1f2a25

View File

@ -24,9 +24,9 @@
int proc_afs_syscall(long syscall, long param1, long param2, long param3, int proc_afs_syscall(long syscall, long param1, long param2, long param3,
long param4, int *rval) { long param4, int *rval) {
struct afsprocdata syscall_data; struct afsprocdata syscall_data;
int fd = open(PROC_SYSCALL_FNAME, O_RDWR); int fd = open(PROC_SYSCALL_FNAME, O_RDONLY);
if(fd < 0) if(fd < 0)
fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDWR); fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDONLY);
if(fd < 0) if(fd < 0)
return -1; return -1;
@ -50,7 +50,7 @@ int ioctl_afs_syscall(long syscall, long param1, long param2, long param3,
struct afssysargs syscall_data; struct afssysargs syscall_data;
void *ioctldata; void *ioctldata;
int code; int code;
int fd = open(SYSCALL_DEV_FNAME, O_RDWR); int fd = open(SYSCALL_DEV_FNAME, O_RDONLY);
int syscallnum; int syscallnum;
#ifdef AFS_DARWIN100_ENV #ifdef AFS_DARWIN100_ENV
struct afssysargs64 syscall64_data; struct afssysargs64 syscall64_data;
@ -132,7 +132,7 @@ ioctl_sun_afs_syscall(long syscall, uintptr_t param1, uintptr_t param2,
callnum = VIOC_SYSCALL; callnum = VIOC_SYSCALL;
# endif /* !_ILP32 */ # endif /* !_ILP32 */
fd = open(SYSCALL_DEV_FNAME, O_RDWR); fd = open(SYSCALL_DEV_FNAME, O_RDONLY);
if (fd < 0) { if (fd < 0) {
return -1; return -1;
} }