git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
syscalls: chroot, fchmodat, fchownat, faccessat
[lunaix-os.git]
/
lunaix-os
/
kernel
/
exe
/
exec.c
diff --git
a/lunaix-os/kernel/exe/exec.c
b/lunaix-os/kernel/exe/exec.c
index cc7ae82b62cb094752ceacae305c08f43c68f80e..5ac00b3dbb99577bdd7f5a13281b073bdf13bd85 100644
(file)
--- a/
lunaix-os/kernel/exe/exec.c
+++ b/
lunaix-os/kernel/exe/exec.c
@@
-202,6
+202,7
@@
exec_load(struct exec_host* container, struct v_file* executable)
}
save_process_cmd(proc, argv);
}
save_process_cmd(proc, argv);
+ container->inode = executable->inode;
errno = load_executable(&container->exe, executable);
if (errno) {
errno = load_executable(&container->exe, executable);
if (errno) {
@@
-285,6
+286,7
@@
__DEFINE_LXSYSCALL3(int,
envp[])
{
int errno = 0;
envp[])
{
int errno = 0;
+ int acl;
struct exec_host container;
if (!argv || !envp) {
struct exec_host container;
if (!argv || !envp) {
@@
-308,6
+310,15
@@
__DEFINE_LXSYSCALL3(int,
signal_reset_context(¤t_thread->sigctx);
signal_reset_registry(__current->sigreg);
signal_reset_context(¤t_thread->sigctx);
signal_reset_registry(__current->sigreg);
+ acl = container.inode->acl;
+ if (fsacl_test(acl, suid)) {
+ current_set_euid(container.inode->uid);
+ }
+
+ if (fsacl_test(acl, sgid)) {
+ current_set_egid(container.inode->gid);
+ }
+
done:
// set return value
store_retval(DO_STATUS(errno));
done:
// set return value
store_retval(DO_STATUS(errno));