6 ms·
The problem in this case was that we depend on convention (filenames and extensions) for security. Operating system should already know if a file is executable
by ajuc 5y ago
The problem in this case was that we depend on convention (filenames and extensions) for security.
Operating system should already know if a file is executable and desktop should be using this information when presenting files instead of conventional names.
Yes it would mean that when you download a file you have to set the executable attribute before you can run it. It's already almost exactly like that on Linux. That's a good thing.
- thaumasiotes 5y ago> Operating system should already know if a file is executable and desktop should be using this information when presenting files instead of conventional names. That already happens. If you set the "Details" view in Windows, it will display one file per row with various columns showing file metadata, including the file type. So for the example in the post, you'd see "[Word icon] annexe.doc - [the date] - Application" as opposed to "[Word icon] annexe.doc - [the date] - Microsoft Word 97 - 2003 Document".
- ajuc 5y agoI meant more like huge red and green exclamation mark near the file icon, not "type: Application" hidden in rarely shown places. In linux it's pretty obvious: https://www.rootusers.com/wp-content/uploads/2018/01/gnome-terminal.png https://www.rootusers.com/wp-content/uploads/2018/01/gnome-t... The main advantage is that the UI for opening documents (vim file) is different from the UI for running executables (./file) which is different from the UI for running executables as administrator (sudo ./file). This makes it impossible to accidentally execute a file that looks like a document.
- trasz 5y agoOn Linux you have another problem though: you can have several files with the exact same name, just encoded differently.
- jcelerier 5y agoAs a desktop user, it makes me physically ill everytime I have to do that. I'd honestly pay for someone to make auto-executing the default on most common Linux distros. Like, in 20+ years of using computers, I don't remember one time where I downloaded something and did not want to run it afterwards.
- devit 5y agoHere's a gift for you: inotifywait -m -e create "$(xdg-user-dir DOWNLOAD)"|while read d e f; do chmod +x "$d/$f"; done You can add "-r" if you want to also do it on subdirectories, and you can specify another directory instead of the default downloads directory. Though I don't really recommend doing this since you should not be executing downloaded binaries often enough for this to be worth doing.
- jcelerier 5y ago> Though I don't really recommend doing this since you should not be executing downloaded binaries often enough for this to be worth doing. I literally do this multiple times per day. What in hell do you folk do with your computers? Thanks for the script ! There's a few tens of thousands of files in my downloads folder, I hope this isn't going to pollute the inotify fds too much...
- marcosdumay 5y agoI can't remember the last time I had to do it. Not on the last 4 years for sure. Executables tend to come compressed with a lot of other files nowadays, and compression software knows to set the executable bit when extracting them.
- assbuttbuttass 5y agoI usually install programs through the distro package manager. Out of curiosity, what are you doing that requires downloading so many executables from the web?
- 5y ago