@@ -240,12 +240,6 @@ scap_userinfo *sinsp_usergroup_manager::userinfo_map_insert(
240
240
std::string_view home,
241
241
std::string_view shell)
242
242
{
243
- if (!name.empty () && (name[0 ] == ' +' || name[0 ] == ' -' ))
244
- {
245
- // ignore NSS entries
246
- return nullptr ;
247
- }
248
-
249
243
auto &usr = map[uid];
250
244
usr.uid = uid;
251
245
usr.gid = gid;
@@ -263,12 +257,6 @@ scap_groupinfo *sinsp_usergroup_manager::groupinfo_map_insert(
263
257
uint32_t gid,
264
258
std::string_view name)
265
259
{
266
- if (!name.empty () && (name[0 ] == ' +' || name[0 ] == ' -' ))
267
- {
268
- // ignore NSS entries
269
- return nullptr ;
270
- }
271
-
272
260
auto &grp = map[gid];
273
261
grp.gid = gid;
274
262
strlcpy (grp.name , (name.data () != nullptr ) ? std::string (name).c_str () : " <NA>" , MAX_CREDENTIALS_STR_LEN);
@@ -278,6 +266,14 @@ scap_groupinfo *sinsp_usergroup_manager::groupinfo_map_insert(
278
266
279
267
scap_userinfo *sinsp_usergroup_manager::add_user (const std::string &container_id, int64_t pid, uint32_t uid, uint32_t gid, std::string_view name, std::string_view home, std::string_view shell, bool notify)
280
268
{
269
+ // ignore NSS entries
270
+ if (!name.empty () && (name[0 ] == ' +' || name[0 ] == ' -' ))
271
+ {
272
+ libsinsp_logger ()->format (sinsp_logger::SEV_DEBUG,
273
+ " NSS user ignored: %.*s" , static_cast <int >(name.length ()), name.data ());
274
+ return nullptr ;
275
+ }
276
+
281
277
if (!m_import_users)
282
278
{
283
279
m_fallback_user.uid = uid;
@@ -413,6 +409,14 @@ bool sinsp_usergroup_manager::rm_user(const string &container_id, uint32_t uid,
413
409
414
410
scap_groupinfo *sinsp_usergroup_manager::add_group (const string &container_id, int64_t pid, uint32_t gid, std::string_view name, bool notify)
415
411
{
412
+ // ignore NSS entries
413
+ if (!name.empty () && (name[0 ] == ' +' || name[0 ] == ' -' ))
414
+ {
415
+ libsinsp_logger ()->format (sinsp_logger::SEV_DEBUG,
416
+ " NSS group ignored: %.*s" , static_cast <int >(name.length ()), name.data ());
417
+ return nullptr ;
418
+ }
419
+
416
420
if (!m_import_users)
417
421
{
418
422
m_fallback_grp.gid = gid;
0 commit comments