Skip to content

Some files & folders are not chowned #2

Description

@supasteev0

Hi,
Thanks a lot for this great tool, which enabled me to remove some dirty hacks to chown/chmod files at run time.

I still have one issue as some files and folders inside my user home are not being chowned by fixuid.
I tried to add some more debug via logger.Println in the go script but I was unable to build it ;( (I'm not a Go expert)

Here is the relevant content of my Dockerfile:

`
RUN addgroup --gid 1000 site &&
adduser --uid 1000 --ingroup site --home /home/site --shell /bin/bash --disabled-password --gecos "" site &&
sed -i '$ a site ALL=(ALL:ALL) NOPASSWD: ALL' /etc/sudoers

RUN curl -s -o /home/site/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash &&
curl -s -o /home/site/.git-prompt.sh -OL https://github.com/git/git/raw/master/contrib/completion/git-prompt.sh &&
cp /etc/skel/.* /home/site/;
cat /tmp/profile/.bashrc_append >> /home/site/.bashrc &&
cat /tmp/profile/.vimrc_append >> /home/site/.vimrc &&
cp /tmp/profile/.gitconfig /home/site/ &&
mkdir -p /home/site/.composer &&
mkdir -p /home/site/.ssh &&
chown -R site:site /home/site/ &&
find /tmp/ -type f -name '.*' -maxdepth 1 -delete

USER site:site
CMD ["/run/bootstrap.sh"]
`

fixuid is executed in my bootstrap.sh script with:

eval $( fixuid )

User & group ids are specified in my compose.yml file:

user: ${DEV_UID:-1000}:${DEV_GID:-1000}

DEV_UID & DEV_GID are set in a .env file

At startup, fixuid chowns some files:

fixuid: updating user 'site' to UID '1001
fixuid: updating group 'site' to GID '1001
fixuid: chown /home
fixuid: chown /home/site
fixuid: chown /home/site/.bash_logout
fixuid: chown /home/site/.bashrc
fixuid: chown /home/site/.composer
fixuid: chown /home/site/.git-completion.bash
fixuid: chown /home/site/.git-prompt.sh

But, after entering the container, I still have some files/folder not being chowned in user home folder, with 1000:1000 perms:

-rw-r--r-- 1 site site 220 oct. 7 10:18 .bash_logout
-rw-r--r-- 1 site site 11K oct. 7 10:18 .bashrc
drwxr-xr-x 2 site site 6 oct. 7 10:18 .composer
-rw-r--r-- 1 site site 70K oct. 7 10:18 .git-completion.bash
-rwxrwxrwx 1 site site 342 mars 6 2017 .gitconfig
-rw-r--r-- 1 site site 16K oct. 7 10:18 .git-prompt.sh
-rw-r--r-- 1 1000 1000 675 oct. 7 10:18 .profile
drwxr-xr-x 2 1000 1000 6 oct. 7 10:18 .ssh
-rw-r--r-- 1 1000 1000 601 oct. 7 10:18 .vimrc

Any help would be appreciated.

Thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions