From: Lionel Sambuc Date: Mon, 12 May 2014 10:53:20 +0000 (+0200) Subject: Message type for VFS_CHECKPERMS X-Git-Tag: v3.3.0~318 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/readme1st.txt?a=commitdiff_plain;h=8830643ac3b76b0ae447558bb378b2b080daf755;p=minix.git Message type for VFS_CHECKPERMS Change-Id: Ie97bb7362d108ebba268c719a6614fc2fe1392cf --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 2204baba6..a27dd589c 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,11 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the checkperms(2) call. */ -#define VFS_CHECKPERMS_ENDPT m2_i1 /* endpoint_t */ -#define VFS_CHECKPERMS_GRANT m2_i2 /* cp_grant_id_t */ -#define VFS_CHECKPERMS_COUNT m2_i3 /* size_t */ - /* Field names for the copyfd(2) call. */ #define VFS_COPYFD_ENDPT m1_i1 /* endpoint_t */ #define VFS_COPYFD_FD m1_i2 /* int */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 1cdded91f..a515a4996 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -211,6 +211,15 @@ typedef struct { } mess_lc_vfs_umount; _ASSERT_MSG_SIZE(mess_lc_vfs_umount); +typedef struct { + endpoint_t endpt; + cp_grant_id_t grant; + size_t count; + + uint8_t padding[44]; +} mess_lsys_vfs_checkperms; +_ASSERT_MSG_SIZE(mess_lsys_vfs_checkperms); + typedef struct { dev_t device; off_t seek_pos; @@ -669,6 +678,8 @@ typedef struct { mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; mess_lc_vfs_umount m_lc_vfs_umount; + mess_lsys_vfs_checkperms m_lsys_vfs_checkperms; + mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; mess_vfs_fs_chmod m_vfs_fs_chmod; mess_vfs_fs_chown m_vfs_fs_chown; diff --git a/lib/libsys/checkperms.c b/lib/libsys/checkperms.c index cf0a4cb27..0998e64d8 100644 --- a/lib/libsys/checkperms.c +++ b/lib/libsys/checkperms.c @@ -16,9 +16,9 @@ checkperms(endpoint_t endpt, char *path, size_t size) return ENOMEM; memset(&m, 0, sizeof(m)); - m.VFS_CHECKPERMS_ENDPT = endpt; - m.VFS_CHECKPERMS_GRANT = grant; - m.VFS_CHECKPERMS_COUNT = size; + m.m_lsys_vfs_checkperms.endpt = endpt; + m.m_lsys_vfs_checkperms.grant = grant; + m.m_lsys_vfs_checkperms.count = size; r = _taskcall(VFS_PROC_NR, VFS_CHECKPERMS, &m); diff --git a/servers/vfs/path.c b/servers/vfs/path.c index a105a27bc..ae8e93abb 100644 --- a/servers/vfs/path.c +++ b/servers/vfs/path.c @@ -872,6 +872,7 @@ int do_checkperms(void) /* This should be replaced by an ACL check. */ if (!super_user) return EPERM; - return check_perms(job_m_in.VFS_CHECKPERMS_ENDPT, - job_m_in.VFS_CHECKPERMS_GRANT, (size_t) job_m_in.VFS_CHECKPERMS_COUNT); + return check_perms(job_m_in.m_lsys_vfs_checkperms.endpt, + job_m_in.m_lsys_vfs_checkperms.grant, + job_m_in.m_lsys_vfs_checkperms.count); }