aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-06-15 00:37:11 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-06-21 15:32:43 +0200
commit92a22fef93a528030669e357a32c19f143a2d3b5 (patch)
tree37d5ff28d073c0c68601a45e8f540f9da3d7d8b3 /conf.c
parentc1140df889aeb90f944c1caabdf6f73522dbb250 (diff)
downloadpasst-92a22fef93a528030669e357a32c19f143a2d3b5.tar
passt-92a22fef93a528030669e357a32c19f143a2d3b5.tar.gz
passt-92a22fef93a528030669e357a32c19f143a2d3b5.tar.bz2
passt-92a22fef93a528030669e357a32c19f143a2d3b5.tar.lz
passt-92a22fef93a528030669e357a32c19f143a2d3b5.tar.xz
passt-92a22fef93a528030669e357a32c19f143a2d3b5.tar.zst
passt-92a22fef93a528030669e357a32c19f143a2d3b5.zip
treewide: Replace perror() calls with calls to logging functions
perror() prints directly to standard error, but in many cases standard error might be already closed, or we might want to skip logging, based on configuration. Our logging functions provide all that. While at it, make errors more descriptive, replacing some of the existing basic perror-style messages. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/conf.c b/conf.c
index 57c41e7..1d1f9a1 100644
--- a/conf.c
+++ b/conf.c
@@ -1093,10 +1093,8 @@ static void conf_ugid(char *runas, uid_t *uid, gid_t *gid)
const struct passwd *pw;
/* cppcheck-suppress getpwnamCalled */
pw = getpwnam("nobody");
- if (!pw) {
- perror("getpwnam");
- exit(EXIT_FAILURE);
- }
+ if (!pw)
+ die_perror("Can't get password file entry for nobody");
*uid = pw->pw_uid;
*gid = pw->pw_gid;