~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to src/pam-session.h

  • Committer: Robert Ancell
  • Date: 2014-03-13 02:15:38 UTC
  • Revision ID: robert.ancell@canonical.com-20140313021538-u2mxfxrrfw5u58ic
Tags: 1.4.7
Releasing 1.4.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2010-2011 Robert Ancell.
3
 
 * Author: Robert Ancell <robert.ancell@canonical.com>
4
 
 * 
5
 
 * This program is free software: you can redistribute it and/or modify it under
6
 
 * the terms of the GNU General Public License as published by the Free Software
7
 
 * Foundation, either version 3 of the License, or (at your option) any later
8
 
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
9
 
 * license.
10
 
 */
11
 
 
12
 
#ifndef _PAM_SESSION_H_
13
 
#define _PAM_SESSION_H_
14
 
 
15
 
#include <glib-object.h>
16
 
#include <security/pam_appl.h>
17
 
 
18
 
G_BEGIN_DECLS
19
 
 
20
 
#define PAM_SESSION_TYPE (pam_session_get_type())
21
 
#define PAM_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAM_SESSION_TYPE, PAMSession));
22
 
 
23
 
typedef struct PAMSessionPrivate PAMSessionPrivate;
24
 
 
25
 
typedef struct
26
 
{
27
 
    GObject         parent_instance;
28
 
    PAMSessionPrivate *priv;
29
 
} PAMSession;
30
 
 
31
 
typedef struct
32
 
{
33
 
    GObjectClass parent_class;
34
 
 
35
 
    void (*authentication_started)(PAMSession *pam_session);  
36
 
    void (*got_messages)(PAMSession *pam_session, int num_msg, const struct pam_message **msg);
37
 
    void (*authentication_result)(PAMSession *pam_session, int result);
38
 
    void (*started)(PAMSession *pam_session);
39
 
    void (*ended)(PAMSession *pam_session);
40
 
} PAMSessionClass;
41
 
 
42
 
GType pam_session_get_type (void);
43
 
 
44
 
PAMSession *pam_session_new (const gchar *service, const gchar *username);
45
 
 
46
 
gboolean pam_session_get_in_session (PAMSession *session);
47
 
 
48
 
void pam_session_authorize (PAMSession *session);
49
 
 
50
 
gboolean pam_session_start (PAMSession *session, GError **error);
51
 
 
52
 
const gchar *pam_session_strerror (PAMSession *session, int error);
53
 
 
54
 
const gchar *pam_session_get_username (PAMSession *session);
55
 
 
56
 
const struct pam_message **pam_session_get_messages (PAMSession *session);
57
 
 
58
 
gint pam_session_get_num_messages (PAMSession *session);
59
 
 
60
 
void pam_session_respond (PAMSession *session, struct pam_response *response);
61
 
 
62
 
void pam_session_cancel (PAMSession *session);
63
 
 
64
 
const gchar *pam_session_getenv (PAMSession *session, const gchar *name);
65
 
 
66
 
gchar **pam_session_get_envlist(PAMSession *session);
67
 
 
68
 
// FIXME: Do in unref
69
 
void pam_session_end (PAMSession *session);
70
 
 
71
 
G_END_DECLS
72
 
 
73
 
#endif /* _PAM_SESSION_H_ */