[LibOS] Remove abspath check from *at() syscalls

This patch is a follow-up of
https://github.com/oscarlab/graphene/pull/671. With #671, absolute path
check is handled uniformly by __path_lookupat(). Now absolute path check
in each system call isn't needed, so we can remove it.
This commit is contained in:
Isaku Yamahata
2019-08-01 20:14:13 +02:00
committed by Michał Kowalczyk
parent bdb58741ec
commit 63f27e42d7
3 changed files with 3 additions and 19 deletions
-3
View File
@@ -58,9 +58,6 @@ int shim_do_faccessat (int dfd, const char * filename, mode_t mode)
if (test_user_string(filename))
return -EFAULT;
if (*filename == '/')
return shim_do_access(filename, mode);
struct shim_dentry * dir = NULL, * dent = NULL;
int ret = 0;
+3 -13
View File
@@ -84,10 +84,6 @@ int shim_do_unlinkat (int dfd, const char * pathname, int flag)
if (flag & ~AT_REMOVEDIR)
return -EINVAL;
if (*pathname == '/')
return (flag & AT_REMOVEDIR) ? shim_do_rmdir(pathname) :
shim_do_unlink(pathname);
struct shim_dentry * dir = NULL, * dent = NULL;
int ret = 0;
@@ -142,9 +138,6 @@ int shim_do_mkdirat (int dfd, const char * pathname, int mode)
if (test_user_string(pathname))
return -EFAULT;
if (*pathname == '/')
return shim_do_mkdir(pathname, mode);
struct shim_dentry * dir = NULL;
int ret = 0;
@@ -239,9 +232,6 @@ int shim_do_fchmodat (int dfd, const char * filename, mode_t mode)
if (test_user_string(filename))
return -EFAULT;
if (*filename == '/')
return shim_do_chmod(filename, mode);
struct shim_dentry * dir = NULL, * dent = NULL;
int ret = 0;
@@ -313,15 +303,15 @@ int shim_do_fchownat (int dfd, const char * filename, uid_t uid, gid_t gid,
int flags)
{
__UNUSED(flags);
__UNUSED(uid);
__UNUSED(gid);
if (!filename)
return -EINVAL;
if (test_user_string(filename))
return -EFAULT;
if (*filename == '/')
return shim_do_chown(filename, uid, gid);
struct shim_dentry * dir = NULL, * dent = NULL;
int ret = 0;
-3
View File
@@ -134,9 +134,6 @@ int shim_do_openat (int dfd, const char * filename, int flags, int mode)
if (!filename || test_user_string(filename))
return -EFAULT;
if (*filename == '/')
return shim_do_open(filename, flags, mode);
struct shim_dentry * dir = NULL;
int ret = 0;