Fix: PERROR spam when `tracing` group does not exist
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 15 Sep 2020 20:22:14 +0000 (16:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 15 Oct 2020 22:43:44 +0000 (18:43 -0400)
The session daemon prints a PERROR on launch when the tracing group does
not exist. This should not occur when the group simply does not exist as
this is not an error. In that case (ESRCH), a DBG statement is
sufficient.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3ade29071a8f4e9fe2eb56bf05ff4150b70fd463

src/common/utils.c

index 2f587bc7c49f11cfb03bdbbc59149c9994d9bd17..45aeddcf69cf8e9f431b51fade1d8a7016fc3ad6 100644 (file)
@@ -1274,8 +1274,14 @@ int utils_get_group_id(const char *name, bool warn, gid_t *gid)
                }
        }
        if (ret) {
-               PERROR("Failed to get group file entry for group name \"%s\"",
-                               name);
+               if (ret == ESRCH) {
+                       DBG("Could not find group file entry for group name '%s'",
+                                       name);
+               } else {
+                       PERROR("Failed to get group file entry for group name '%s'",
+                                       name);
+               }
+
                ret = -1;
                goto error;
        }
This page took 0.025688 seconds and 4 git commands to generate.