Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
docker-image-recipes
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
25a9982c
authored
2017-09-18 11:14:15 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Some uid/gid protections against 0.
1 parent
7c10c413
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
27 deletions
dovecot/files/entrypoint
mysql/files/entrypoint
node/files/entrypoint
php-fpm/files/entrypoint
postfix/files/entrypoint
postgresql/files/entrypoint
roundcube/files/entrypoint
dovecot/files/entrypoint
View file @
25a9982
...
...
@@ -4,12 +4,12 @@ set -ex
hostuser_home
=
"
$(
getent passwd hostuser | cut -f 6 -d :
)
"
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group hostgroup | cut -f 3 -d :
)
groupmod -g
$GID
hostgroup
find
"
$hostuser_home
"
-gid
$old_gid
-print0 | xargs -0r chgrp hostgroup
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
usermod -u
$UID
hostuser
fi
...
...
mysql/files/entrypoint
View file @
25a9982
...
...
@@ -6,17 +6,13 @@ _mysql() {
mysqld_safe
"
$@
"
}
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group mysql | cut -f 3 -d :
)
groupmod -g
$GID
mysql
else
found_errors+
=(
"gid not set"
)
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
usermod -u
$UID
mysql
else
found_errors+
=(
"uid not set"
)
fi
if
[[
$(
find /var/lib/mysql -maxdepth 1 -mindepth 1|wc -l
)
=
0
]]
;
then
...
...
@@ -24,13 +20,6 @@ if [[ $(find /var/lib/mysql -maxdepth 1 -mindepth 1|wc -l) = 0 ]]; then
zcat /var/lib/container/var_lib_mysql.tar.gz | tar -C /var/lib/mysql -xf -
fi
if
[[
${#
found_errors
[*]
}
-gt 0
]]
;
then
for
error
in
"
${
found_errors
[@]
}
"
;
do
echo
"
$error
"
done
exit
1
fi
declare
-i
i
=
0
mysqld_safe --skip-networking &
while
eval
[[
\$
DB_INFO_
$i
]]
;
do
...
...
node/files/entrypoint
View file @
25a9982
...
...
@@ -4,12 +4,12 @@ set -ex
node_home
=
"
$(
getent passwd node | cut -f 6 -d :
)
"
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group node | cut -f 3 -d :
)
groupmod -g
$GID
node
find
"
$node_home
"
-gid
$old_gid
-print0 | xargs -0r chgrp node
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
usermod -u
$UID
node
fi
if
[[
-e package.json
]]
;
then
...
...
php-fpm/files/entrypoint
View file @
25a9982
...
...
@@ -4,12 +4,12 @@ set -ex
hostuser_home
=
"
$(
getent passwd hostuser | cut -f 6 -d :
)
"
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group hostgroup | cut -f 3 -d :
)
groupmod -g
$GID
hostgroup
find
"
$hostuser_home
"
-gid
$old_gid
-print0 | xargs -0r chgrp hostgroup
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$GID
-ne 0
]]
;
then
usermod -u
$UID
hostuser
fi
mkdir -p /run/php
...
...
postfix/files/entrypoint
View file @
25a9982
...
...
@@ -4,12 +4,12 @@ set -ex
hostuser_home
=
"
$(
getent passwd hostuser | cut -f 6 -d :
)
"
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group hostgroup | cut -f 3 -d :
)
groupmod -g
$GID
hostgroup
find
"
$hostuser_home
"
-gid
$old_gid
-print0 | xargs -0r chgrp hostgroup
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
usermod -u
$UID
hostuser
fi
...
...
postgresql/files/entrypoint
View file @
25a9982
#!/bin/bash
declare
-a found_errors
set
-ex
if
[[
$(
find /var/lib/postgresql -maxdepth 1 -mindepth 1|wc -l
)
=
0
]]
;
then
...
...
@@ -10,13 +8,13 @@ fi
postgres_home
=
"
$(
getent passwd postgres | cut -f 6 -d :
)
"
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group postgres | cut -f 3 -d :
)
groupmod -g
$GID
postgres
find
"
$postgres_home
"
/etc/postgresql /var/run/postgresql -gid
$old_gid
-print0 | xargs -0r chgrp postgres
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
old_uid
=
$(
getent passwd postgres | cut -f 3 -d :
)
usermod -u
$UID
postgres
find /etc/postgresql /var/run/postgresql -uid
$old_uid
-print0 | xargs -0r chown postgres
...
...
roundcube/files/entrypoint
View file @
25a9982
...
...
@@ -4,12 +4,12 @@ set -ex
hostuser_home
=
"
$(
getent passwd hostuser | cut -f 6 -d :
)
"
if
[[
$GID
]]
;
then
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group hostgroup | cut -f 3 -d :
)
groupmod -g
$GID
hostgroup
find
"
$hostuser_home
"
-gid
$old_gid
-print0 | xargs -0r chgrp hostgroup
fi
if
[[
$UID
]]
;
then
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
usermod -u
$UID
hostuser
fi
...
...
Please
register
or
sign in
to post a comment