Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upslog assumes starting as root, but should it? #1717

Open
jimklimov opened this issue Nov 25, 2022 · 0 comments · May be fixed by #2745
Open

upslog assumes starting as root, but should it? #1717

jimklimov opened this issue Nov 25, 2022 · 0 comments · May be fixed by #2745
Assignees
Labels
service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug
Milestone

Comments

@jimklimov
Copy link
Member

As analyzed in #1712 (comment) the upslog daemon is one of two that really use PIDPATH which may be owned by root (rather than ALTPIDPATH which should be owned by unprivileged run-time account like nut).

Code of this daemon writes the PID file and drops privileges, with mysterious comment /* now drop root if we have it */ -- this implies we might start not as root, and then fail to writepid() (if PIDPATH is root-owned like /var/run) and then to become_user(). It did so since beginning of time.

Should the logging daemon start as root in the first place however?..

@jimklimov jimklimov added the service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug label Nov 25, 2022
@jimklimov jimklimov added this to the NUT 2.9 milestone Nov 25, 2022
jimklimov added a commit to jimklimov/nut that referenced this issue Jan 2, 2025
… writepid() calls by non-root programs [networkupstools#1717]

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jan 2, 2025
… writepid() calls by non-root programs [networkupstools#1717]

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jan 2, 2025
… writepid() calls by non-root programs [networkupstools#1717]

Signed-off-by: Jim Klimov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug
Projects
None yet
4 participants