crash-manager: Set primary group 01/252801/1
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 2 Feb 2021 09:00:59 +0000 (10:00 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 2 Feb 2021 09:56:09 +0000 (09:56 +0000)
Previously only supplementary groups were set, leaving main gid to
be 'root'.

Change-Id: I50494ca40192c985d07cf07827c4f44c4f99b1d7

src/crash-manager/main.c

index 6af466e..0860b0b 100644 (file)
@@ -255,6 +255,11 @@ static bool drop_privileges(const char *user_name)
        if (!set_groups(user_name, user_info.pw_gid))
                goto exit;
 
+       if (setgid(user_info.pw_gid) == -1) {
+               _E("setgid() error: %m\n");
+               goto exit;
+       }
+
        if (setuid(user_info.pw_uid) == -1) {
                _E("setuid() error: %m\n");
                goto exit;