From c688bc0197940f47bd180e2c2ab9740e3e14b71c Mon Sep 17 00:00:00 2001 From: Vitaly Lipatov Date: Thu, 12 Jul 2018 22:02:18 +0300 Subject: add check if no matching password record was found with getpwuid_r(uid) Change-Id: Iae712828ee656008faf5fe2bc4e6f96fa12ea4cb fixes: bz#1600687 Signed-off-by: Vitaly Lipatov --- xlators/mount/fuse/src/fuse-helpers.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c index c2d4d0cc9d8..cb3e081e62e 100644 --- a/xlators/mount/fuse/src/fuse-helpers.c +++ b/xlators/mount/fuse/src/fuse-helpers.c @@ -174,6 +174,11 @@ frame_fill_groups (call_frame_t *frame) "failed", frame->root->uid); return; } + if (result == 0) { + gf_log (this->name, GF_LOG_ERROR, "getpwuid_r(%u): " + "no matching record", frame->root->uid); + return; + } ngroups = gf_getgrouplist (result->pw_name, frame->root->gid, &mygroups); -- cgit