Noux: override uid/gid in SYSCALL_STAT

Change the uid/gid entries in the stat syscall to have the same values
on all filesystems that are used in the current noux-instance according
to the specified values in noux' config.

Fixes #338.
This commit is contained in:
Josef Söntgen 2012-08-25 19:57:02 +02:00 committed by Norman Feske
parent 9cff243f42
commit 1b9c356aa3

View File

@ -177,9 +177,21 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc)
case SYSCALL_STAT:
case SYSCALL_LSTAT: /* XXX implement difference between 'lstat' and 'stat' */
{
bool result = _root_dir->stat(_sysio, Absolute_path(_sysio->stat_in.path,
_env.pwd()).base());
return _root_dir->stat(_sysio, Absolute_path(_sysio->stat_in.path,
_env.pwd()).base());
/**
* Instead of using the uid/gid given by the actual file system
* 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;
}
return result;
}
case SYSCALL_FSTAT: