This file is indexed.

/usr/share/livecd-rootfs/live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early is in livecd-rootfs 2.525.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#!/bin/sh -eu

ERRCNT=""

# Known good post-debootstrap values
passwd_bootstrap="7d89b96d37aab3fd22e4570862e3a8eb"
shadow_bootstrap="4627fdc1f1f2712bc52544d5501bcf81"
group_bootstrap="ffbe05611b49480cb289f343a67d7e7b"
gshadow_bootstrap="46121fc1a7d95f37e7a3fb21db8061e8"

# Current post-debootstrap values
passwd_hash=$(set -- $(md5sum /etc/passwd) && echo $1)
shadow_hash=$(set -- $(cat /etc/shadow | sed "s/:.*:0:99999:/:0:99999:/g" | md5sum) && echo $1)
group_hash=$(set -- $(md5sum /etc/group) && echo $1)
gshadow_hash=$(set -- $(md5sum /etc/gshadow) && echo $1)

# /etc/passwd
if [ "$passwd_bootstrap" = "$passwd_hash" ]; then
    cat > /etc/passwd <<EOF
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
messagebus:x:100:103::/var/run/dbus:/bin/false
snappypkg:x:101:104::/nonexistent:/bin/false
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
systemd-timesync:x:103:108:systemd Time Synchronization,,,:/run/systemd:/bin/false
systemd-network:x:104:109:systemd Network Management,,,:/run/systemd/netif:/bin/false
systemd-resolve:x:105:110:systemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:106:111:systemd Bus Proxy,,,:/run/systemd:/bin/false
_apt:x:117:65534::/nonexistent:/bin/false
docker:x:107:113::/nonexistent:/bin/false
syslog:x:108:114::/home/syslog:/bin/false
dnsmasq:x:109:65534:dnsmasq,,,:/var/lib/misc:/bin/false
tss:x:110:116::/var/lib/tpm:/bin/false
EOF
else
    echo "/etc/passwd post-debootstrap hash doesn't match record" >&2
    echo "The output below might help to resolve the issue" >&2
    cat /etc/passwd
    echo "passwd md5sum: $passwd_hash" >&2
    ERRCNT=1
fi

# /etc/shadow
if [ "$shadow_bootstrap" = "$shadow_hash" ]; then
    cat > /etc/shadow <<EOF
root:*:16329:0:99999:7:::
daemon:*:16329:0:99999:7:::
bin:*:16329:0:99999:7:::
sys:*:16329:0:99999:7:::
sync:*:16329:0:99999:7:::
games:*:16329:0:99999:7:::
man:*:16329:0:99999:7:::
lp:*:16329:0:99999:7:::
mail:*:16329:0:99999:7:::
news:*:16329:0:99999:7:::
uucp:*:16329:0:99999:7:::
proxy:*:16329:0:99999:7:::
www-data:*:16329:0:99999:7:::
backup:*:16329:0:99999:7:::
list:*:16329:0:99999:7:::
irc:*:16329:0:99999:7:::
gnats:*:16329:0:99999:7:::
nobody:*:16329:0:99999:7:::
messagebus:*:16413:0:99999:7:::
snappypkg:*:16413:0:99999:7:::
sshd:*:16413:0:99999:7:::
systemd-timesync:*:16413:0:99999:7:::
systemd-network:*:16413:0:99999:7:::
systemd-resolve:*:16413:0:99999:7:::
systemd-bus-proxy:*:16413:0:99999:7:::
_apt:*:16780:0:99999:7:::
docker:*:16413:0:99999:7:::
syslog:*:16521:0:99999:7:::
dnsmasq:*:16644:0:99999:7:::
tss:*:16701:0:99999:7:::
EOF
else
    echo "/etc/shadow post-debootstrap hash doesn't match record" >&2
    echo "The output below might help to resolve the issue" >&2
    cat /etc/shadow
    echo "shadow md5sum: $shadow_hash" >&2
    ERRCNT=1
fi

# /etc/group
if [ "$group_bootstrap" = "$group_hash" ]; then
    cat > /etc/group <<EOF
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:syslog
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:
fax:x:21:
voice:x:22:
cdrom:x:24:
floppy:x:25:
tape:x:26:
sudo:x:27:ubuntu
audio:x:1005:
dip:x:30:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
netdev:x:101:
crontab:x:102:
messagebus:x:103:
snappypkg:x:104:
ssh:x:105:
systemd-journal:x:106:
systemd-timesync:x:108:
systemd-network:x:109:
systemd-resolve:x:110:
systemd-bus-proxy:x:111:
docker:x:113:ubuntu
syslog:x:114:
pkcs11:x:115:root
tss:x:116:
input:x:107:
EOF
else
    echo "/etc/group post-debootstrap hash doesn't match record" >&2
    echo "The output below might help to resolve the issue" >&2
    cat /etc/group
    echo "group md5sum: $group_hash" >&2
    ERRCNT=1
fi

# /etc/gshadow
if [ "$gshadow_bootstrap" = "$gshadow_hash" ]; then
    cat > /etc/gshadow <<EOF
root:*::
daemon:*::
bin:*::
sys:*::
adm:*::syslog
tty:*::
disk:*::
lp:*::
mail:*::
news:*::
uucp:*::
man:*::
proxy:*::
kmem:*::
dialout:*::
fax:*::
voice:*::
cdrom:*::
floppy:*::
tape:*::
sudo:*::ubuntu
audio:*::pulse
dip:*::
www-data:*::
backup:*::
operator:*::
list:*::
irc:*::
src:*::
gnats:*::
shadow:*::
utmp:*::
video:*::
sasl:*::
plugdev:*::
staff:*::
games:*::
users:*::
nogroup:*::
netdev:!::
crontab:!::
messagebus:!::
snappypkg:!::
ssh:!::
systemd-journal:!::
systemd-timesync:!::
systemd-network:!::
systemd-resolve:!::
systemd-bus-proxy:!::
docker:!::ubuntu
syslog:!::
pkcs11:!::root
tss:!::
input:!::
EOF
else
    echo "/etc/gshadow post-debootstrap hash doesn't match record" >&2
    echo "The output below might help to resolve the issue" >&2
    cat /etc/gshadow
    echo "gshadow md5sum: $gshadow_hash" >&2
    ERRCNT=1
fi

if [ -n "$ERRCNT" ]; then
        echo "There were changes to the password database," >&2
        echo "please adjust the values in the livecd-rootfs source in the file:" >&2
        echo "live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early" >&2
        echo >&2
        echo "Please check also if a maintainer script of the package" >&2
        echo "that added these entries perhaps created a home directory and," >&2
        echo "if needed, add code for creation of it to the above hook" >&2
        exit 1
fi


# Record the current state for later comparison
for file in /etc/passwd /etc/shadow /etc/group /etc/gshadow; do
    rm -f ${file}-
    cp ${file} ${file}.orig
done