summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks/04-change-gids-and-uids
blob: 6fb78e4089b2bdaf13f522e49300e7add0e3d7bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

set -e

# Free the fixed GIDs and UIDs we're using.

echo "Change GIDs and UIDs"

TPS_GROUP_STEALER=$(getent group 122 | awk -F ':' '{print $1}')
if [ -n "$TPS_GROUP_STEALER" ]; then
   groupmod --gid 150 "$TPS_GROUP_STEALER"
   find / -wholename /proc -prune -o \( \! -type l -a -gid 122 -exec chgrp 150 '{}' \; \)
fi

TPS_USER_STEALER=$(getent passwd 115 | awk -F ':' '{print $1}')
if [ -n "$TPS_USER_STEALER" ]; then
   usermod --uid 150 "$TPS_USER_STEALER"
   find / -wholename /proc -prune -o \( \! -type l -a -gid 115 -exec chgrp 150 '{}' \; \)
fi