From 863b6fef8047b70ce1a025afc7abff2cde90881a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Wed, 28 Jan 2015 16:34:39 +0100 Subject: [PATCH] noux: prevent override in SYSCALL_STAT Fixes #1386. --- repos/ports/src/noux/main.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/repos/ports/src/noux/main.cc b/repos/ports/src/noux/main.cc index 06f5108a9..a3ca6760c 100644 --- a/repos/ports/src/noux/main.cc +++ b/repos/ports/src/noux/main.cc @@ -230,8 +230,8 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) size_t path_len = strlen(_sysio->stat_in.path); uint32_t path_hash = hash_path(_sysio->stat_in.path, path_len); - _sysio->error.stat = root_dir()->stat(_sysio->stat_in.path, - _sysio->stat_out.st); + Vfs::Directory_service::Stat stat_out; + _sysio->error.stat = root_dir()->stat(_sysio->stat_in.path, stat_out); result = (_sysio->error.stat == Vfs::Directory_service::STAT_OK); @@ -240,12 +240,14 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) * we use the ones specificed in the config. */ if (result) { - _sysio->stat_out.st.uid = user_info()->uid; - _sysio->stat_out.st.gid = user_info()->gid; + stat_out.uid = user_info()->uid; + stat_out.gid = user_info()->gid; - _sysio->stat_out.st.inode = path_hash; + stat_out.inode = path_hash; } + _sysio->stat_out.st = stat_out; + break; }