本文整理汇总了C++中set_fs_root函数的典型用法代码示例。如果您正苦于以下问题:C++ set_fs_root函数的具体用法?C++ set_fs_root怎么用?C++ set_fs_root使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_fs_root函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SYSCALL_DEFINE1
SYSCALL_DEFINE1(chroot, const char __user *, filename)
{
struct path path;
int error;
error = user_path_dir(filename, &path);
if (error)
goto out;
error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR);
if (error)
goto dput_and_out;
error = -EPERM;
if (!capable(CAP_SYS_CHROOT))
goto dput_and_out;
error = security_path_chroot(&path);
if (error)
goto dput_and_out;
set_fs_root(current->fs, &path);
error = 0;
dput_and_out:
path_put(&path);
out:
return error;
}
开发者ID:boa19861105,项目名称:Blackout-Monarudo,代码行数:27,代码来源:open.c
示例2: SYSCALL_DEFINE1
SYSCALL_DEFINE1(chroot, const char __user *, filename)
{
struct path path;
int error;
error = user_path_dir(filename, &path);
if (error)
goto out;
error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS);
if (error)
goto dput_and_out;
error = -EPERM;
if (!capable(CAP_SYS_CHROOT))
goto dput_and_out;
if (gr_handle_chroot_chroot(path.dentry, path.mnt))
goto dput_and_out;
if (gr_handle_chroot_caps(&path)) {
error = -ENOMEM;
goto dput_and_out;
}
set_fs_root(current->fs, &path);
gr_handle_chroot_chdir(&path);
error = 0;
dput_and_out:
path_put(&path);
out:
return error;
}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:35,代码来源:open.c
示例3: sys_chroot
asmlinkage long sys_chroot(const char * filename)
{
int error;
struct nameidata nd;
char *name;
name = getname(filename);
error = PTR_ERR(name);
if (IS_ERR(name))
goto out;
path_init(name, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
error = path_walk(name, &nd);
putname(name);
if (error)
goto out;
error = permission(nd.dentry->d_inode,MAY_EXEC);
if (error)
goto dput_and_out;
error = -EPERM;
if (!capable(CAP_SYS_CHROOT))
goto dput_and_out;
set_fs_root(current->fs, nd.mnt, nd.dentry);
set_fs_altroot();
error = 0;
dput_and_out:
path_release(&nd);
out:
return error;
}
开发者ID:EmbolismSoil,项目名称:Linux-2.4.0-,代码行数:34,代码来源:open.c
示例4: SYSCALL_DEFINE1
SYSCALL_DEFINE1(chroot, const char __user *, filename)
{
struct path path;
int error;
unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY;
retry:
error = user_path_at(AT_FDCWD, filename, lookup_flags, &path);
if (error)
goto out;
error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR);
if (error)
goto dput_and_out;
error = -EPERM;
if (!nsown_capable(CAP_SYS_CHROOT))
goto dput_and_out;
error = security_path_chroot(&path);
if (error)
goto dput_and_out;
set_fs_root(current->fs, &path);
error = 0;
dput_and_out:
path_put(&path);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
out:
return error;
}
开发者ID:wpwrak,项目名称:ben-wpan-linux,代码行数:32,代码来源:open.c
示例5: sys_chroot
asmlinkage long sys_chroot(const char __user * filename)
{
struct path path;
int error;
error = user_path_dir(filename, &path);
if (error)
goto out;
error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS);
if (error)
goto dput_and_out;
error = -EPERM;
if (!capable(CAP_SYS_CHROOT))
goto dput_and_out;
set_fs_root(current->fs, &path);
error = 0;
dput_and_out:
path_put(&path);
out:
return error;
}
开发者ID:mpalmer,项目名称:linux-2.6,代码行数:24,代码来源:open.c
注:本文中的set_fs_root函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论