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

Fix fallout of TOCTOU fixes for socket file non-default permissions #2195

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

jimklimov
Copy link
Member

Closes: #2185
Follows-up from: #2096

Sockets can not be open()ed to get a file descriptor for fchown(), fstat() and similar operations on many platforms tried. Filenames must be used, it seems (something TOCTOU warns against). If there are better ideas later - apply them. For now, try to be safe - but fall back to practical where needed.

@jimklimov jimklimov added bug service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug portability We want NUT to build and run everywhere possible impacts-release-2.8.1 Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks) labels Nov 20, 2023
@jimklimov jimklimov added this to the 2.8.2 milestone Nov 20, 2023
drivers/main.c Dismissed Show dismissed Hide dismissed
drivers/main.c Dismissed Show dismissed Hide dismissed
@jimklimov jimklimov merged commit f140867 into networkupstools:master Nov 21, 2023
5 of 6 checks passed
@jimklimov jimklimov deleted the issue-2185 branch November 21, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug impacts-release-2.8.1 Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks) portability We want NUT to build and run everywhere possible service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using fstat on socket file to fix ownership is not reliable
1 participant