components/gnome/gdm/patches/0006-etc-default-login.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 31 Oct 2016 18:25:15 -0700
changeset 7201 bcc18175756d
permissions -rw-r--r--
23245293 Move gdm to Userland and update to 3.18.2 PSARC/2016/448 GNOME Display Manager (GDM) v3.18 23245463 Move desktop-startup 0.38.0 to Userland 16882229 Desktop packages should remove restart_fmri=svc:/system/rbac:default 21020801 Add "RO" to res1 field of auth_attr.d files in gdm 21020166 html help files in gdm for RBAC profiles and authorizations must go 22134482 svc:/application/graphical-login/gdm goes into maintenance when gdm coredumps
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7201
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     1
From 0ccf6e6afa7eb6f5dc8b8c6689caa8bb190fef0d Mon Sep 17 00:00:00 2001
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     2
From: Alan Coopersmith <[email protected]>
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     3
Date: Tue, 29 Dec 2015 14:21:38 -0800
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     4
Subject: [PATCH 06/19] /etc/default/login
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     5
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     6
Add support for /etc/default/login configuration.
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     7
Original date:2009-03-31 owner:yippi type:feature
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     8
---
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     9
 daemon/gdm-session-worker.c | 83 +++++++++++++++++++++++++++++++++++++++++----
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    10
 1 file changed, 76 insertions(+), 7 deletions(-)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    11
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    12
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    13
index 93c9e82..5fc83d6 100644
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    14
--- a/daemon/gdm-session-worker.c
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    15
+++ b/daemon/gdm-session-worker.c
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    16
@@ -222,6 +222,33 @@ G_DEFINE_TYPE_WITH_CODE (GdmSessionWorker,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    17
                          G_IMPLEMENT_INTERFACE (GDM_DBUS_TYPE_WORKER,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    18
                                                 worker_interface_init))
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    19
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    20
+#if __sun
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    21
+#include <deflt.h>
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    22
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    23
+/*
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    24
+ * gdm_read_default
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    25
+ *
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    26
+ * This function is used to support systems that have the /etc/default/login
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    27
+ * interface to control programs that affect security.  This is a Solaris
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    28
+ * thing, though some users on other systems may find it useful.
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    29
+ */
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    30
+static gchar *
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    31
+gdm_read_default (gchar *key)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    32
+{
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    33
+    gchar *retval = NULL;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    34
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    35
+    if (defopen ("/etc/default/login") == 0) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    36
+       int flags = defcntl (DC_GETFLAGS, 0);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    37
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    38
+       TURNOFF (flags, DC_CASE);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    39
+       (void) defcntl (DC_SETFLAGS, flags);  /* ignore case */
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    40
+       retval = g_strdup (defread (key));
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    41
+       (void) defopen ((char *)NULL);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    42
+    }
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    43
+    return retval;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    44
+}
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    45
+#endif
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    46
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    47
 #ifdef WITH_CONSOLE_KIT
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    48
 static gboolean
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    49
 open_ck_session (GdmSessionWorker  *worker)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    50
@@ -1351,6 +1378,28 @@ gdm_session_worker_authorize_user (GdmSessionWorker *worker,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    51
         g_debug ("GdmSessionWorker: determining if authenticated user (password required:%d) is authorized to session",
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    52
                  password_is_required);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    53
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    54
+#ifdef __sun
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    55
+        char *consoleonly = gdm_read_default ("CONSOLE=");
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    56
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    57
+        if ((consoleonly != NULL) &&
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    58
+            (strcmp (consoleonly, "/dev/console") == 0)) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    59
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    60
+                if (worker->priv->hostname != NULL &&
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    61
+                    worker->priv->hostname[0] != '\0') {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    62
+                        struct passwd *passwd_entry;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    63
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    64
+                        passwd_entry = getpwnam (worker->priv->username);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    65
+                        if (passwd_entry->pw_uid == 0) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    66
+                                error_code = PAM_PERM_DENIED;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    67
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    68
+                                g_debug ("The system administrator is not allowed to log in remotely");
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    69
+                                g_set_error (error, GDM_SESSION_WORKER_ERROR, GDM_SESSION_WORKER_ERROR_AUTHORIZING, "%s", pam_strerror (worker->priv->pam_handle, error_code));
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    70
+                                goto out;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    71
+                        }
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    72
+                }
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    73
+        }
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    74
+#endif
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    75
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    76
         authentication_flags = 0;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    77
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    78
         if (password_is_required) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    79
@@ -1716,6 +1765,7 @@ gdm_session_worker_accredit_user (GdmSessionWorker  *worker,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    80
         gid_t    gid;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    81
         char    *shell;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    82
         char    *home;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    83
+        char    *path_str;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    84
         int      error_code;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    85
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    86
         ret = FALSE;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    87
@@ -1756,18 +1806,26 @@ gdm_session_worker_accredit_user (GdmSessionWorker  *worker,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    88
                                                                 home,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    89
                                                                 shell);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    90
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    91
-        /* Let's give the user a default PATH if he doesn't already have one
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    92
-         */
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    93
-        if (!gdm_session_worker_environment_variable_is_set (worker, "PATH")) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    94
+        path_str = NULL;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    95
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    96
+#ifdef __sun
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    97
+        if (uid == 0)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    98
+                path_str = gdm_read_default ("SUPATH=");
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    99
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   100
+        if (path_str == NULL)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   101
+                path_str = gdm_read_default ("PATH=");
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   102
+#endif
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   103
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   104
+        if (path_str == NULL)  {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   105
                 if (strcmp (BINDIR, "/usr/bin") == 0) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   106
-                        gdm_session_worker_set_environment_variable (worker, "PATH",
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   107
-                                                                     GDM_SESSION_DEFAULT_PATH);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   108
+                        path_str = GDM_SESSION_DEFAULT_PATH;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   109
                 } else {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   110
-                        gdm_session_worker_set_environment_variable (worker, "PATH",
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   111
-                                                                     BINDIR ":" GDM_SESSION_DEFAULT_PATH);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   112
+                        path_str = BINDIR ":" GDM_SESSION_DEFAULT_PATH;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   113
                 }
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   114
         }
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   115
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   116
+        gdm_session_worker_set_environment_variable (worker, "PATH", path_str);
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   117
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   118
         if (! _change_user (worker, uid, gid)) {
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   119
                 g_debug ("GdmSessionWorker: Unable to change to user");
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   120
                 error_code = PAM_SYSTEM_ERR;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   121
@@ -2768,6 +2826,17 @@ do_setup (GdmSessionWorker *worker)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   122
         GError  *error;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   123
         gboolean res;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   124
 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   125
+#ifdef __sun
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   126
+        char    *passreq;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   127
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   128
+        passreq = gdm_read_default ("PASSREQ=");
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   129
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   130
+        if ((passreq != NULL) && g_ascii_strcasecmp (passreq, "YES") == 0)
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   131
+                worker->priv->password_is_required = TRUE;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   132
+        else
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   133
+                worker->priv->password_is_required = FALSE;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   134
+#endif
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   135
+
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   136
         error = NULL;
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   137
         res = gdm_session_worker_initialize_pam (worker,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   138
                                                  worker->priv->service,
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   139
-- 
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   140
2.7.4
bcc18175756d 23245293 Move gdm to Userland and update to 3.18.2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
   141