2
* Copyright (C) 2010-2011 Robert Ancell.
3
* Author: Robert Ancell <robert.ancell@canonical.com>
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
12
#ifndef _PAM_SESSION_H_
13
#define _PAM_SESSION_H_
15
#include <glib-object.h>
16
#include <security/pam_appl.h>
20
#define PAM_SESSION_TYPE (pam_session_get_type())
21
#define PAM_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAM_SESSION_TYPE, PAMSession));
23
typedef struct PAMSessionPrivate PAMSessionPrivate;
27
GObject parent_instance;
28
PAMSessionPrivate *priv;
33
GObjectClass parent_class;
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);
42
GType pam_session_get_type (void);
44
PAMSession *pam_session_new (const gchar *service, const gchar *username);
46
gboolean pam_session_get_in_session (PAMSession *session);
48
void pam_session_authorize (PAMSession *session);
50
gboolean pam_session_start (PAMSession *session, GError **error);
52
const gchar *pam_session_strerror (PAMSession *session, int error);
54
const gchar *pam_session_get_username (PAMSession *session);
56
const struct pam_message **pam_session_get_messages (PAMSession *session);
58
gint pam_session_get_num_messages (PAMSession *session);
60
void pam_session_respond (PAMSession *session, struct pam_response *response);
62
void pam_session_cancel (PAMSession *session);
64
const gchar *pam_session_getenv (PAMSession *session, const gchar *name);
66
gchar **pam_session_get_envlist(PAMSession *session);
69
void pam_session_end (PAMSession *session);
73
#endif /* _PAM_SESSION_H_ */