From: Zac Medico Date: Sat, 18 Aug 2012 01:07:15 +0000 (-0700) Subject: emerge-delta-webrsync: check write permission X-Git-Tag: v2.2.0_alpha122~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf;p=portage.git emerge-delta-webrsync: check write permission This will fix bug #176008. --- diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync index e23316a8e..3b934ffe9 100755 --- a/misc/emerge-delta-webrsync +++ b/misc/emerge-delta-webrsync @@ -97,11 +97,22 @@ if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then exit 1 fi -if [[ ! -d $DISTDIR ]] ; then - mkdir -p $DISTDIR +[[ -d ${PORTDIR} ]] || mkdir -p "${PORTDIR}" +if [[ ! -w ${PORTDIR} ]] ; then + eecho "PORTDIR is not writable: ${PORTDIR}" + exit 1 +fi + +[[ -d ${DISTDIR} ]] || mkdir -p "${DISTDIR}" +if [[ ! -w ${DISTDIR} ]] ; then + eecho "DISTDIR is not writable: ${DISTDIR}" + exit 1 fi -if [[ ! -d $TMPDIR ]]; then - mkdir -p $TMPDIR + +[[ -d ${TMPDIR} ]] || mkdir -p "${TMPDIR}" +if [[ ! -w ${TMPDIR} ]] ; then + eecho "TMPDIR is not writable: ${TMPDIR}" + exit 1 fi cd "$DISTDIR"