[haiku-bugs] Re: [Haiku] #7056: umask is not inherited to exec'ed image

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sun, 02 Jan 2011 17:37:25 -0000

#7056: umask is not inherited to exec'ed image
--------------------------------+------------------------------
  Reporter:  zooey              |        Owner:  axeld
      Type:  bug                |       Status:  new
  Priority:  normal             |    Milestone:  R1
 Component:  System/libroot.so  |      Version:  R1/Development
Resolution:                     |     Keywords:  exec umask
Blocked By:                     |  Has a Patch:  0
  Platform:  All                |     Blocking:
--------------------------------+------------------------------

Comment (by bonefish):

 Implementation hint:
  - Add a parameter for the umask to `_kern_exec()` and pass the current
 umask [https://dev.haiku-
 
os.org/browser/haiku/trunk/src/system/libroot/posix/unistd/exec.cpp?rev=33670#L106
 where invoked].
  - In [https://dev.haiku-
 os.org/browser/haiku/trunk/src/system/kernel/team.cpp team.cpp] pass the
 umask on (`_user_exec()` -> `team_exec()`) and add it to the `team_arg`
 structure (defined in same file).
  - In [https://dev.haiku-
 os.org/browser/haiku/trunk/headers/private/system/user_runtime.h?rev=33670#L22
 user_runtime.h] add a umask field to the `user_space_program_args`
 structure and set it in [https://dev.haiku-
 os.org/browser/haiku/trunk/src/system/kernel/team.cpp?rev=39864#L1084
 team_create_thread_start()] (from the `team_arg` field).
  - In libroot's [https://dev.haiku-
 os.org/browser/haiku/trunk/src/system/libroot/libroot_init.c?rev=36323#L38
 initialize_before()] set the umask from the newly introduced
 `__gRuntimeLoader->program_args` member.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7056#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: