From a85c16be24d7f779cf295dd33448c3fa26b47e82 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 6 Nov 2009 15:21:53 +0100 Subject: [PATCH 1/1] More sanity checks for vcs_info Before, this could screw you: cd /tmp; mkdir test; cd test; sudo chown root .; sudo chmod 700 . --- debian/changelog | 8 +++++++- etc/zsh/zshrc | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c601f4c..744ee15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,16 @@ grml-etc-core (0.3.78) UNRELEASED; urgency=low + [ Michael Prokop ] * Apply patch by Axel Beckert (thanks!) which adds Emacs local variables at EOF equivalent to vim's. [Closes: issue745] - -- Michael Prokop Thu, 22 Oct 2009 02:55:40 +0200 + [ Frank Terbeck ] + * zshrc: Fixed a bug in vcs_info which led to an endless loop, when + a directory had really screwy premissions. Noticed by Christian + Hofstaedtler + + -- Frank Terbeck Fri, 06 Nov 2009 15:18:23 +0100 grml-etc-core (0.3.77) unstable; urgency=low diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 64503c2..b0b5c1e 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1731,6 +1731,7 @@ VCS_INFO_detect_by_dir() { #{{{ realbasedir="$(VCS_INFO_realpath ${basedir})" while [[ ${realbasedir} != '/' ]]; do + [[ -r ${realbasedir} ]] || return 1 if [[ -n ${vcs_comm[detect_need_file]} ]] ; then [[ -d ${basedir}/${dirname} ]] && \ [[ -e ${basedir}/${dirname}/${vcs_comm[detect_need_file]} ]] && \ @@ -1870,6 +1871,9 @@ vcs_info_lastmsg () { # {{{ vcs_info () { # {{{ emulate -L zsh setopt extendedglob + + [[ -r . ]] || return 1 + local pat local -i found local -a VCSs disabled dps -- 2.1.4