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>
Tue, 15 Sep 2020 20:23:50 +0000 (16:23 -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 7006a21581ea91f952c7d7dbe57a1095d467979e..2a20e5a8c4ab4cca1557ca917cfa2de02defd905 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.037451 seconds and 4 git commands to generate.