threads / discuss / 21453

Unhappy git in a jailshell?

Subject: Unhappy git in a jailshell?

## tl;dr

4 messages between Nov 2, 2009 and Nov 4, 2009.

replies: 3people: 3as markdown or json

Alex MDC· Nov 2, 2009, 12:16 UTC · lore
Hello,

I'm trying to use git on a linux server, but unfortunately I've only been granted jailshelled access. Most of git works, but some commands just fail to run, e.g. git repack git rebase git index-pack

All these commands fail with the error "git: git-xxx is not a git-command. See git --help". However most other every-day commands work just fine (add, status, commit...)

I've been in contact with the server admins and they kindly upgraded git to the latest 1.6.5.2 release but that didn't help. I enquired about the contents of `git --exec-path` (as I don't have access from the jailshell) and they said that all the "missing" commands are present in that directory.

I also tried "git --help -all" but that doesn't show any commands in the output! In a way I'm wondering how it is working at all...

So I guess my question is, why are some commands working but not others? If all commands are treated uniformly by using the command binary from the libexec dir it would seem as though all commands should work or all should be "missing".

Also, are they any ideas on how to get the missing commands to work?

Thanks for your help, Alex MDC

Dmitry Potapov· Nov 2, 2009, 12:47 UTC · re: Alex MDC · lore

Re: Unhappy git in a jailshell?

On Mon, Nov 02, 2009 at 11:16:43PM +1100, Alex MDC wrote:
Show 8 quoted lines
> Hello,
> 
> I'm trying to use git on a linux server, but unfortunately I've only
> been granted jailshelled access. Most of git works, but some commands
> just fail to run, e.g.
> git repack
> git rebase
> git index-pack

Most Git commands are builtin, so they are executed by git.exe directly, but some commands are implemented as separate binaries or shell files. These commands require `git --exec-path` in PATH to run. Normally, git adds `git --exec-path` in its environment before running them.

Apparently, jailshelled access prevents that somehow. So, I suggest you contact your system administrator and tell him that you need to be able to run files from `git --exec-path` to being able to use git, as git needs them internally for normal work.

Dmitry
Michael J Gruber· Nov 2, 2009, 13:51 UTC · re: Dmitry Potapov · lore

Re: Unhappy git in a jailshell?

Dmitry Potapov venit, vidit, dixit 02.11.2009 13:47:
Show 20 quoted lines
> On Mon, Nov 02, 2009 at 11:16:43PM +1100, Alex MDC wrote:
>> Hello,
>>
>> I'm trying to use git on a linux server, but unfortunately I've only
>> been granted jailshelled access. Most of git works, but some commands
>> just fail to run, e.g.
>> git repack
>> git rebase
>> git index-pack
> 
> Most Git commands are builtin, so they are executed by git.exe directly,
> but some commands are implemented as separate binaries or shell files.
> These commands require `git --exec-path` in PATH to run. Normally, git
> adds `git --exec-path` in its environment before running them.
> 
> Apparently, jailshelled access prevents that somehow. So, I suggest you
> contact your system administrator and tell him that you need to be able
> to run files from `git --exec-path` to being able to use git, as git
> needs them internally for normal work.
> 

Can you (Alex) find out whether you are allowed to run those binaries from that path directly? In that case we could rethink our strategy and adjust for the case where we can't set the environment.

Michael
Alex MDC· Nov 4, 2009, 01:17 UTC · re: Michael J Gruber · lore

Re: Unhappy git in a jailshell?

Hi guys,

I requested the admins allow access to the `git --exec-path` directory from the jailshell and incredibly, they granted it! Now everything is working and "git --help --all" lists all the commands as expected, so that was indeed the problem.

It was just a bit deceiving at first that some git commands were working but others weren't, but Dmitry explained that one.

Thanks for your help, Alex

← back to recent threads