[SERVER-12807] Debian package will fail to create mongodb user if another user exists with the word "mongodb" as part of its name Created: 20/Feb/14  Updated: 05/Dec/22  Resolved: 16/Nov/22

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: None
Fix Version/s: 4.1 Desired

Type: Bug Priority: Major - P3
Reporter: Timothy Olsen (Inactive) Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Do Votes: 0
Labels: sdp-backlog-purge
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Operating System: ALL
Participants:

 Description   

The postinst script for mongodb 2.4.9 has the following:

case "$1" in
    configure)
        # 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

grep -q mongodb will succeed if any user exists that has "mongodb" as part of its name. In regex parlance, the grep is not anchored.

In particular, if the mongodb-mms-backup-agent package is installed first, it will create a mongodb-mms-agent user. Then if mongodb is installed after, it will fail to create a mongodb user as grep -q mongodb will match on mongodb-mms-agent.

You might consider running /usr/bin/id mongodb >/dev/null 2>&1 and checking the return code.



 Comments   
Comment by Iryna Zhuravlova [ 16/Nov/22 ]

After a careful backlog refinement, the team decided to close this ticket because of its low priority and limited resource capacity. If you believe that this ticket requires additional attention from the team and should be re-opened, feel free to change the status to "Needs Scheduling" and ping me or @alexander.neben

Generated at Thu Feb 08 03:29:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.