Non root users in jail using git don't create or use .gitconfig under HOME

Matthew Dresden

Member

Reaction score: 14
Messages: 73

My issue is this:

If I want to configure git as root with a command like git config it does what is expected and creates a file in ~/.gitconfig

However if any other user tries to do the same command or any other git command it only looks for /usr/local/etc/gitconfig

It should by default look at the global location and then try the location under home ~/.gitconfig

So I made this file by hand at ~/.gitconfig and ~/.config/git/config, but it never looks at them, I am just stuck with this error:


$ git config user.name "Joe Snuffy"
fatal: unable to access '/usr/local/etc/gitconfig': Permission denied


Making this global file location world readable and the path it exist in is not an option.

I want to get standard git behavior.

Also git is installed in a freebsd jail FreeBSD jenkins 10.3-RELEASE FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 02:10:02 UTC 2016

I have the same behavior with git installed from ports and pkg.

I though to review all the Environment variables and didn't see anything wrong there.

According to Git's info page https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables, it looks at $HOME

Here is a print out of the command env from the user that is having the issue:

Code:
jenkins@jenkins:/usr/local/jenkins
$ env
HOSTNAME=jenkins
SHELL=/usr/local/bin/bash
TERM=xterm-256color
VAGRANT_DEFAULT_PROVIDER=virtualbox
HISTSIZE=
CLICOLOR=1
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
SSH_TTY=/dev/pts/2
QT_GRAPHICSSYSTEM_CHECKED=1
HISTFILESIZE=
EUID=818
USER=jenkins
PAGER=less
PATH=/usr/local/jenkins/.rbenv/shims:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAIL=/var/spool/mail/jenkins
BLOCKSIZE=K
PWD=/usr/local/jenkins
EDITOR=vim
RBENV_SHELL=bash
HISTCONTROL=ignorespace:ignoredups
SHLVL=1
HOME=/usr/local/jenkins
LOGNAME=jenkins
QTLIB=/usr/lib64/qt-3.3/lib
UID=818
LESSOPEN=|/usr/bin/lesspipe.sh %s
CCACHE_HASHDIR=
_=/usr/bin/env
OLDPWD=/usr/local/jenkins/.config/git
 
Top