From: epriestley Date: Thu, 14 Jun 2012 19:30:21 +0000 (-0700) Subject: Call clearstatcache() after changing ~/.arcrc permissions X-Git-Tag: conduit-6~249 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=4448bd09c770916fcb27d37df958823a8a4ee1c0;p=arcanist.git Call clearstatcache() after changing ~/.arcrc permissions Summary: Otherwise we'll get a cached result from fileperms() if we end up here again. Test Plan: `chmod 644 ~/.arcrc ; arc help` no longer double prompts when run from outside of a .arcconfig working copy. Reviewers: csilvers Reviewed By: csilvers CC: aran Maniphest Tasks: T1359 Differential Revision: https://secure.phabricator.com/D2752 --- diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index 403ad124..4870934b 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -991,6 +991,11 @@ abstract class ArcanistBaseWorkflow { throw new ArcanistUsageException("Set ~/.arcrc to file mode 600."); } execx('chmod 600 %s', $user_config_path); + + // Drop the stat cache so we don't read the old permissions if + // we end up here again. If we don't do this, we may prompt the user + // to fix permissions multiple times. + clearstatcache(); } }