]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Call clearstatcache() after changing ~/.arcrc permissions
authorepriestley <git@epriestley.com>
Thu, 14 Jun 2012 19:30:21 +0000 (12:30 -0700)
committerepriestley <git@epriestley.com>
Thu, 14 Jun 2012 19:30:21 +0000 (12:30 -0700)
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

src/workflow/ArcanistBaseWorkflow.php

index 403ad1246a276d16ffe716d2d5d21c0789006126..4870934bdc669e6a07dfc11fd54e899406b2c779 100644 (file)
@@ -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();
         }
       }