Re: [gdm-list] Problem with audit code



Hi

On Feb 8, 2008 9:05 PM, Brian Cameron <Brian Cameron sun com> wrote:
>
> Ray:
>
> Sorry for the resend, but I send the previous email with the wrong
> subject line.
>
> I'm seeing a problem in the GDM audit code for Solaris.  I had to make
> the attached patch in order to prevent GDM from exiting on assert and
> never starting the login screen.  Note I added a simple call to
> return to avoid it failing on the g_return_if_fail line just below.
>
> I thought we were pretty sure that username should never be NULL by
> the time the report_login function is called.
RIght.  Looking at the code, there's definitely a bug. Fix is here:

--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -495,6 +495,8 @@ gdm_session_worker_update_username
(GdmSessionWorker *worker)
                          username != NULL ? username : "<unset>",
                          worker->priv->username != NULL ?
worker->priv->username : "<unset>");

+                gdm_session_auditor_set_username
(worker->priv->auditor, worker->priv->username);
+
                 if ((worker->priv->username == username) ||
                     ((worker->priv->username != NULL) && (username != NULL) &&
                      (strcmp (worker->priv->username, username) == 0)))
@@ -506,8 +508,6 @@ gdm_session_worker_update_username
(GdmSessionWorker *worker)
                 worker->priv->username = username;
                 username = NULL;

-                gdm_session_auditor_set_username
(worker->priv->auditor, worker->priv->username);
-
                 send_dbus_string_method (worker->priv->connection,
                                          "UsernameChanged",
                                          worker->priv->username);

We weren't reporting the username to the auditor in the case when it
was known at the beginning of the pam conversation (e.g., not the
Other... case) and it didn't change as part of the pam conversation.

I'll commit the above fix now.

--Ray


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]