File: sp_api.h

package info (click to toggle)
libnss-securepass 0~20141025.0git2299135-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 468 kB
  • ctags: 264
  • sloc: sh: 3,021; ansic: 2,006; makefile: 70
file content (55 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 *
 * Author: gplll <gplll1818@gmail.com>, Oct 2014
 *  
 */

/* States for status field in sp_config structure */
#define SP_NOT_INITED 0
#define SP_INITED 1
#define SP_ERROR 2

struct sp_config {
	char status;
	char debug;
	char debug_stderr;
	char *app_id;
	char *app_secret;
	char *URL_u_list;
	char *URL_u_info;
	char *URL_u_x_list;
	char *default_gid;
	char *default_home;
	char *default_shell;
	char *realm;

};

typedef struct {
	char *nin;
	char *name;
	char *surname;
	char *mobile;
	char *rfid;
	char *enabled;
	char *token;
	char *manager;
	char *password;
	char *email;
} sp_user_info_t;

typedef struct {
	char *posixuid;
	char *posixgid;
	char *posixhomedir;
	char *posixshell;
	char *posixgecos;
} sp_xattrs_t;

extern struct sp_config sp_config;

int sp_init ();
int sp_list_users (char ***user, const char *realm);
int sp_user_info (sp_user_info_t **uinfo, const char *username);
int sp_xattrs (sp_xattrs_t **xattrs, char *username, int get_defaults);
int sp_xattrs_p (sp_xattrs_t **xattrs, const char *username, int get_defaults);