patches/gdm-03-sdtlogin.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 20009 c535eef4db66
child 21963 fe0b85ec18a6
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17046
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
     1
commit c7a1ad4850e394260cb61582aeefae8f95c3cae8
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
     2
Author: Halton Huo <[email protected]>
17046
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
     3
Date:   Fri Nov 27 22:01:20 2009 +0800
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
     4
17046
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
     5
    gdm-02-sdtlogin.diff
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
     6
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     7
diff --git a/common/gdm-common.h b/common/gdm-common.h
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
     8
index 191bd70..634c091 100644
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     9
--- a/common/gdm-common.h
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    10
+++ b/common/gdm-common.h
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    11
@@ -25,6 +25,11 @@
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    12
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    13
 #include "gdm-common-unknown-origin.h"
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    14
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    15
+#ifdef __sun
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    16
+#define GDM_DT_DIR "/var/dt"
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    17
+#define GDM_SDTLOGIN_DIR "/var/dt/sdtlogin"
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    18
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    19
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    20
 G_BEGIN_DECLS
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    21
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    22
 gboolean       gdm_is_version_unstable            (void);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    23
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
17046
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    24
index 757ef62..7012811 100644
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    25
--- a/daemon/gdm-server.c
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    26
+++ b/daemon/gdm-server.c
17046
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    27
@@ -646,6 +646,13 @@ gdm_server_spawn (GdmServer  *server,
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    28
                         count ++;
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    29
                 }
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    30
                 g_free (socket_file);
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    31
+#if __sun
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    32
+                /* Remove old communication pipe, if present */
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    33
+                char *old_pipe;
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    34
+                old_pipe = g_strdup_printf ("%s/%d", GDM_SDTLOGIN_DIR, display_num);
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    35
+                g_unlink (old_pipe);
bd28dae03d8a 2009-11-27 Halton Huo <[email protected]>
halton
parents: 16844
diff changeset
    36
+                g_free (old_pipe);
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    37
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    38
         }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    39
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    40
         env = get_server_environment (server);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    41
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
    42
index 2ab53a0..8970297 100644
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    43
--- a/daemon/gdm-session-worker.c
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    44
+++ b/daemon/gdm-session-worker.c
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    45
@@ -36,6 +36,13 @@
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    46
 #include <libdevinfo.h>
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
 #endif  /* HAVE_LOGINDEVPERM */
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    49
+#if __sun
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
+#include <sys/param.h>
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    51
+#define GDM_PAM_QUAL
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    52
+#else
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    53
+#define GDM_PAM_QUAL const
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    55
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    56
 #include <security/pam_appl.h>
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    57
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    58
 #include <glib.h>
20009
c535eef4db66 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 17046
diff changeset
    59
@@ -65,6 +72,7 @@
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    60
 #endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    61
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    62
 #include "gdm-session-settings.h"
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    63
+#include "gdm-common.h"
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    64
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    65
 #define GDM_SESSION_WORKER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SESSION_WORKER, GdmSessionWorkerPrivate))
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    66
 
20009
c535eef4db66 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 17046
diff changeset
    67
@@ -155,12 +163,115 @@ static void     gdm_session_worker_final
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    68
 static void     queue_state_change              (GdmSessionWorker      *worker);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    69
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    70
 typedef int (* GdmSessionWorkerPamNewMessagesFunc) (int,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    71
-                                                    const struct pam_message **,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    72
+                                                    GDM_PAM_QUAL struct pam_message **,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    73
                                                     struct pam_response **,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    74
                                                     gpointer);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    75
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    76
 G_DEFINE_TYPE (GdmSessionWorker, gdm_session_worker, G_TYPE_OBJECT)
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    77
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    78
+#ifdef __sun
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    79
+void
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    80
+solaris_xserver_cred (char * username, struct passwd *passwd_entry, const char *x11_display_name)
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    81
+{
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    82
+        struct stat statbuf;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    83
+        struct group *gr;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    84
+        gid_t  groups[NGROUPS_UMAX];
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    85
+        char *home, *disp, *tmp, *p, pipe[MAXPATHLEN], info[MAXPATHLEN];
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    86
+        int display_number = 0;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    87
+        int retval, fd, i, nb;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    88
+        int ngroups;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    89
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    90
+        if (g_access (passwd_entry->pw_dir, F_OK) != 0) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    91
+                g_debug ("solaris_xserver_cred: no HOME dir access\n");
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    92
+                return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    93
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    94
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    95
+        /*
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    96
+         * Handshake with server. Make sure it created a pipe.
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    97
+         * Open and write.
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    98
+         */
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    99
+        if ((tmp = strstr (x11_display_name, ":")) != NULL) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   100
+                tmp++;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   101
+                display_number = g_ascii_strtod (tmp, &p);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   102
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   103
+                if (errno != 0) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   104
+                        g_debug ("solaris_xserver_cred: problem getting display number\n");
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   105
+                        return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   106
+                }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   107
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   108
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   109
+        sprintf (pipe, "%s/%d", GDM_SDTLOGIN_DIR, display_number);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   110
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   111
+        if (g_stat (GDM_SDTLOGIN_DIR, &statbuf) == 0) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   112
+                if (! statbuf.st_mode & S_IFDIR) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   113
+                        g_debug ("solaris_xserver_cred: %s is not a directory\n",
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   114
+                                 GDM_SDTLOGIN_DIR);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   115
+                        return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   116
+                }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   117
+        } else {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   118
+                g_debug ("solaris_xserver_cred: %s does not exist\n", GDM_SDTLOGIN_DIR);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   119
+                return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   120
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   121
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   122
+        fd = open (pipe, O_RDWR);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   123
+        g_unlink (pipe);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   124
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   125
+        if (fd < 0) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   126
+                g_debug ("solaris_xserver_cred: could not open %s\n", pipe);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   127
+                return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   128
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   129
+        if (fstat (fd, &statbuf) == 0 ) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   130
+                if ( ! statbuf.st_mode & S_IFIFO) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   131
+                        close (fd);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   132
+                        g_debug ("solaris_xserver_cred: %s is not a pipe\n", pipe);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   133
+                        return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   134
+                }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   135
+        } else {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   136
+                close (fd);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   137
+                g_debug ("solaris_xserver_cred: %s does not exist\n", pipe);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   138
+                return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   139
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   140
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   141
+        sprintf (info, "GID=\"%d\"; ", passwd_entry->pw_gid);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   142
+        nb = write (fd, info, strlen (info));
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   143
+        g_debug ("solaris_xserver_cred: %s\n", info);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   144
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   145
+        if (initgroups (username, passwd_entry->pw_gid) == -1) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   146
+                ngroups = 0;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   147
+        } else {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   148
+                ngroups = getgroups (NGROUPS_UMAX, groups);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   149
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   150
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   151
+        for (i=0; i < ngroups; i++) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   152
+                sprintf (info, "G_LIST_ID=\"%u\" ", groups[i]);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   153
+                nb = write (fd, info, strlen (info));
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   154
+                g_debug ("solaris_xserver_cred: %s\n", info);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   155
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   156
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   157
+        if (ngroups > 0) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   158
+                sprintf (info, ";");
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   159
+                write (fd, info, strlen (info));
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   160
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   161
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   162
+        sprintf (info, " HOME=\"%s\" ", passwd_entry->pw_dir);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   163
+        nb = write (fd, info, strlen (info));
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   164
+        g_debug ("solaris_xserver_cred: %s\n", info);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   165
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   166
+        sprintf (info, " UID=\"%d\" EOF=\"\";", passwd_entry->pw_uid);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   167
+        nb = write (fd, info, strlen (info));
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   168
+        g_debug ("solaris_xserver_cred: %s\n", info);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   169
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   170
+        /*
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   171
+         * Handshake with server. Make sure it read the pipe.
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   172
+         *
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   173
+         * Close file descriptor.
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   174
+         */
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   175
+        close (fd);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   176
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   177
+        return;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   178
+}
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   179
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   180
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   181
 GQuark
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   182
 gdm_session_worker_error_quark (void)
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   183
 {
20009
c535eef4db66 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 17046
diff changeset
   184
@@ -591,7 +702,11 @@ static gboolean
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   185
 gdm_session_worker_get_username (GdmSessionWorker  *worker,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   186
                                  char             **username)
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   187
 {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   188
+#ifdef __sun
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   189
+        gpointer item;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   190
+#else
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   191
         gconstpointer item;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   192
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   193
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   194
         g_assert (worker->priv->pam_handle != NULL);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   195
 
20009
c535eef4db66 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 17046
diff changeset
   196
@@ -865,7 +980,7 @@ gdm_session_worker_process_pam_message (
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   197
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   198
 static int
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   199
 gdm_session_worker_pam_new_messages_handler (int                        number_of_messages,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   200
-                                             const struct pam_message **messages,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   201
+                                             GDM_PAM_QUAL struct pam_message **messages,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   202
                                              struct pam_response      **responses,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   203
                                              GdmSessionWorker          *worker)
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   204
 {
20009
c535eef4db66 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 17046
diff changeset
   205
@@ -2016,6 +2131,11 @@ gdm_session_worker_start_user_session (G
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   206
 
20009
c535eef4db66 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 17046
diff changeset
   207
         gdm_get_pwent_for_name (worker->priv->username, &passwd_entry);
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   208
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   209
+#ifdef __sun
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   210
+        solaris_xserver_cred (worker->priv->username,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   211
+                              passwd_entry,
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   212
+                              worker->priv->x11_display_name);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   213
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   214
 #ifdef  HAVE_LOGINDEVPERM
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   215
         /*
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   216
          * Only do logindevperm processing if /dev/console or
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
   217
diff --git a/daemon/main.c b/daemon/main.c
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
   218
index 8577ba7..0f2a007 100644
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   219
--- a/daemon/main.c
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   220
+++ b/daemon/main.c
16844
5a55ad37c87d 2009-10-23 Halton Huo <[email protected]>
halton
parents: 16436
diff changeset
   221
@@ -525,6 +525,21 @@ main (int    argc,
16338
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   222
                 { NULL }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   223
         };
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   224
 
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   225
+#ifdef __sun
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   226
+        {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   227
+                struct stat statbuf;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   228
+                int r;
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   229
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   230
+                r = stat (GDM_DT_DIR, &statbuf);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   231
+                if (r < 0) {
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   232
+                        g_mkdir (GDM_DT_DIR, 0755);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   233
+                }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   234
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   235
+                g_remove (GDM_SDTLOGIN_DIR);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   236
+                g_mkdir (GDM_SDTLOGIN_DIR, 0700);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   237
+        }
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   238
+#endif
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   239
+
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   240
         bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   241
         textdomain (GETTEXT_PACKAGE);
7f746135863a 2009-08-24 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   242
         setlocale (LC_ALL, "");