Skip to content

Commit c309461

Browse files
committed
Log that it's xrootd-multiuser denying access, not the file system
Since the various operations just return -EACCES when xrootd-multiuser couldn't change users (or groups), it's confusing whether access is denied by the file system, or by xrootd-multiuser itself. Make it explicit via a log message.
1 parent 4851e96 commit c309461

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/UserSentry.hh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,21 @@ public:
153153
if (result == nullptr) {
154154
if (retval) { // There's an actual error in the lookup.
155155
m_log.Emsg("UserSentry", "Failure when looking up UID for username", username.c_str(), strerror(retval));
156+
m_log.Emsg("UserSentry", "Multiuser denying access");
156157
} else { // Username doesn't exist.
157158
m_log.Emsg("UserSentry", "XRootD mapped request to username that does not exist:", username.c_str());
159+
m_log.Emsg("UserSentry", "Multiuser denying access");
158160
}
159161
return;
160162
}
161163
if (pwd.pw_uid < g_minimum_uid) {
162164
m_log.Emsg("UserSentry", "Username", username.c_str(), "maps to a system UID; rejecting lookup");
165+
m_log.Emsg("UserSentry", "Multiuser denying access");
163166
return;
164167
}
165168
if (pwd.pw_gid < g_minimum_gid) {
166169
m_log.Emsg("UserSentry", "Username", username.c_str(), "maps to a system GID; rejecting lookup");
170+
m_log.Emsg("UserSentry", "Multiuser denying access");
167171
return;
168172
}
169173

@@ -182,6 +186,7 @@ public:
182186
} while (1);
183187
if (-1 == retval) {
184188
m_log.Emsg("UserSentry", "Failure when looking up supplementary groups for username", username.c_str());
189+
m_log.Emsg("UserSentry", "Multiuser denying access");
185190
return;
186191
}
187192

@@ -193,6 +198,7 @@ public:
193198
m_orig_uid = setfsuid(result->pw_uid);
194199
if (m_orig_uid < 0) {
195200
m_log.Emsg("UserSentry", "Failed to switch FS uid for user", username.c_str());
201+
m_log.Emsg("UserSentry", "Multiuser denying access");
196202
return;
197203
}
198204
m_orig_gid = setfsgid(result->pw_gid);

0 commit comments

Comments
 (0)