From: Jeff King <peff@peff.net>
To: "krzf83@gmail.com " <krzf83@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: hooks scripts and noexec partition
Date: Tue, 16 Dec 2014 22:03:29 -0500 [thread overview]
Message-ID: <20141217030328.GB4033@peff.net> (raw)
In-Reply-To: <CAJ1PRS=KmiQJG91nxG5pQXPHX2XruoyL9c4yzzPeYayw+UAjPw@mail.gmail.com>
On Sun, Dec 14, 2014 at 02:44:35AM +0100, krzf83@gmail.com wrote:
> Thanks for the patch, however it is not working (no change, hooks
> still dont work on noexec partition). Since I see that you are fluent
> in git code and C can you by any chance tell me how to modify
> run-command.c to make git run hooks as: /bin/sh <hook_path> ?
I do not think that is a smart thing to do in general, as there is no
guarantee that the hook is in fact a shell script (and not a binary, or
some other scripting language). But if you want do a one-off patch for
yourself, knowing that you will only use shell scripts, it is probably
something like:
diff --git a/run-command.c b/run-command.c
index a476999..ccfccf0 100644
--- a/run-command.c
+++ b/run-command.c
@@ -812,6 +812,7 @@ int run_hook_ve(const char *const *env, const char *name, va_list args)
if (!p)
return 0;
+ argv_array_push(&hook.args, "/bin/sh");
argv_array_push(&hook.args, p);
while ((p = va_arg(args, const char *)))
argv_array_push(&hook.args, p);
-Peff
prev parent reply other threads:[~2014-12-17 3:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 15:41 hooks scripts and noexec partition krzf83@gmail.com
2014-01-15 9:16 ` Jeff King
2014-12-14 1:44 ` krzf83@gmail.com
2014-12-17 3:03 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141217030328.GB4033@peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=krzf83@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).