Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 30724 - mplayer documentation has incorrect permissions
Summary: mplayer documentation has incorrect permissions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-08 21:17 UTC by Jason Andryuk
Modified: 2003-10-18 10:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to correct permissions of Documentation (mplayer-0.92.ebuild.diff,885 bytes, patch)
2003-10-13 09:45 UTC, Jason Andryuk
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Andryuk 2003-10-08 21:17:57 UTC
deuce@grendel deuce $ ls -l /usr/doc/mplayer-0.92/
total 39
-rw-r--r--    1 root     root         7412 Sep 28 20:27 AUTHORS.gz
-rw-r--r--    1 root     root        22642 Sep 28 20:27 ChangeLog.gz
drwx------    9 root     root          688 Sep 28 20:27 DOCS
-rw-r--r--    1 root     root         3666 Sep 28 20:27 README.gz
drwx------   11 root     root         1384 Sep 28 20:27 TOOLS

The permission on the DOCS and TOOLS directories make them inaccessible by
regular users.

I tried the below fix, but it does not work.  The permissions remain the same.

--- mplayer-0.92.ebuild.orig    2003-10-08 20:40:10.000000000 -0400
+++ mplayer-0.92.ebuild 2003-10-08 20:41:56.000000000 -0400
@@ -353,10 +353,12 @@
 
        dodoc AUTHORS ChangeLog README
        # Install the documentation; DOCS is all mixed up not just html
+       chmod 755 ${S}/DOCS
        cp -r ${S}/DOCS ${D}/usr/share/doc/${PF}/ || die
 
        # Copy misc tools to documentation path, as they're not installed
        # directly
+       chmod 755 ${S}/TOOLS
        cp -r ${S}/TOOLS ${D}/usr/share/doc/${PF} || die
 
        # Install the default Skin and Gnome menu entry

Reproducible: Always
Steps to Reproduce:
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-10-09 00:23:32 UTC
this would be nicer
docinto foo
dodoc bar
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-10-10 08:19:17 UTC
nicer, but doesn't work
see bug #15193
Comment 3 Jason Andryuk 2003-10-11 13:10:08 UTC
Actually, it isn't fixed, but I have the solution.

The problem is that 0644 doesn't set the executable bit for the directories,
so you cannot cd into the directories.  That is why I originally tried to
set to 755.  Changing 0644 to 0755 lets a user cd into the directories, but
then it lists all the regular files as executable...

So we do `chmod 0644`, but then use find to `chmod +x` the directories.

--- mplayer-0.92.ebuild.orig    2003-10-11 16:05:09.000000000 -0400
+++ mplayer-0.92.ebuild 2003-10-11 16:06:28.000000000 -0400
@@ -354,11 +354,13 @@
        dodoc AUTHORS ChangeLog README
        # Install the documentation; DOCS is all mixed up not just html
        chmod 0644 ${S}/DOCS -R
-       cp -r ${S}/DOCS ${D}/usr/share/doc/${PF}/ || die
+       find ${S}/DOCS -type d -exec chmod +x {} \;
+       cp -r ${S}/DOCS ${D}/usr/share/doc/${PF} || die
 
        # Copy misc tools to documentation path, as they're not installed
        # directly
        chmod 0644 ${S}/TOOLS -R
+       find ${S}/TOOLS -type d -exec chmod +x {} \;
        cp -r ${S}/TOOLS ${D}/usr/share/doc/${PF} || die
 
        # Install the default Skin and Gnome menu entry
Comment 4 Martin Holzer (RETIRED) gentoo-dev 2003-10-12 16:17:32 UTC
sorry,
changed to 0755
Comment 5 Jason Andryuk 2003-10-13 09:44:36 UTC
Sorry, I guess I was not clear in my last comment.

We want different permissions for regular files and for the directories.
0644 for regular files
0755 for directories
The executable bit is needed for directories so users can CD into the directory.
 But we don't want to say that some random text files is an executable.

So:
       chmod 0644 ${S}/DOCS -R
       find ${S}/DOCS -type d -exec chmod +x {} \;

This sets everything to 0644, what we want for regular files.
Then find changes the directories (-type d) to have the executable bit (chmod
+x).  The end result of this is 0644 for regular files and 0755 for the directories.

Here's a patch file to add in the correct code, and also to update the DEPEND
line so that we are sure `find` is present.
Comment 6 Jason Andryuk 2003-10-13 09:45:24 UTC
Created attachment 19187 [details, diff]
Patch to correct permissions of Documentation
Comment 7 Martin Holzer (RETIRED) gentoo-dev 2003-10-13 12:18:44 UTC
i've fixed it with your first comment

--- mplayer-0.92.ebuild.orig    2003-10-08 20:40:10.000000000 -0400
+++ mplayer-0.92.ebuild 2003-10-08 20:41:56.000000000 -0400
@@ -353,10 +353,12 @@
 
        dodoc AUTHORS ChangeLog README
        # Install the documentation; DOCS is all mixed up not just html
+       chmod 755 ${S}/DOCS
        cp -r ${S}/DOCS ${D}/usr/share/doc/${PF}/ || die
 
        # Copy misc tools to documentation path, as they're not installed
        # directly
+       chmod 755 ${S}/TOOLS
        cp -r ${S}/TOOLS ${D}/usr/share/doc/${PF} || die
 
        # Install the default Skin and Gnome menu entry


works fine, and i don't want to use any special tools (find) for only change
permissions. 
0755 works fine.
Comment 8 Martin Holzer (RETIRED) gentoo-dev 2003-10-18 10:23:10 UTC
closing as fixed