Back to index

lightdm  1.3.2
Classes | Defines | Typedefs | Functions
greeter.h File Reference
#include "session.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Greeter
struct  GreeterClass

Defines

#define GREETER_TYPE   (greeter_get_type())
#define GREETER(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE, Greeter))

Typedefs

typedef struct GreeterPrivate

Functions

GType greeter_get_type (void)
Greetergreeter_new (Session *session, const gchar *pam_service)
void greeter_set_allow_guest (Greeter *greeter, gboolean allow_guest)
void greeter_set_hint (Greeter *greeter, const gchar *name, const gchar *value)
gboolean greeter_get_guest_authenticated (Greeter *greeter)
Sessiongreeter_get_authentication_session (Greeter *greeter)
gboolean greeter_get_start_session (Greeter *greeter)
gboolean greeter_start (Greeter *greeter, const gchar *service, const gchar *username)

Class Documentation

struct Greeter

Definition at line 24 of file greeter.h.

Collaboration diagram for Greeter:
Class Members
GObject parent_instance
GreeterPrivate * priv

Define Documentation

#define GREETER (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE, Greeter))

Definition at line 20 of file greeter.h.

#define GREETER_TYPE   (greeter_get_type())

Definition at line 19 of file greeter.h.


Typedef Documentation

typedef struct GreeterPrivate

Definition at line 22 of file greeter.h.


Function Documentation

Definition at line 612 of file greeter.c.

{
    g_return_val_if_fail (greeter != NULL, NULL);
    return greeter->priv->authentication_session;
}

Here is the caller graph for this function:

gboolean greeter_get_guest_authenticated ( Greeter greeter)

Definition at line 605 of file greeter.c.

{
    g_return_val_if_fail (greeter != NULL, FALSE);
    return greeter->priv->guest_account_authenticated;
}

Here is the caller graph for this function:

gboolean greeter_get_start_session ( Greeter greeter)

Definition at line 619 of file greeter.c.

{
    g_return_val_if_fail (greeter != NULL, FALSE);
    return greeter->priv->start_session;
}

Here is the caller graph for this function:

GType greeter_get_type ( void  )
Greeter* greeter_new ( Session session,
const gchar *  pam_service 
)

Definition at line 94 of file greeter.c.

{
    Greeter *greeter;

    greeter = g_object_new (GREETER_TYPE, NULL);
    greeter->priv->session = g_object_ref (session);
    greeter->priv->pam_service = g_strdup (pam_service);

    return greeter;
}

Here is the caller graph for this function:

void greeter_set_allow_guest ( Greeter greeter,
gboolean  allow_guest 
)

Definition at line 106 of file greeter.c.

{
    greeter->priv->allow_guest = allow_guest;
}

Here is the caller graph for this function:

void greeter_set_hint ( Greeter greeter,
const gchar *  name,
const gchar *  value 
)

Definition at line 112 of file greeter.c.

{
    g_hash_table_insert (greeter->priv->hints, g_strdup (name), g_strdup (value));
}

Here is the caller graph for this function:

gboolean greeter_start ( Greeter greeter,
const gchar *  service,
const gchar *  username 
)

Definition at line 626 of file greeter.c.

{
    int to_greeter_pipe[2], from_greeter_pipe[2];
    gboolean result = FALSE;
    gchar *value;

    /* Create a pipe to talk with the greeter */
    if (pipe (to_greeter_pipe) != 0 || pipe (from_greeter_pipe) != 0)
    {
        g_warning ("Failed to create pipes: %s", strerror (errno));
        return FALSE;
    }
    greeter->priv->to_greeter_channel = g_io_channel_unix_new (to_greeter_pipe[1]);
    g_io_channel_set_encoding (greeter->priv->to_greeter_channel, NULL, NULL);
    greeter->priv->from_greeter_channel = g_io_channel_unix_new (from_greeter_pipe[0]);
    g_io_channel_set_encoding (greeter->priv->from_greeter_channel, NULL, NULL);
    g_io_channel_set_buffered (greeter->priv->from_greeter_channel, FALSE);
    g_io_add_watch (greeter->priv->from_greeter_channel, G_IO_IN | G_IO_HUP, read_cb, greeter);

    /* Let the greeter session know how to communicate with the daemon */
    value = g_strdup_printf ("%d", from_greeter_pipe[1]);
    session_set_env (greeter->priv->session, "LIGHTDM_TO_SERVER_FD", value);
    g_free (value);
    value = g_strdup_printf ("%d", to_greeter_pipe[0]);
    session_set_env (greeter->priv->session, "LIGHTDM_FROM_SERVER_FD", value);
    g_free (value);

    /* Don't allow the daemon end of the pipes to be accessed in child processes */
    fcntl (to_greeter_pipe[1], F_SETFD, FD_CLOEXEC);
    fcntl (from_greeter_pipe[0], F_SETFD, FD_CLOEXEC);

    result = session_start (greeter->priv->session, service, username, FALSE, FALSE);

    /* Close the session ends of the pipe */
    close (to_greeter_pipe[0]);
    close (from_greeter_pipe[1]);

    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function: