diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-09-27 10:13:58 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-09-27 10:13:58 +0000 |
commit | 567b0e377d9f202992fdeea69c25495c24be9583 (patch) | |
tree | e4e88a1876e073885abba64ccb608ca3fd59135f /net-ftp/ftpbase | |
parent | Version bump. (diff) | |
download | gentoo-2-567b0e377d9f202992fdeea69c25495c24be9583.tar.gz gentoo-2-567b0e377d9f202992fdeea69c25495c24be9583.tar.bz2 gentoo-2-567b0e377d9f202992fdeea69c25495c24be9583.zip |
Give a newly created home dir sane ownership (root:ftp), #148748 thanks
to Sergey Borodich.
(Portage version: 2.1.2_pre1-r3)
Diffstat (limited to 'net-ftp/ftpbase')
-rw-r--r-- | net-ftp/ftpbase/ChangeLog | 6 | ||||
-rw-r--r-- | net-ftp/ftpbase/ftpbase-0.00.ebuild | 37 |
2 files changed, 21 insertions, 22 deletions
diff --git a/net-ftp/ftpbase/ChangeLog b/net-ftp/ftpbase/ChangeLog index 29a10221f628..20ad5b6b0f28 100644 --- a/net-ftp/ftpbase/ChangeLog +++ b/net-ftp/ftpbase/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-ftp/ftpbase # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-ftp/ftpbase/ChangeLog,v 1.11 2006/04/13 07:26:11 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-ftp/ftpbase/ChangeLog,v 1.12 2006/09/27 10:13:58 uberlord Exp $ + + 27 Sep 2006; Roy Marples <uberlord@gentoo.org> ftpbase-0.00.ebuild: + Give a newly created home dir sane ownership (root:ftp), #148748 thanks + to Sergey Borodich. 13 Apr 2006; Roy Marples <uberlord@gentoo.org> ftpbase-0.00.ebuild: Fixed up some quoting issues and remove eindent command, #129774. diff --git a/net-ftp/ftpbase/ftpbase-0.00.ebuild b/net-ftp/ftpbase/ftpbase-0.00.ebuild index ae470e29fa5e..54205f8b5224 100644 --- a/net-ftp/ftpbase/ftpbase-0.00.ebuild +++ b/net-ftp/ftpbase/ftpbase-0.00.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-ftp/ftpbase/ftpbase-0.00.ebuild,v 1.15 2006/09/18 16:32:54 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-ftp/ftpbase/ftpbase-0.00.ebuild,v 1.16 2006/09/27 10:13:58 uberlord Exp $ inherit eutils pam @@ -21,9 +21,9 @@ DEPEND="pam? ( || ( virtual/pam sys-libs/pam ) ) S=${WORKDIR} check_collision() { - [[ ! -e "$1" ]] && return 0 + [[ ! -e $1 ]] && return 0 - [[ $( head -n 1 "$1" ) == "$( head -n 1 "$2" )" ]] && return 0 + [[ $(head -n 1 "$1") == $(head -n 1 "$2") ]] && return 0 eerror " $1 exists and was not provided by ${P}" return 1 @@ -33,10 +33,10 @@ pkg_setup() { ebegin "Checking for possible file collisions..." local collide=false - check_collision /etc/ftpusers "${FILESDIR}/ftpusers" || collide=true + check_collision "${ROOT}etc/ftpusers" "${FILESDIR}/ftpusers" || collide=true if use pam ; then - check_collision /etc/pam.d/ftp "${FILESDIR}/ftp-pamd" || collide=true + check_collision "${ROOT}etc/pam.d/ftp" "${FILESDIR}/ftp-pamd" || collide=true fi if ${collide} ; then @@ -46,16 +46,26 @@ pkg_setup() { echo ewarn "If you edited them, remember to backup and when restoring make" ewarn " sure the first line in each file is:" - einfo "$( head -n 1 "${FILESDIR}/ftpusers" )" + einfo "$(head -n 1 "${FILESDIR}/ftpusers")" eend 1 die "Can't be installed, files will collide" fi eend 0 + # Check if home exists + local exists=false + [[ -d "${ROOT}home/ftp" ]] && exists=true + # Add our default ftp user enewgroup ftp 21 enewuser ftp 21 -1 /home/ftp ftp + + # If home did not exist and does now then we created it in the enewuser + # command. Now we have to change it's permissions to something sane. + if [[ ${exists} == "false" && -d "${ROOT}home/ftp" ]] ; then + chown root:ftp "${ROOT}"home/ftp + fi } src_install() { @@ -75,18 +85,3 @@ src_install() { fi fi } - -pkg_postinst() { - # Create our home directory if it doesn't exist and give a warning if we - # cannot. - # Install manually using install -d until bug #9849 is solved. - # This means that the home directory will not be removed when we uninstall - # if it's empty. - local homedir=$(egethome ftp) - if [[ ! -d ${homedir} ]]; then - einfo "Creating home directory for ftp user" - einfo " ${homedir}" - install -d "${homedir}" \ - || ewarn " can't create ${homedir}" - fi -} |