X-Git-Url: https://git.hcoop.net/hcoop/debian/courier-authlib.git/blobdiff_plain/01037b081eab5fb3f208489dc3e052ec3a2c8ba1..1420868b3e321353480efbb7eb35e1e8d9943223:/auth_mkhomedir.html diff --git a/auth_mkhomedir.html b/auth_mkhomedir.html new file mode 100644 index 0000000..d0a0678 --- /dev/null +++ b/auth_mkhomedir.html @@ -0,0 +1,42 @@ + +auth_mkhomedir

Name

auth_mkhomedir — Autocreate a new account's home directory

Synopsis


+#include <courierauth.h>
+

int rc=auth_mkhomedir(struct authinfo *auth);
 

DESCRIPTION

+ A callback_func that's passed as a parameter + to + auth_getuserinfo(3) + can invoke this function to automatically create a new account's + home directory, if the authlib client is running as root, forwarding + the authinfo pointer from the callback. +

+ auth_mkhomedir() checks if the + AUTH_MKHOMEDIR_SKEL environment variable is set, and + if the authenticated account's home directory does not exist. + If the environment variable is set it must point to a directory like + /etc/skel that contains a template for the + contents of a new account's home directory. +

+ If AUTH_MKHOMEDIR_SKEL is not set, or if the home + directory exists, + auth_mkhomedir() does nothing and returns 0. + Otherwise the account's home directory gets created, and + the contents of the AUTH_MKHOMEDIR_SKEL + directory get recursively copied into the new home directory. + The permissions of AUTH_MKHOMEDIR_SKEL and its contents + are preserved, and the owner userid and groupid is set to the + authenticated account's userid and groupid. +

RETURNS

+ auth_mkhomedir() returns a non-zero value if + an error occured while creating the new account's home directory. + auth_mkhomedir() returns zero if the new + account's home directory was created successfully, or if the + account's home directory already exists. +