Skip to content

Conversation

@hkamphor
Copy link

When .chown_pid_file(true) is called with only one of the methods
.group("groupname") or .user("username"), the unset group or user is set to the highest possible gid or uid.

This patch uses the default for the unset user or group. The same behavior as when both were not set.
This results in a more predictable behavior in line with the rest of the code.

Example:

Original code: .chown_pid_file(true) without both .group and .user
629 -rw-r----- 1 root root 7 10 apr 15:26 /tmp/my-daemon.pid

Original code: .chown_pid_file(true) with only .user("nobody")
636 -rw-r----- 1 nobody 4294967294 7 10 apr 15:30 /tmp/my-daemon.pid

With patch: .chown_pid_file(true) with only .user("nobody")
645 -rw-r----- 1 nobody root 7 10 apr 15:32 /tmp/my-daemon.pid

.group("groupname") or .user("username"), use the default for the
unset user or group. The same behavior as when both were not set.
This results in a more predictable behavior in line with the rest
of the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant