Skip to content

Make minimum UID/GID configurable via multiuser.minuid/mingid#69

Open
djw8605 wants to merge 2 commits into
masterfrom
claude/xrootd-configurable-gids-ujuplb
Open

Make minimum UID/GID configurable via multiuser.minuid/mingid#69
djw8605 wants to merge 2 commits into
masterfrom
claude/xrootd-configurable-gids-ujuplb

Conversation

@djw8605

@djw8605 djw8605 commented Jul 12, 2026

Copy link
Copy Markdown
Member

The UID/GID thresholds below which a mapped username is rejected as a
system account were hard-coded to 500 (g_minimum_uid / g_minimum_gid).
Sites that mount shared file systems (e.g. Lustre) may have legitimate
groups with IDs below 500, which were being denied access.

Convert the thresholds to static members of UserSentry (single definition
with external linkage, mirroring m_is_cmsd) so a value set at config time
is seen across all translation units, and parse two new optional config
directives, multiuser.minuid and multiuser.mingid, in
MultiuserFileSystem::Config(). Both default to 500, preserving existing
behavior. The effective thresholds are logged at startup.

Closes #68

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UFwX4qfurnnEvbPtzL46ZL

The UID/GID thresholds below which a mapped username is rejected as a
system account were hard-coded to 500 (g_minimum_uid / g_minimum_gid).
Sites that mount shared file systems (e.g. Lustre) may have legitimate
groups with IDs below 500, which were being denied access.

Convert the thresholds to static members of UserSentry (single definition
with external linkage, mirroring m_is_cmsd) so a value set at config time
is seen across all translation units, and parse two new optional config
directives, multiuser.minuid and multiuser.mingid, in
MultiuserFileSystem::Config(). Both default to 500, preserving existing
behavior. The effective thresholds are logged at startup.

Closes #68

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UFwX4qfurnnEvbPtzL46ZL

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the minimum allowed UID/GID for mapped usernames configurable at runtime via new config directives, addressing sites where legitimate users/groups may have IDs below the previously hard-coded threshold (500).

Changes:

  • Replaces hard-coded g_minimum_uid/g_minimum_gid with UserSentry static members (single definition with external linkage).
  • Adds multiuser.minuid and multiuser.mingid parsing in MultiuserFileSystem::Config() and logs the effective thresholds at startup.
  • Documents the new directives in README.md and the example OSG config snippet.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/UserSentry.hh Introduces configurable min UID/GID thresholds and applies them during user lookup validation.
src/MultiuserFileSystem.cc Parses multiuser.minuid / multiuser.mingid from config and logs the configured thresholds.
src/multiuser.cpp Defines the new UserSentry static threshold members with defaults (500).
README.md Documents new optional configuration directives and provides an example.
configs/60-osg-multiuser.cfg Updates sample config comments to describe the new directives.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +88 to +93
if (id_val < 0) {
m_log.Emsg("Config", directive, "must not be negative");
return false;
}
out = static_cast<int>(id_val);
return true;
Comment thread src/UserSentry.hh Outdated
Comment on lines +174 to +178
if (static_cast<int>(pwd.pw_uid) < m_min_uid) {
m_log.Emsg("UserSentry", "Multiuser denying access: Username", username.c_str(), "maps to a system UID; rejecting lookup");
return;
}
if (pwd.pw_gid < g_minimum_gid) {
if (static_cast<int>(pwd.pw_gid) < m_min_gid) {
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.

Can we make g_minimum_uid and g_minimum_gid configurable ?

4 participants