Unix Technical Forum

SlackBuilds - file permissions

This is a discussion on SlackBuilds - file permissions within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> In different SlackBuild scripts there are lines like chown -R root.root . find . -perm 777 -exec chmod 755 ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 11:02 AM
Guybrush Threepwood
 
Posts: n/a
Default SlackBuilds - file permissions

In different SlackBuild scripts there are lines like

chown -R root.root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;

(...)

chmod 755 $PKG/usr/bin/*
chown -R root:bin $PKG/usr/bin

Of course I know what these command do.
But when I'm building my own packages, for applications that
have no 'official' scripts, how do I know what permissions
to set for certain files?

Are there some rules of thumb?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 11:02 AM
+Alan Hicks+
 
Posts: n/a
Default Re: SlackBuilds - file permissions

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In alt.os.linux.slackware, Guybrush Threepwood dared to utter,
> when I'm building my own packages, for applications that
> have no 'official' scripts, how do I know what permissions
> to set for certain files?
>
> Are there some rules of thumb?


It's basically a "you just know" sort of things. For example, you
don't want binaries world writable. You don't want stuff in /usr/doc/
to be executable. In other words, just check to make sure your
software is installed with reasonable permissions. Some time this is
already done by make, but sometimes things are a little fuzzy too.
Just look over your permissions and see if they make sense. If they
don't, change them before packaging up everything.

- --
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFDNGCQzLTO1iU1uO4RAomGAJ9SN7NJl7qG2FmvwMC8c+ Ep0de2ZACeNCsG
/aaclc06RugiHFnz+UPkfo8=
=wLM5
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 11:02 AM
Stuart Winter
 
Posts: n/a
Default Re: SlackBuilds - file permissions

On Fri, 23 Sep 2005 20:48:12 +0200, spambak@hotmail.com wrote:

Hello

> find . -perm 777 -exec chmod 755 {} \;
> find . -perm 664 -exec chmod 644 {} \;


I'm not sure what all that is for because iirc it equates to
chmod -R og-w .

Last time I checked anyway.

> But when I'm building my own packages, for applications that
> have no 'official' scripts, how do I know what permissions
> to set for certain files?
>
> Are there some rules of thumb?


http://www.interlude.org.uk/unix/sla..._CHECKLIST.txt
http://www.interlude.org.uk/unix/sla...SDEM_SLACK.txt
http://www.interlude.org.uk/unix/sla...esentation.pdf

Also look at the docs in slacktrack in slackware-10.2/extra/

s.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 11:05 AM
Eef Hartman
 
Posts: n/a
Default Re: SlackBuilds - file permissions

Stuart Winter <use.reply.to@interlude.org.uk> wrote:
>> find . -perm 777 -exec chmod 755 {} \;
>> find . -perm 664 -exec chmod 644 {} \;

>
> I'm not sure what all that is for because iirc it equates to
> chmod -R og-w .


Not quite, your "chmod" may also clear all suid and/or sgid bits (ANY
chmod on such a file will, set uid/gid bits seem always have to be set
explicitly, they are NOT retained over a successive chmod). So you
don't want to modify any files with 4777, 2777, etc. (this is assuming,
of course, that the suid/sgid bits are there for a valid reason).

This behaviour is not well-documented, I must admit, but I bumped my
head against it a few times.
It may even have changed since then, if so take this message as never
written (I didn't test this yet in Slackware 10.x).
But anyway, I never do a blanket "chmod" on system directories with
binaries somewhere in them, partly because of this.
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 11:05 AM
Guybrush Threepwood
 
Posts: n/a
Default Re: SlackBuilds - file permissions

On Fri, 23 Sep 2005 15:08:33 -0500, +Alan Hicks+ wrote:

> In alt.os.linux.slackware, Guybrush Threepwood dared to utter,
>> when I'm building my own packages, for applications that
>> have no 'official' scripts, how do I know what permissions
>> to set for certain files?
>>
>> Are there some rules of thumb?

>
> It's basically a "you just know" sort of things. For example, you
> don't want binaries world writable. You don't want stuff in /usr/doc/
> to be executable. In other words, just check to make sure your
> software is installed with reasonable permissions. Some time this is
> already done by make, but sometimes things are a little fuzzy too.
> Just look over your permissions and see if they make sense. If they
> don't, change them before packaging up everything.


And why are the permissions changed in build directories?
e.g.

(...)
cd gimp-$VERSION
chown -R root.root .
find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
../configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var/lib \
--disable-static \
$ARCH-slackware-linux
(...)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com