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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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? |
| |||
| -----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----- |
| |||
| 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. |
| |||
| 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 ** ************************************************** ****************** |
| ||||
| 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 (...) |