| libuser Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <libuser/fs.h> gboolean lu_homedir_move (const char *oldhome,const char *newhome,struct lu_error **error); gboolean lu_homedir_populate (struct lu_context *ctx,const char *skeleton,const char *directory,uid_t owner,gid_t group,mode_t mode,struct lu_error **error); gboolean lu_homedir_remove (const char *directory,struct lu_error **error); gboolean lu_mail_spool_create (struct lu_context *ctx,struct lu_ent *ent,struct lu_error **error); gboolean lu_mail_spool_remove (struct lu_context *ctx,struct lu_ent *ent,struct lu_error **error); #define LU_NSCD_CACHE_GROUP #define LU_NSCD_CACHE_PASSWD void lu_nscd_flush_cache (const char *table);
These routines allow an application to work with home directories, mail spools and nscd caches.
gboolean lu_homedir_move (const char *oldhome,const char *newhome,struct lu_error **error);
Moves user's home directory to newhome.
Currently implemented by first creating a copy, then deleting the original, expect this to take a long time.
gboolean lu_homedir_populate (struct lu_context *ctx,const char *skeleton,const char *directory,uid_t owner,gid_t group,mode_t mode,struct lu_error **error);
Creates a new home directory for an user.
|
A context |
|
Path to a "skeleton" directory, or NULL for the system default |
|
The home directory to populate |
|
UID to use for contents of the new home directory |
|
GID to use for contents of the new home directory that have GID set to 0 in the skeleton director |
|
Mode to use for the top-level directory, also affected by umask |
|
Filled with lu_error if an error occurs |
Returns : |
TRUE on success |
gboolean lu_homedir_remove (const char *directory,struct lu_error **error);
Recursively removes a user's home (or really, any) directory.
Note that the implementation is not currently race-free; calling this when the user may still be logged in is discouraged.
gboolean lu_mail_spool_create (struct lu_context *ctx,struct lu_ent *ent,struct lu_error **error);
Creates a mail spool for the specified user.
gboolean lu_mail_spool_remove (struct lu_context *ctx,struct lu_ent *ent,struct lu_error **error);
Creates a mail spool for the specified user.
#define LU_NSCD_CACHE_GROUP "group"
Name of the NSCD cache containing group data.
#define LU_NSCD_CACHE_PASSWD "passwd"
Name of the NSCD cache containing user data.