-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.9
-
Component/s: Packaging
-
None
-
Fully Compatible
-
Linux
-
The mongodb-10gen.postinst script in the mongodb-10gen debian/package package contains an insufficient check whether the user "mongodb" exists.
From the mongodb-10gen.postinst file
[...]
- create a mongodb group and user
if ! grep -q mongodb /etc/passwd; then
adduser --system --no-create-home mongodb
addgroup --system mongodb
adduser mongodb mongodb
fi
[...]
This is insufficient for the following reasons:
1. The grep matches 'mongodb' anywhere in the passwd file instead of looking for an exact match in the password field.
2. The passwd is not the only place where UNIX user accounts exist, use any nss module (nss-ldap, ...) and the postinst will never notice. The proper way to check is using 'getent passwd mongodb' (grep for passwd in any /var/lib/dpkg/info/*.postinst file and look what everybody else does).
- duplicates
-
SERVER-7883 debian install fails if mongodb user already exists
- Closed