Only force default umask during transaction (RhBug:494440)
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 18 Nov 2010 10:50:55 +0000 (12:50 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 18 Nov 2010 10:50:55 +0000 (12:50 +0200)
commitb270b38a70518ecb3f9d5a6ccb691fd619f53196
treee382c5e53f2a5e6d67cf9f33dd5890e66cc80dd8
parent4287e2e6dff59ee9850b974722db3f124d42b384
Only force default umask during transaction (RhBug:494440)
- For rpm itself forging global umask on init is kinda convenient, but can
  be troublesome for API users. This is especially bad in python bindings
  where just importing the rpm module silently changes process umask with
  no good reason.
- Instead of global setting on init, only change the umask to 022 default
  for the duration of rpmtsRun() where it's necessary for consistent
  transaction results on implicitly created directories and files created
  by scriptlets. This way we dont affect callers and provide better
  "protection" for ourselves too - we don't know if API users change
  umask again behind our back if we just set it on initialization.
- To make matters more fun, Lua scripts can change our umask. Save
  and restore umask when running Lua scriptlets.
lib/rpmrc.c
lib/rpmscript.c
lib/transaction.c