Project

General

Profile

Bug #1894

files written with execute permission

Added by Bodo Eggert almost 11 years ago. Updated over 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
PVR / DVR
Target version:
-
Start date:
2013-12-27
Due date:
% Done:

0%

Estimated time:
Found in version:
3.9.252
Affected Versions:

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

mode-666.patch (1.74 KB) mode-666.patch Bodo Eggert, 2013-12-31 16:22

History

#1

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

#2

Updated by Bodo Eggert almost 11 years ago

Patch done.
All files will be opened 0666 - umask, directories will be created 0700 (no change)

#3

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.

#4

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.

#5

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

#6

Updated by Andy Brown about 10 years ago

  • Status changed from Accepted to Resolved

Added to Master

#7

Updated by Flole Systems over 4 years ago

  • Status changed from Resolved to Fixed

Also available in: Atom PDF