quattor / ncm-ncd

Node Configuration Dispatcher Framework for Components
www.quattor.org
Other
3 stars 8 forks source link

rework chdir handling use mktemp instead of '/tmp' #121

Closed ttyS4 closed 6 years ago

ttyS4 commented 6 years ago

There are multiple changes here. It displays my current understanding of how these modules do chdir.

The current behavior is:

  1. NCD::CLI enters /tmp
  2. NCD::ComponentProxy enters /tmp
  3. a component is executed
  4. NCD::ComponentProxy restores to /tmp (which NCD::CLI set up)
  5. then back to step 2.

New proposed behavior after this change:

Instead of /tmp a /tmp/ncd-components-XXXXXXXX (x's replaced with random alphanumerics) is used. (This is good because /tmp is a hostile environment being a world-writable directory.) Step 1. removed. Step 4. kept because we need to leave the tempdir to let the module to automatically clean it up.

If a module changes the current directory during its execution Step 2. still changes back to the previous.

  1. NCD::ComponentProxy enters /tmp/ncd-components-XXXXXXXX.
  2. a component is executed
  3. NCD::ComponentProxy restores to whatever the ncm-ncd was invoked from
  4. then back to step 1.
jrha commented 6 years ago

@stdweird what state is this in?

stdweird commented 6 years ago

@jrha it's not ready

ttyS4 commented 6 years ago

I am going to get back with my updates by the end of the week.

jrha commented 6 years ago

@ttyS4 Ok thanks, I'd like to finalise the release soon.

ttyS4 commented 6 years ago

I am experimenting with this: https://github.com/ttyS4/ncm-ncd/commit/d67cbb6d4eeca9e8c19dea454434320e188a5c82 however I got stuck and need some help.

I do not know how can I get the chroot setting and would need some guidance.

jrha commented 6 years ago

@ned21 I want to finalise the release this week, would you guys mind if we bumped this to 18.3?

ttyS4 commented 6 years ago

@jrha #123 should replace this and is is ready to merge in.

jrha commented 6 years ago

Closing as replaced by #123.