Cannot delete videos from MythTV

Bug #584701 reported by Antonio Lopez on 2010-05-23
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mythbuntu
Wishlist
Thomas Mashos

Bug Description

Whenever I copy a video file using Thunar into MythTV's videos folder, the default permissions eventually won't let me delete that file from MythTV Media -> Videos. The original permissions are:

<desktop_user>:mythtv rw-r--r--

and (IMHO) they should be defaulted to:

<desktop_user>:mythtv rw-rw-r--

Regards

Thomas Mashos (tgm4883) wrote :

Thank you for the bug report. I'm marking this as triaged as it seems to have enough information. I'm not sure we can do it at a directory level, but that seems likely to be a umask issue.

Changed in mythbuntu:
importance: Undecided → Medium
milestone: none → 11.04-alpha1
status: New → Triaged
Antonio Lopez (amlopezalonso) wrote :

It is not *only* an umask issue but also a cp one. I'll explain myself:

If I change the umask either in the local or global profile I can get the proper permissions whenever I *create* a new file or folder but this has no effect whenever I copy/move a file/folder from a removable device into the videos folder (which should be a task common enough to take this issue into account).

Strangely enough, I guess MythTV has no way yet of doing this (common) kind of video importing so it would be nice the Mythbuntu team would develop a plugin/script which could take care of this (well I know this is not a wishlist item ;-) ).

Regards
Antonio

Gibby (gibby) wrote :

I do a alot of copying of video files into myth daily. I simply have a cron job that runs every few minutes to set the correct permissions.

Antonio Lopez (amlopezalonso) wrote :

Yes, I have it too. But IMHO hacking away basics it is not the proper way of going for an issue like this in an (almost) out-of-the-box media center.

Thomas Mashos (tgm4883) wrote :

Marking this as wont fix. I've heard arguments on both sides, but we cannot assume that a user wants to be able to delete files through mythvideo. MythTV simply requests that the operating system delete the file. Permissions set up at this point are key. Perhaps this will be fixed in a future version with the introduction of ACL's but until then I won't be fixing this.

Changed in mythbuntu:
status: Triaged → Won't Fix

El Jueves 05 Mayo 2011, escribió:
> Marking this as wont fix. I've heard arguments on both sides, but we
> cannot assume that a user wants to be able to delete files through
> mythvideo. MythTV simply requests that the operating system delete the
> file.

Not general files, but video files belonging to the mythtv users group and
included in the videos folder.

Having a MythTV-aimed distro it seems a little bit nonsense to me that I
cannot perform a native MythTV operation (as delete video/recording is).
Moreover if we take into account that the same distro lets me delete
recordings using the same operation.

Regards,
Antonio

Thomas Mashos (tgm4883) wrote :

The difference is that recordings are created by mythtv, one would expect it to be able to delete the recordings. Video files are placed there by something else. If the delete option in the menu in mythvideo didn't exist, would you even expect to be able to delete videos?

I see two possible resolutions. One could create a utility to adjust the permissions when moving the file to the proper directory. As others have pointed out though, a cron job works and seems to be of an out of the way solution. I'd accept a way of doing it via cron job, but it's not something that i'd put in by default. The script that runs via cron would need to

A) Be activatable via MCC
B) Check mythvideo storage groups
C) Set permissions to 644

Antonio Lopez (amlopezalonso) wrote :

El Sábado 07 Mayo 2011, escribió:
> The difference is that recordings are created by mythtv, one would
> expect it to be able to delete the recordings. Video files are placed
> there by something else. If the delete option in the menu in mythvideo
> didn't exist, would you even expect to be able to delete videos?

But the thing is that it does exist. And I expect to be allowed to use it
properly without any "obscure" tweaking. After all that is the purpose of a
distro like Mythbuntu: easying the use of a complex system like MythTV.
Mythbuntu is not a nuclear-plant-aimed distro but a PVR one. Of course
security is a must but IMHO it should not get in the user's way.

I would agree with you if the Videos folder were user-created but it is a
default in Mythbuntu, and specifically created by the Mythbuntu team to hold
videos to be watched within MythTV! So I don't think to be far from most of
the other users when I expect the system to behave consistently out-of-the-
box.

>
> I see two possible resolutions. One could create a utility to adjust the
> permissions when moving the file to the proper directory. As others have
> pointed out though, a cron job works and seems to be of an out of the
> way solution. I'd accept a way of doing it via cron job, but it's not
> something that i'd put in by default. The script that runs via cron
> would need to
>
> A) Be activatable via MCC
> B) Check mythvideo storage groups
> C) Set permissions to 644

I set a cron job as a walkaround but for sure it is not the optimal solution.
What about just asking the user (via a MCC option) whether permanently setting
permissions to 664 or not? Of course, warning about potential security issues
(which I don't think shall be too frightening anyway ;-) ).

Regards,
Antonio

On Sat, May 7, 2011 at 3:51 PM, Antonio Lopez <email address hidden> wrote:
> El Sábado 07 Mayo 2011, escribió:
>> The difference is that recordings are created by mythtv, one would
>> expect it to be able to delete the recordings. Video files are placed
>> there by something else. If the delete option in the menu in mythvideo
>> didn't exist, would you even expect to be able to delete videos?
>
> But the thing is that it does exist. And I expect to be allowed to use it
> properly without any "obscure" tweaking. After all that is the purpose of a
> distro like Mythbuntu: easying the use of a complex system like MythTV.
> Mythbuntu is not a nuclear-plant-aimed distro but a PVR one. Of course
> security is a must but IMHO it should not get in the user's way.
>
> I would agree with you if the Videos folder were user-created but it is a
> default in Mythbuntu, and specifically created by the Mythbuntu team to hold
> videos to be watched within MythTV! So I don't think to be far from most of
> the other users when I expect the system to behave consistently out-of-the-
> box.
>

I don't think setting the correct permissions for a file would be
considered "obscure" tweaking. Please explain to me how if you copy a
file with 644 permissions that is owned by the user (not mythtv) why
you would expect to be able to delete it by the mythtv user?

>>
>> I see two possible resolutions. One could create a utility to adjust the
>> permissions when moving the file to the proper directory. As others have
>> pointed out though, a cron job works and seems to be of an out of the
>> way solution. I'd accept a way of doing it via cron job, but it's not
>> something that i'd put in by default. The script that runs via cron
>> would need to
>>
>> A) Be activatable via MCC
>> B) Check mythvideo storage groups
>> C) Set permissions to 644
>
> I set a cron job as a walkaround but for sure it is not the optimal solution.
> What about just asking the user (via a MCC option) whether permanently setting
> permissions to 664 or not? Of course, warning about potential security issues
> (which I don't think shall be too frightening anyway ;-) ).
>
> Regards,
> Antonio
>

Please let me know what I can do to "permanently setting permissions
to 664". It sounds like since you have the cron job as a "workaround"
that you don't know how to do this either. Really though, if you know
how to do this I may be interested in setting this as a default
configuration.

Thomas

Antonio Lopez (amlopezalonso) wrote :

> I don't think setting the correct permissions for a file would be
> considered "obscure" tweaking.

Not setting the correct permissions manually (just a matter of right-clicking)
but being able to make it automagically (e.g. via a cron job, which requires a
little bif of Linux knowledge, specially for a user coming from Gweendows --
not me, btw-- ). I'm supposing (Myth)Ubuntu trends to turn into a rookie-
oriented distro, of course.
>
> Please let me know what I can do to "permanently setting permissions
> to 664". It sounds like since you have the cron job as a "workaround"
> that you don't know how to do this either. Really though, if you know
> how to do this I may be interested in setting this as a default
> configuration.

I admit being a little lazy down here, but I think the story probably should
go like this: After setting up the cron job, I found that setting umask in the
user's .bashrc should default the permissions to 664, but this seemed not to
work properly at a first try. I really did not investigate it further but
nevertheless I can do it for you if you want.

Regards,
Antonio

Antonio Lopez (amlopezalonso) wrote :

Forgot mentioning that umask only works for creating files but not for copying
them from somewhere else (e.g. from a pendrive). So I think setting
permissions from udev should be involved.

Regards,
Antonio

Thomas Mashos (tgm4883) wrote :

I'll mark this as wishlist. It's not going to get any love until I can put something together using inotify. Ideally it would be a backend patch for 0.25 since that will be where the scanner is at that time. As always, patches welcome.

Changed in mythbuntu:
assignee: nobody → Thomas Mashos (tgm4883)
importance: Medium → Wishlist
milestone: 11.04-alpha1 → none
status: Won't Fix → Triaged
Thomas Mashos (tgm4883) wrote :

I had some extra time today and have started working on this. I have a rough python script that should work. Features include
*) Runs 24x7 (not cron)
*) Uses inotify to trigger events
*) Events include setting permissions and group ownership, adding file to DB, and searching for metadata

This will only work with storage groups that are located on the same machine and should run on all backends. It will not work with network mounted file systems (limitation of inotify)

I still need to get this setup as a service. As it loads storage group directories on startup, it should depend on the mythtv-backend service running (for other reasons as well)

Changed in mythbuntu:
status: Triaged → In Progress
Thomas Mashos (tgm4883) wrote :

It's worth noting that I've borrowed some code from wagnerrp (upstream) and was a big help in getting the bugs worked out so it actually added the file and gathered metadata into the database

Thomas Mashos (tgm4883) on 2015-01-12
tags: added: downstream
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments