Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pkg/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ USER_ID="cascade"

create_user() {
if id ${USER_ID} > /dev/null 2>&1; then return; fi
adduser --system --home /var/lib/${USER_ID} --group ${USER_ID}

# Newer versions of Debian/Ubuntu adduser use /nonexistent as the home
# directory by default, and don't actually create it. However, the version
# of Lintian in these older Debian/Ubuntu versions requires --home to be
# specified when calling adduser with --system so we explicitly set home
# to /nonexistent to prevent Lintian complaining in the newer O/S versions
# and to prevent adduser failing due to the missing argument/to have
# consistent behaviour in the case of the older O/S versions.
# See: https://lists.debian.org/debian-lint-maint/2025/08/msg00042.html
adduser --system --group ${USER_ID} --home /nonexistent --no-create-home
}

case "$1" in
Expand Down
3 changes: 2 additions & 1 deletion pkg/rpm/scriptlets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ if [ $1 -eq 1 ] ; then
if ! id ${USER_ID} > /dev/null 2>&1; then
# According to the CentOS 7 useradd man page:
# --user-group causes a group by the same name as the user to be created
useradd --system --user-group ${USER_ID} --home-dir /var/lib/${USER_ID} --create-home
# -M prevents the creation of a home directory for the user.
useradd --system --user-group ${USER_ID} -M
fi

mkdir -p /etc/cascade/policies
Expand Down
Loading