Bug #1894
files written with execute permission
0%
Description
The recorded files are written with the execute permission bit set. Therefore if I select them, the file manager asks me if I want to execute the video, instead of passing it to the player.
Files should be opened/created with mode 0666 unless they are supposed to be executable.
http://en.wikipedia.org/wiki/Umask
Workaround: Set umask to e.g. 0113 or 0133 in your start script
Files
History
Updated by Adam Sutton almost 11 years ago
- Category set to PVR / DVR
- Status changed from New to Accepted
This is a long standing bug that has always been near the bottom of my priority list. If you have any C experience its probably 5mins to fix, if you fancy taking a look?
Adam
Updated by Bodo Eggert almost 11 years ago
- File mode-666.patch mode-666.patch added
Patch done.
All files will be opened 0666 - umask, directories will be created 0700 (no change)
Updated by Adam Sutton almost 11 years ago
Bodo thats' great, but can I ask you to submit via github PR please, that's the standard approach for submitting patches to TVH. I know its pedantic for a small change, but if you do more stuff (here's hoping) in the future, it's good to be in the habit.
Adam
P.S.
The other issue with the current (and your) permissions is it should really not be world writable, so I'd suggest 0664.
P.P.S.
And yes I understand the irony of typing 100's of words just to get you to change a few chars but there is a method to my madness, even if it doesn't always bare fruit.
Updated by Bodo Eggert almost 11 years ago
No problem. I just need a github for dummies ...
... seems like I pushed it. Now it's end-of-the-year. Happy new year everybody.
It's 0666 and not 0664, because you're supposed to set umask to block the writable bit - unless you want it to be writable; in that case, you're supposed to know what you're doing. fopen() does the same for exactly this reason. Setting 0111 is different, this would affect access to directories.
The config files are still in unaccessible directories, so there should be no problem even if umask is set to 0. Nobody will get access to these files.
Updated by Adam Sutton almost 11 years ago
I don't see a pull request? What is your github user?
And it should be 0664. Tvheadend (like most daemons) sets a umask of 0. This ensures that the relevant parts of the daemon have full control over the permissions and therefore should set them based on what is mostly likely to be appropriate for the file/dir.
Adam