-
Notifications
You must be signed in to change notification settings - Fork 32
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
Current implementation of recursive chmod considered harmful #192
Comments
I agree. |
If we dumb down the dialog a bit and make it about read/write permissions only, and use +X in the same places we allow read permissions, it might make even more sense than having the full-blown GNOME approach (which breaks existing executable files). |
Agreed. I also added that to the MVP milestone. |
This isn't anything that helps the user in its current state — applying a numeric mode to all of the files in a subdirectory is either going to end up breaking all of the files or all of the directories. Let's bring this back later in a better form. See cockpit-project#192
This isn't anything that helps the user in its current state — applying a numeric mode to all of the files in a subdirectory is either going to end up breaking all of the files or all of the directories. Let's bring this back later in a better form. See cockpit-project#192
This isn't anything that helps the user in its current state — applying a numeric mode to all of the files in a subdirectory is either going to end up breaking all of the files or all of the directories. Let's bring this back later in a better form. See cockpit-project#192
This isn't anything that helps the user in its current state — applying a numeric mode to all of the files in a subdirectory is either going to end up breaking all of the files or all of the directories. Let's bring this back later in a better form. See #192
So here's a very concrete proposal for what I think should happen: Files and directories should be treated exactly the same, always. To state it explicitly: we should forget about the idea of having "list" ( In any UI to deal with this, we'll have three categories: user, group, other. Each of those will have a dropdown containing the options "Read and write", "Read-only", "No access":
with each of the dropdowns looking like:
From this dialog, we construct a string via concatenation, using the following approach:
So given the example above, the resulting string would be The only thing that's missing here is support for setting the executable bit on a script. I think that this option does not make sense to be applied recursively, but might make sense on a single file or multiple-selection containing only files (not directories). We might add a separate checkbox for it in this case, in which case we'd see something like (for the single file case):
This box would be checked if any executable bit is set on the file when the dialog is open. In the case that this explicit UI element is visible we could modify our mode string construction behaviour:
This leaves only the case about what we do when we select multiple files (not directories) and modify their attributes all at once and the selected set has inconsistent executable bits set on it from the beginning. We could either refuse to handle this case (not show the check) or handle it by showing a checkbox in an inconsistent state (does Patternfly have that?). If the user leaves the check in the inconsistent state then we proceed as per the case where the option wasn't shown. |
https://www.patternfly.org/components/forms/checkbox/
|
No, use a Switch https://www.patternfly.org/components/switch/#checked-with-label :) |
@jelly says that this functionality doesn't exist, so it doesn't need to block the first release. |
This is similar to the mockups I already made in PF style and shared a while back. Here's the latest version: BTW: It's a checkbox instead of a switch as switches are instant-apply and checkboxes are queued. See https://www.patternfly.org/components/switch/design-guidelines#when-to-use-switches-versus-checkboxes for details. (Edit: Previous version, nearly the same, is at #471 (comment) — this one adds the checkbox for files and makes the title of the file and dir more obvious. It does not, notably, add SELinux contexts, but @jelly and I talked and agreed that it would be good to do the same thing as GNOME and add it in as a read-only blob of text.) |
FWIW, that screenshot at the top of the page is the ages old GNOME settings. For an updated reference, here's what it looks like today: And then you click permissions and get this: (However, I think there's a bug, as this is a file and it still has a button that says " Change permissions for enclosed files...".) |
@garrett I have one question about the implementation of the In GNOME Files this is implemented there is some logic to only show this when it is logical to make a file excutable by looking at the mimetype:
Furthermore GNOME only sees something as "executable" when all bits are set executable so owner, group and other. Do we replicate this behavior? FYI: this makes sense, as this happens for normal system binaries.
This also agrees with what @allisonkarlitskaya said before I think:
|
@jelly: Sure, that all sounds reasonable. Show it when the filetype can be executable (we should use the same logic), then use +X. (I thought we talked about this in a call a few months ago and agreed on it, but it's good to have it clearly agreed upon and written down here regardless. Thanks for asking and formalizing it!) I'm guessing binary files and shell scripts can be executable, as well as things like AppImages (which are mainly outside the scope of Cockpit, except if an admin is browsing a home dir, I suppose). I suppose it uses magic sniffing for mimetypes with an accept list. |
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Furthermore setting a file as executable is now only possible for files where this makes sense based on it's file extension (ie. code or unknown files without an extension). Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Furthermore setting a file as executable is now only possible for files where this makes sense based on it's file extension (ie. code or unknown files without an extension). Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Furthermore setting a file as executable is now only possible for files where this makes sense based on it's file extension (ie. code or unknown files without an extension). Related: cockpit-project#192
The permissions dialog file/folder permissions was re-designed to make it be able to support "changing permissions for enclosed files". The available access permissions are simplified to `Read and write`, `Read-only` and `No access` the executable bits are handled by a checkbox for files and implicitly added for folders. Furthermore setting a file as executable is now only possible for files where this makes sense based on it's file extension (ie. code or unknown files without an extension). Related: #192
We currently have a button for "Change Permissions for Enclosed Files" which calls
chmod -R
with a numeric mode. That's a problem because you usually don't want files and directories to have the same mode. Either all your files end up executable or all of your directories end up broken.In GNOME this button is labelled "Change Permissions for Enclosed Files..." and opens a second dialog:
If we're going to have recursive mode changing at all, we need something like this. Until that point, I'd argue that we should remove the existing button.
The text was updated successfully, but these errors were encountered: