From: Bert Wesarg Date: Wed, 6 Aug 2008 08:02:51 +0000 (+0200) Subject: tg.sh: Check for read permissions of help files X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=commitdiff_plain;h=5a1bba86589568898e545b5f9a256f4f93ebc796 tg.sh: Check for read permissions of help files We currently check only for '-f' but we need to have read permissions as well. And help files don't need the execution bit set. [pb: Simplified test.] Signed-off-by: Bert Wesarg Signed-off-by: Petr Baudis --- diff --git a/Makefile b/Makefile index 2975f29..1352d03 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ install:: all install -d -m 755 "$(hooksdir)" install $(hooks_out) "$(hooksdir)" install -d -m 755 "$(sharedir)" - install $(help_out) "$(sharedir)" + install -m 644 $(help_out) "$(sharedir)" clean:: rm -f tg $(commands_out) $(hooks_out) $(help_out) diff --git a/tg.sh b/tg.sh index 179f0de..ead2361 100644 --- a/tg.sh +++ b/tg.sh @@ -167,7 +167,7 @@ do_help() echo "TopGit v0.1 - A different patch queue manager" echo "Usage: tg ($cmds|help) ..." - elif [ -f "@sharedir@/tg-$1.txt" ] ; then + elif [ -r "@sharedir@/tg-$1.txt" ] ; then cat "@sharedir@/tg-$1.txt" else echo "`basename $0`: no help for $1" 1>&2