You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rserver ownership pass: recognise session files by owner rather than by path shape #19537
rserver's startup ownership pass (ServerMain.cpp, serverDataDir.changeOwnership(serverUserObj, true, shouldChownServerDataFile)) chowns everything under server-data-dir to the server user, except for session files that shouldChownServerDataFile in ServerPaths.hpp recognises by position and suffix: depth 3 under a -ds directory, or depth 1 with a -d, -d.pid, -d.ctx or -d.lock suffix.
#19453 added -d.lock because the session claim lock is 0600 and a lock chowned to the server user makes open() fail on the next launch. That raises the stakes of the filter: before, a mistakenly chowned socket was harmless (mode 0666); now any session file the filter doesn't anticipate becomes a session that can't start after an rserver restart. Each new per-session file also needs its own suffix here.
Proposal
Consider a more general rule, e.g. never give a file that a non-root user already owns to the server user (stat the file in the filter and skip it when st_uid is neither 0 nor the server user). That would cover any future per-session file at any depth without changes here.
Trade-off to work out: today the pass also reassigns rserver's own files after an admin changes server-user; an owner-based rule would leave files owned by the previous server user alone. That may be fine (rserver recreates its sockets at startup), but it needs checking before switching rules.
Activity