Skip to content

Commit

Permalink
MGM: foward trace and onbehalf fields into virtual identities
Browse files Browse the repository at this point in the history
COMMON: print trace an onbehalf fields in each log line as xt='' ob='' (extern trace, on behalf) - fixes EOS-6182
  • Loading branch information
apeters1971 committed Feb 6, 2025
1 parent 6662fdc commit c646e43
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/Logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,8 @@ Logging::log(const char* func, const char* file, int line, const char* logid,
sourceline);
}
} else {
sprintf(fcident, "tident=%s sec=%-5s uid=%d gid=%d name=%s geo=\"%s\"", cident,
vid.prot.c_str(), vid.uid, vid.gid, truncname.c_str(), vid.geolocation.c_str());
sprintf(fcident, "tident=%s sec=%-5s uid=%d gid=%d name=%s geo=\"%s\" xt=\"%s\" ob=\"%s\"", cident,
vid.prot.c_str(), vid.uid, vid.gid, truncname.c_str(), vid.geolocation.c_str(), vid.trace.c_str(), vid.onbehalf.c_str());
localtime_r(&current_time, &tm);
snprintf(sourceline, sizeof(sourceline) - 1, "%s:%s", File.c_str(), linen);
sprintf(buffer,
Expand Down
8 changes: 8 additions & 0 deletions mgm/grpc/GrpcNsInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ GrpcNsInterface::Stat(eos::common::VirtualIdentity& ivid,
vid = eos::common::Mapping::Someone(request->role().uid(),
request->role().gid());
vid.app = request->role().app();
vid.trace = request->role().trace();
vid.onbehalf = request->role().onbehalf();
}
}

Expand All @@ -773,6 +775,8 @@ GrpcNsInterface::StreamMD(eos::common::VirtualIdentity& ivid,
vid = eos::common::Mapping::Someone(request->role().uid(),
request->role().gid());
vid.app = request->role().app();
vid.trace = request->role().trace();
vid.onbehalf = request->role().onbehalf();
}
}
} else {
Expand Down Expand Up @@ -914,6 +918,8 @@ GrpcNsInterface::Find(eos::common::VirtualIdentity& ivid,
vid = eos::common::Mapping::Someone(request->role().uid(),
request->role().gid());
vid.app = request->role().app();
vid.trace = request->role().trace();
vid.onbehalf = request->role().onbehalf();
}
}
} else {
Expand Down Expand Up @@ -1350,6 +1356,8 @@ GrpcNsInterface::Exec(eos::common::VirtualIdentity& ivid,
vid = eos::common::Mapping::Someone(request->role().uid(),
request->role().gid());
vid.app = request->role().app();
vid.trace = request->role().trace();
vid.onbehalf = request->role().onbehalf();
}
}
} else {
Expand Down

0 comments on commit c646e43

Please sign in to comment.