commit f23611f2942ea1070aacdb1395f538d5062616c2
Author: Sam Spilsbury <sam@endlessm.com>
Date:   Thu Aug 10 11:03:10 2017 +0800

    common: Also set GROUP in scripts

diff --git a/common/gdm-common.c b/common/gdm-common.c
index 31fc810a..9261bec5 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -26,6 +26,7 @@
 #include <locale.h>
 #include <fcntl.h>
 #include <sys/wait.h>
+#include <grp.h>
 #include <pwd.h>
 
 #include <glib.h>
@@ -586,6 +587,13 @@ gdm_get_script_environment (const char *username,
 
                         g_hash_table_insert (hash, g_strdup ("SHELL"),
                                              g_strdup (pwent->pw_shell));
+
+                        /* Also get group name and propagate down */
+                        struct group *grent = getgrgid (pwent->pw_gid);
+
+                        if (grent) {
+                                g_hash_table_insert (hash, g_strdup ("GROUP"), g_strdup (grent->gr_name));
+                        }
                 }
         }
 
