-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance mkdwarfs
to support file permission normalization
#7
Comments
The |
Actually, these sorts of things will be possible in the next release using the new class mkdwarfs:
def transform(self, entry):
logger.debug(f"transforming {entry.path()}")
entry.set_permissions(entry.permissions() & 0o7555)
return entry |
I understand that using an interpreted language opens many possibilities. However I believe that a few common cases should be easily achieved through arguments. Therefore given how important file permissions are (just like user / group IDs) I think there should be a few options dedicated to them. For example I would look at how
|
Oh, I'm not disagreeing. |
Okay, after thinking about this some more, I'll implement both |
I'll probably drop |
I've added |
This is in dwarfs-0.7.0-RC2 now. |
Just like
--no-owner
and--no-time
are useful to build "generic" images, it would also be useful to have an option that normalizes the file-system permissions. (At the moment they are take verbatim.)Perhaps the easiest solution is the following:
--perms-norm
that basically only cares if any executability bit is set (be it user, group or others), and thus creates entries liker-x r-x r-x
orr-- r-- r--
;--perms-umask
that takes a octal value and basically caps the permissions; for example--perms-umask 007
would only generater-x r-x ---
orr-- r-- ---
;The text was updated successfully, but these errors were encountered: