On Sat, May 10, 2008 at 8:55 PM, Daniele Maccari <[EMAIL PROTECTED]> wrote: > Jonas Karlsson wrote: >> On Sat, 10 May 2008 10:13:00 +0200, Daniele Maccari <[EMAIL PROTECTED]> >> wrote: >>> Michael Homer wrote: >>>> On 5/10/08, Daniele Maccari <[EMAIL PROTECTED]> wrote: >>>>> Ok, I finally solved the problem (if right or wrong, I don't know). >>>>> Attached you'll find the patch, please let me know. >>>>> This way files on which current user has no permissions should be >>>>> correctly managed, as well as globbing (which sudo prevents from >>>>> working, since the command is first parsed by shell, and the permission >>>>> problem arises). >>>> If it's unpacking with bad permissions just fix them in the hook. The >>>> directories should be g+rx. I'm puzzled as to why it wouldn't compile >>>> as root then, though. >>> Ok, playing a bit I found out that changing opt and usr directories' >>> permission to a+rx apparently solved the problem. >>> In the recipe there was though a "chmod -R a+rX usr/share" command, >>> which honestly I couldn't understand. >>> >> >> The difrerence is that +X only sets executable bit if it is set for >> another group/user. This is useful for recursive chmod as it will >> only set executable bit for directories (allow listing) and files with >> executable bit set, not to all files (you probably don't want that). > So does it set the x bit only if an x bit already exists for the file in the > user/group triplet? The execute bit will be set if it's already set anywhere on the file, or if the file is a directory. So anything that is executable to user, group, or others will be set executable for all in the command you posted, and any directories will also have x set to make them listable (provided they're also readable). >>> >>> Now permissions look like these in the sources directory >>> >>> drwxr-sr-x 2 macco sys 4096 2008-03-14 21:44 licenses >>> drwxr-sr-x 3 gobo sys 4096 2008-05-10 10:03 opt >>> drwxr-sr-x 2 macco sys 4096 2008-03-14 21:44 readmes >>> -rwxr-xr-x 1 gobo sys 7770 2008-05-10 10:05 rpmoffset >>> drwxr-sr-x 3 macco sys 4096 2008-03-14 21:44 RPMS >>> -rwxr-xr-x 1 macco sys 3925 2008-03-14 21:44 update >>> drwxr-sr-x 4 gobo sys 4096 2008-05-10 10:04 usr >>> >>> >> >> Here you can see that rpmoffset and update files have the executable >> bit set, which you probably don't want. It's not fatal for these files >> as they probably are textfiles, but you get the idea. >> > > Well, rpmoffset is actually used as an executable in the recipe, so I think > the x bit is ok. >> >> >>> >>> and Compile can easy install the program. >>> >>> It remains the fact, as you pointed out, that in the previous case also >>> compiling as root gave problems. Permissions was like these: >>> >>> drwxr-sr-x 2 macco sys 4096 2008-03-14 21:44 licenses >>> drwx--S--- 3 gobo sys 4096 2008-05-10 10:11 opt >>> drwxr-sr-x 2 macco sys 4096 2008-03-14 21:44 readmes >>> -rwxr-xr-x 1 gobo sys 7770 2008-05-10 10:11 rpmoffset >>> drwxr-sr-x 3 macco sys 4096 2008-03-14 21:44 RPMS >>> -rwxr-xr-x 1 macco sys 3925 2008-03-14 21:44 update >>> drwx--S--- 4 gobo sys 4096 2008-05-10 10:11 usr >>> >>> Note the capitalized S for usr and opt group permissions. I can't really >>> figure out the problem. >>> >> >> An s/S in the group permissions means that the setguid bit is set, which >> will force group owner to 'sys' for each created file and subdirectory. If >> the S is capitalized it means that the executable (listing) bit is not >> set. >> This has the effect that although group 'sys' is enforced members in that >> group cannot list contents in the directories. > So could this be the problem in the first place? Compiling as a regular user > (even if belonging to the sys group) doesn't give you permissions to list > contents, and so the globbing when copying directories' contents fails. That is the problem, yes, the directories won't be readable. chmod -R a+rX should have fixed that, though.
It doesn't seem to be in the attached recipe, so you should put it back in. The hook is run sudo, so it can make whatever changes it needs. -Michael _______________________________________________ gobolinux-devel mailing list gobolinux-devel@lists.gobolinux.org http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel