core/host/mkdir perms applied too liberally
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
New
|
Medium
|
Unassigned |
Bug Description
In the case of creating leading paths (os.makedirs) with restrictive permissions and setting a user, I think the behavior of host.mkdirs() is confusing. You will easily run into a situation where you lock the target user out of the created directory.
EX:
host.
this will create
/tmp/leading as 0700 owner root/root
and
/tmp/
Which will yield an unreadable dir for daemon/daemon. Instead, I think what would be expected is for just the leaf dir to get the altered permissions, and altered user/group. Typically when calling mkdir -p you are concerned about creating the leaf dir and a "don't care" about the leading paths. It would be nice if thi behavior was reflected (and documented) in the function.
tags: | added: landscape |
Changed in charm-helpers: | |
importance: | Undecided → Medium |