cockpit-project / cockpit-files

A Featureful File Browser for Cockpit (Modernized and tested version of https://github.com/45Drives/cockpit-navigator)
GNU Lesser General Public License v2.1
25 stars 23 forks source link

Disallow renaming / editing permissions of everything non directory/symlink/regular file #611

Open jelly opened 1 week ago

jelly commented 1 week ago

It's unwanted behavior that we allow for example renaming of /dev/vda or a character device same goes for deletion, copying and changing permissions. (Although permissions can be debated)

So I would argue for something like:

    } else if (selected.length === 1 && ["dir", "reg", "lnk"].indexOf(selected[0].type || "reg") !== -1) {

That will basically make the right click menu empty and the sidebar's kebabdropdown menu empty so the kebabdropdown should be disabled.

@garrett @allisonkarlitskaya what do you think? This feels like a no-brainer to me.

allisonkarlitskaya commented 1 week ago

I don't see anything wrong with renaming device files or other "specials". I particularly think that changing the mode of devices files might be very useful. Since you mention it, though: it's not possible to change the permissions of a symlink.