#7056 closed bug (fixed)
umask is not inherited to exec'ed image
Reported by: | zooey | Owned by: | zooey |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/libroot.so | Version: | R1/Development |
Keywords: | exec umask | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
The umask of the calling process is not inherited to any image loaded via any of the exec...() functions. According to the POSIX base specs version 7, it should be. This causes problems for the git test suite and (I suppose) for the mercurial test suite, too.
Attachments (1)
Change History (5)
by , 14 years ago
Attachment: | exec_umask.c added |
---|
comment:1 by , 14 years ago
Implementation hint:
- Add a parameter for the umask to
_kern_exec()
and pass the current umask where invoked. - In team.cpp pass the umask on (
_user_exec()
->team_exec()
) and add it to theteam_arg
structure (defined in same file). - In user_runtime.h add a umask field to the
user_space_program_args
structure and set it in team_create_thread_start() (from theteam_arg
field). - In libroot's initialize_before() set the umask from the newly introduced
__gRuntimeLoader->program_args
member.
comment:2 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → in-progress |
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | in-progress → closed |
Fixed in hrev40071 - basically followed Ingo's implementation hint (thanks!), additionally chose to not inherit the umask for images loaded by other means (load_image...).
comment:4 by , 14 years ago
Which I definitely agree with. An alternative would have been to maintain the umask kernel side, and have a syscall to retrieve it - but this way, a syscall is saved whenever it's used in userland, so it's probably the better solution. Thanks!
a tiny test exposing the problem - just set the umask to some specific value and, invoking the test, you'll see that it will have been reverted to '022'.