summaryrefslogtreecommitdiff
path: root/password.c
diff options
context:
space:
mode:
authorSergey Zagursky <sz@joom.com>2026-07-09 09:23:43 +0100
committerKenny Levinsen <kl@kl.wtf>2026-07-09 11:58:43 +0200
commit83319e5ec7ae13794ebf39f753d643a2a439f594 (patch)
tree85a94513149a4666ee1001afa599f40c90feb9fb /password.c
parent1a4c472c11ee0354e5a689e33fad4ecce533ddc3 (diff)
main: fix reversed dup2 arguments in daemonize
daemonize() intends to redirect the daemon's stdout and stderr to /dev/null, but the dup2() arguments are reversed. dup2(oldfd, newfd) duplicates oldfd onto newfd; the code passes STDOUT_FILENO/STDERR_FILENO as oldfd and the freshly opened /dev/null descriptor as newfd, so it overwrites the /dev/null fd with stdout/stderr and then closes it. stdout and stderr are never redirected and stay attached to the controlling terminal. Swap the arguments so /dev/null is duplicated onto STDOUT_FILENO and STDERR_FILENO as intended.
Diffstat (limited to 'password.c')
0 files changed, 0 insertions, 0 deletions