From a801c4c58902cae7b835d890487edc39bd7da142 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Fri, 13 Nov 2015 13:27:56 +0100 Subject: Use $LOGNAME instead of $USER The $USER environment variable is not guaranteed to exist, but $LOGNAME is defined by POSIX[0] (Environment Variables, section 8.3 Other Environment Variables). Use that instead. Thanks to Scott Stevenson for pointing out this solution, and Debian for raising the problem. [0]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 --- maint/release.in | 2 +- share/rcm.sh.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maint/release.in b/maint/release.in index 1df9f97..e29e059 100755 --- a/maint/release.in +++ b/maint/release.in @@ -87,7 +87,7 @@ release_build_deb() { cp -R debian deb-build/${PACKAGE}-${PACKAGE_VERSION} && \ cd deb-build/${PACKAGE}-${PACKAGE_VERSION} && \ dch -d "New upstream release" && dch -r "" && \ - debuild --prepend-path=/usr/local/bin -e USER -F && \ + debuild --prepend-path=/usr/local/bin -F && \ cd ${abs_top_builddir} && \ ([ -d gh-pages ] || git clone --branch gh-pages ${ORIGIN_URL} gh-pages) && \ ([ -d gh-pages/debs ] || mkdir gh-pages/debs) && \ diff --git a/share/rcm.sh.in b/share/rcm.sh.in index c7a3dfb..ed5d6f9 100644 --- a/share/rcm.sh.in +++ b/share/rcm.sh.in @@ -130,7 +130,7 @@ run_hooks() { # The former is however a bit better when it comes to security. On the other hand # running these hooks imply some level of trust; surely one doesn't clone somebody # else's dotfiles repository without reviewing the hooks before doing an `rcup`? - find "$hook_file" -type f \( \( -user $USER -perm -100 \) -o -perm -001 \) \ + find "$hook_file" -type f \( \( -user $LOGNAME -perm -100 \) -o -perm -001 \) \ -exec \ sh -c 'cd "`dirname $1`" && ./"`basename $1`"' arg0 '{}' \ \; -- cgit v1.2.3