fix the closing session bug, even if next user authentication is failed.
[platform/core/system/tlm.git] / src / common / tlm-utils.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of tlm (Tiny Login Manager)
5  *
6  * Copyright (C) 2013 Intel Corporation.
7  *
8  * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
9  *          Jussi Laako <jussi.laako@linux.intel.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24  * 02110-1301 USA
25  */
26
27 #ifndef _TLM_UTILS_H
28 #define _TLM_UTILS_H
29
30 #include <sys/types.h>
31 #include <glib.h>
32
33 #include "tlm-config.h"
34
35 G_BEGIN_DECLS
36
37 void
38 g_clear_string (gchar **);
39
40 const gchar *
41 tlm_user_get_name (uid_t user_id);
42
43 uid_t
44 tlm_user_get_uid (const gchar *username);
45
46 gid_t
47 tlm_user_get_gid (const gchar *username);
48
49 const gchar *
50 tlm_user_get_home_dir (const gchar *username);
51
52 const gchar *
53 tlm_user_get_shell (const gchar *username);
54
55 gboolean
56 tlm_utils_delete_dir (const gchar *dir);
57
58 void
59 tlm_utils_log_utmp_entry (const gchar *username);
60
61 gchar **
62 tlm_utils_split_command_line (const gchar *command);
63
64 GList *
65 tlm_utils_split_command_lines (const GList const *commands_list);
66
67 typedef void (*WatchCb) (const gchar *found_item, gboolean is_final, GError *error, gpointer userdata);
68
69 guint
70 tlm_utils_watch_for_files (const gchar **watch_list, WatchCb cb, gpointer userdata);
71
72 gboolean
73 tlm_authenticate_user (TlmConfig *config, const gchar *username, const gchar *password);
74
75 G_END_DECLS
76
77 #endif /* _TLM_UTILS_H */