On Thu, 20 Dec 2012 08:25:12 -0800 (PST)
ebenza...@gmail.com wrote:

> I'm trying to add git functionality to a production CentOS 5.5 system
> that has no development tools (since it is a production system). So I
> don't have access to make/gcc/etc.

> I do not have root access, and for obvious reasons, root is does not
> want to install Git on a prod system, but is okay if I can set it up
> locally for my own use.

You could tell your root this position is outright stupid and the
reasons to maintain it are not at all obvious: if you will have Git
installed under your ~, these will be the same executable files, no
different from those you'd get if Git was installed system-wide.

Any harm which can potentially be inflicted to the system by running
Git on it does not somehow change if Git is in ~joe/bin rather than
in /usr/bin, really.

Moreover, binaries installed by a Joe Random User are owned by him/her
and hence are *writable* by any process running with the same
credentials.  This differs from a system-wide installation where such
binaries are writable only by root, and it's beleived to be harder to
get root on a typical system than to get that Joe Random User.

Also note that while I am not familiar with Git package for CentOS I
beleive that merely installing Git in a system is not supposed to
automatically enable/run its daemon process or make it accessible via
inetd or whatever.  At least I hope the CentOS package's maintainers
did not goof on a scale that big.  Without any daemons configured and
running a harm which could be inflicted using Git is not too much
different from that which can be inflicted using `cat`.

Installing whatever piece of software in the system does indeed
potentially widen its surface of attack, but installing it to the home
directory of a regular user does not in any way alleviate this effect,
but supposedly rather makes it worse.

> I've tried to download and unpack a git-core.rpm into my home dir and 
> although I am able run some functionality of git, none of git's 
> dependencies are where it expects them and so it fails.
> My structure looks like the following:
> ~/git
> ~/git/usr
> ~/git/usr/bin
> ~/git/usr/share
> ~/git/usr/share/doc
> ~/git/usr/share/git-core
> ~/git/usr/share/locale
> ~/git/usr/share/man
> When I run something like git help clone, I get an error msg No
> manual entry for git-clone. This is confirmed by git --man-path
> (/usr/share/man). Other commands fail similarly.

This is not really interesting (see below).
Are you able to run `git init`, `git clone` `git fetch`?
If they fail, then how? (Please, cite the full error output).

> How can I tell git to use ~/git as the root instead of / as the root
> to all git dependencies without recompiling? I cannot seem to find
> any environment vars or git vars that I can set.

I would install CentOS 5.5 somewhere (on a virtual machine for
instance), install the necessary developer tools there and then built
Git from the source configuring it to use /home/you/git as its "PREFIX".
Then install it (on the build machine, I mean) using something like

$ mkdir /var/tmp/git
$ make DESTDIR=/var/tmp/git install

and then pack it using something like

$ tar -C /var/tmp/git -c -f - . | gzip -c9 >/var/tmp/git.tar.gz

You will get a compressed tarball with relative pathnames in it.

Then just transfer the resulting tarball to the target system (using
`scp` for instance) and unroll it relative to your home directory:

$ tar -C ~ -x /var/tmp/git.tar.gz

to get your ~/git hierarchy back.

Supposedly this should work (though I have not tested).


Reply via email to