[PATCH 1/1] run-command.c: ignore bad permissions on dirs in PATH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All of my git aliases stopped working one day. For example, when I ran 'git ci'
(where 'ci' is an alias for 'commit') it printed out this error:

fatal: cannot exec 'git-ci': Permission denied

This error was confusing (I didn't have a 'git-ci' executable anywhere, so why
was it complaining about permissions?) and it took me a while to figure out that
this was happening because I happened to have a random directory in my PATH that
had permissions set incorrectly. Git should probably ignore this, and here is
one way to fix it, although I'm not sure if it's the best way.



Signed-off-by: Dale Rowley <ddrowley@xxxxxxxxx>
---
 run-command.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/run-command.c b/run-command.c
index c7793f5..a98282b 100644
--- a/run-command.c
+++ b/run-command.c
@@ -284,7 +284,7 @@ fail_pipe:
 		 * Do not check for cmd->silent_exec_failure; the parent
 		 * process will check it when it sees this exit code.
 		 */
-		if (errno == ENOENT)
+		if (errno == ENOENT || errno == EACCES)
 			exit(127);
 		else
 			die_errno("cannot exec '%s'", cmd->argv[0]);
-- 
1.7.1.226.g770c5.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]