/usr/include/libuser/user.h is in libuser1-dev 1:0.60~dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | /*
* Copyright (C) 2000-2002, 2004 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef libuser_user_h
#define libuser_user_h
#include <sys/types.h>
#include <glib.h>
#include "config.h"
#include "entity.h"
#include "error.h"
#include "fs.h"
#include "prompt.h"
G_BEGIN_DECLS
/**
* LU_VALUE_INVALID_ID:
*
* An #id_t value that matches no valid user or group ID.
*/
/* (id_t)-1 is used by setreuid() to indicate "not a valid ID", so it should be
safe to use for error indication. */
#define LU_VALUE_INVALID_ID ((id_t)-1)
/**
* lu_context:
*
* An opaque structure manipulated by the library, containing caller-related
* state (to allow several independent callers in a single process).
*/
struct lu_context;
#ifndef LU_DISABLE_DEPRECATED
/**
* lu_context_t:
*
* An alias for struct #lu_context.
* Deprecated: 0.57.3: Use struct #lu_context directly.
*/
typedef struct lu_context lu_context_t;
#endif
/* An enumeration which decides whether we want to modify information about
* users or groups. We don't support both simultaneously. */
enum lu_entity_type {
lu_invalid,
lu_user,
lu_group,
};
#ifndef __GTK_DOC_IGNORE__
#ifndef LU_DISABLE_DEPRECATED
typedef enum lu_entity_type lu_entity_type_t;
#endif
#endif
char *lu_value_strdup(const GValue *value);
int lu_values_equal(const GValue *a, const GValue *b);
void lu_value_init_set_id(GValue *value, id_t id);
id_t lu_value_get_id(const GValue *value);
gboolean lu_value_init_set_attr_from_string(GValue *value, const char *attr,
const char *string,
struct lu_error **error);
struct lu_context *lu_start(const char *authname, enum lu_entity_type auth_type,
const char *modules, const char *create_modules,
lu_prompt_fn *prompter, gpointer callback_data,
struct lu_error **error);
void lu_end(struct lu_context *context);
void lu_set_prompter(struct lu_context *context,
lu_prompt_fn *prompter, gpointer callback_data);
void lu_get_prompter(struct lu_context *context,
lu_prompt_fn ** prompter, gpointer *callback_data);
gboolean lu_set_modules(struct lu_context *context,
const char *list, struct lu_error **error);
const char *lu_get_modules(struct lu_context *context);
gboolean lu_uses_elevated_privileges (struct lu_context *context);
gboolean lu_user_default(struct lu_context *ctx, const char *name,
gboolean system_account, struct lu_ent *ent);
gboolean lu_group_default(struct lu_context *ctx, const char *name,
gboolean system_account, struct lu_ent *ent);
gboolean lu_user_lookup_name(struct lu_context *context,
const char *name, struct lu_ent *ent,
struct lu_error **error);
gboolean lu_group_lookup_name(struct lu_context *context,
const char *name, struct lu_ent *ent,
struct lu_error **error);
gboolean lu_user_lookup_id(struct lu_context *context, uid_t uid,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_lookup_id(struct lu_context *context, gid_t gid,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_add(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_add(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_modify(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_modify(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_delete(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_delete(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_lock(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_lock(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_unlock(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_unlock(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_unlock_nonempty(struct lu_context *context, struct lu_ent *ent,
struct lu_error **error);
gboolean lu_group_unlock_nonempty(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_islocked(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_group_islocked(struct lu_context *context,
struct lu_ent *ent, struct lu_error **error);
gboolean lu_user_setpass(struct lu_context *context,
struct lu_ent *ent, const char *newpass,
gboolean crypted,
struct lu_error **error);
gboolean lu_group_setpass(struct lu_context *context,
struct lu_ent *ent, const char *newpass,
gboolean crypted,
struct lu_error **error);
gboolean lu_user_removepass(struct lu_context *context,
struct lu_ent *ent,
struct lu_error **error);
gboolean lu_group_removepass(struct lu_context *context,
struct lu_ent *ent,
struct lu_error **error);
GValueArray *lu_users_enumerate(struct lu_context *context,
const char *pattern,
struct lu_error **error);
GValueArray *lu_groups_enumerate(struct lu_context *context,
const char *pattern,
struct lu_error **error);
GValueArray *lu_users_enumerate_by_group(struct lu_context *context,
const char *group,
struct lu_error **error);
GValueArray *lu_groups_enumerate_by_user(struct lu_context *context,
const char *user,
struct lu_error **error);
GPtrArray *lu_users_enumerate_full(struct lu_context *context,
const char *pattern,
struct lu_error **error);
GPtrArray *lu_groups_enumerate_full(struct lu_context *context,
const char *pattern,
struct lu_error **error);
GPtrArray *lu_users_enumerate_by_group_full(struct lu_context *context,
const char *group,
struct lu_error **error);
GPtrArray *lu_groups_enumerate_by_user_full(struct lu_context *context,
const char *user,
struct lu_error **error);
G_END_DECLS
#endif
|