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:44:07 +0000 (18:44 -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 5420490a76a40f1d66d504f46e545aaebba56f78..02eddfae4a0c93d044aaad23c75a436ce76bf4a3 100644 (file)
@@ -1278,8 +1278,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.025551 seconds and 4 git commands to generate.