Commit 18f926ff authored by Bastien Nocera's avatar Bastien Nocera
Browse files

pam: Use stdbool in pam module

parent 5dd8508d
......@@ -56,11 +56,11 @@
}
static gboolean debug = FALSE;
static bool debug = FALSE;
static guint max_tries = DEFAULT_MAX_TRIES;
static guint timeout = DEFAULT_TIMEOUT;
static gboolean send_info_msg(pam_handle_t *pamh, const char *msg)
static bool send_info_msg(pam_handle_t *pamh, const char *msg)
{
const struct pam_message mymsg = {
.msg_style = PAM_TEXT_INFO,
......@@ -81,7 +81,7 @@ static gboolean send_info_msg(pam_handle_t *pamh, const char *msg)
return (pc->conv(1, &msgp, &resp, pc->appdata_ptr) == PAM_SUCCESS);
}
static gboolean send_err_msg(pam_handle_t *pamh, const char *msg)
static bool send_err_msg(pam_handle_t *pamh, const char *msg)
{
const struct pam_message mymsg = {
.msg_style = PAM_ERROR_MSG,
......@@ -183,7 +183,7 @@ static void unref_loop (GMainLoop *loop)
#define DBUS_TYPE_G_OBJECT_PATH_ARRAY (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH))
static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection, DBusGProxy *manager, gboolean *has_multiple_devices)
static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection, DBusGProxy *manager, bool *has_multiple_devices)
{
GError *error = NULL;
const char *path;
......@@ -225,15 +225,15 @@ static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection,
typedef struct {
guint max_tries;
char *result;
gboolean timed_out;
gboolean is_swipe;
bool timed_out;
bool is_swipe;
pam_handle_t *pamh;
GMainLoop *loop;
char *driver;
} verify_data;
static void verify_result(GObject *object, const char *result, gboolean done, gpointer user_data)
static void verify_result(GObject *object, const char *result, bool done, gpointer user_data)
{
verify_data *data = user_data;
const char *msg;
......@@ -261,7 +261,7 @@ static void verify_finger_selected(GObject *object, const char *finger_name, gpo
g_free (msg);
}
static gboolean verify_timeout_cb (gpointer user_data)
static bool verify_timeout_cb (gpointer user_data)
{
verify_data *data = user_data;
......@@ -272,7 +272,7 @@ static gboolean verify_timeout_cb (gpointer user_data)
return FALSE;
}
static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gboolean has_multiple_devices)
static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, bool has_multiple_devices)
{
GError *error = NULL;
GHashTable *props;
......@@ -316,7 +316,7 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
/* Set up the timeout on our non-default context */
source = g_timeout_source_new_seconds (timeout);
g_source_attach (source, g_main_loop_get_context (loop));
g_source_set_callback (source, verify_timeout_cb, data, NULL);
g_source_set_callback (source, (GSourceFunc) verify_timeout_cb, data, NULL);
data->timed_out = FALSE;
......@@ -376,10 +376,10 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
return ret;
}
static gboolean user_has_prints(DBusGProxy *dev, const char *username)
static bool user_has_prints(DBusGProxy *dev, const char *username)
{
char **fingers;
gboolean have_prints;
bool have_prints;
if (!dbus_g_proxy_call (dev, "ListEnrolledFingers", NULL,
G_TYPE_STRING, username, G_TYPE_INVALID,
......@@ -405,7 +405,7 @@ static void release_device(pam_handle_t *pamh, DBusGProxy *dev)
}
}
static gboolean claim_device(pam_handle_t *pamh, DBusGProxy *dev, const char *username)
static bool claim_device(pam_handle_t *pamh, DBusGProxy *dev, const char *username)
{
GError *error = NULL;
......@@ -424,8 +424,8 @@ static int do_auth(pam_handle_t *pamh, const char *username)
DBusGConnection *connection;
DBusGProxy *dev;
GMainLoop *loop;
gboolean have_prints;
gboolean has_multiple_devices;
bool have_prints;
bool has_multiple_devices;
int ret = PAM_AUTHINFO_UNAVAIL;
manager = create_manager (pamh, &connection, &loop);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment