sl@0: /** @file ../include/pwd.h sl@0: @internalComponent sl@0: */ sl@0: sl@0: sl@0: /** @fn getpwnam(const char *name) sl@0: @param name sl@0: sl@0: Refer to getpwent() for the documentation sl@0: sl@0: @see getgrent() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn getpwuid(uid_t uid) sl@0: @param uid sl@0: sl@0: Refer to getpwent() for the documentation sl@0: sl@0: @see getgrent() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn endpwent(void) sl@0: sl@0: Refer to getpwent() for the documentation sl@0: @see getgrent() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn getpwent(void) sl@0: sl@0: Note: This description also covers the following functions - sl@0: getpwnam() getpwnam_r() getpwuid() getpwuid_r() setpwent() endpwent() sl@0: sl@0: @return The functions getpwent, getpwnam, and getpwuid return a valid pointer to a passwd structure on success sl@0: or NULL if the entry is not found or if an error occurs. sl@0: If an error does occur, errno will be set. sl@0: The functions getpwnam_r, and getpwuid_r return 0 if no error occurred, or an error number to indicate failure. sl@0: It is not an error if a matching entry is not found. sl@0: (Thus, if result is NULL and the return value is 0, no matching entry exists.) The endpwent and setpwent functions sl@0: have no return value. sl@0: sl@0: These APIs belongs to set which are only build supported and not available functionally. The reason why only build support is extended to these APIs is that Symbian operating system does not support the creation of multiple users and groups in its environment. Moreover it may not make sense to have multiple users and groups in the context of a mobile environment. sl@0: We refer to the structure sl@0: @code sl@0: #include sl@0: struct passwd { sl@0: char *pw_name; /* user name */ sl@0: char *pw_passwd; /* encrypted password */ sl@0: uid_t pw_uid; /* user uid */ sl@0: gid_t pw_gid; /* user gid */ sl@0: time_t pw_change; /* password change time */ sl@0: char *pw_class; /* user access class */ sl@0: char *pw_gecos; /* Honeywell login info */ sl@0: char *pw_dir; /* home directory */ sl@0: char *pw_shell; /* default shell */ sl@0: time_t pw_expire; /* account expiration */ sl@0: int pw_fields; /* internal: fields filled in */ sl@0: }; sl@0: sl@0: @endcode sl@0: sl@0: sl@0: The functions getpwnam and getpwuid returns the default values for a single user system i.e., pw_name,pw_passwd,pw_uid and pw_gid set to root,NULL,0 and 0 respectively in case the input parameter uid/login is 0/ root else the error number is set and NULL is returned by the APIs. sl@0: sl@0: The getpwent when called the first time by an application returns the pointer to a valid passwd structure,that of the simulated single-user group.Subsequent calls return NULL until setpwent is called sl@0: sl@0: The functions getpwnam_r, and getpwuid_r are thread-safe versions of getpwnam, and getpwuid, respectively. The caller must provide storage for the results of the search in the pwd, buffer, bufsize, and result arguments. When these functions are successful, the pwd argument will be filled-in, and a pointer to that argument will be stored in result. If an entry is not found or an error occurs, result will be set to NULL. sl@0: sl@0: The setpwent function sets the library such that subsequent getpwent call returns a filled passwd structure. sl@0: sl@0: endpwent function sets up the library such that the subsequent getpwent call returns NULL. sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: @see getgrent() sl@0: sl@0: sl@0: Bugs: sl@0: sl@0: The functions getpwent, getpwnam, and getpwuid, leave their results in an internal static object and return sl@0: a pointer to that object. sl@0: Subsequent calls to sl@0: the same function sl@0: will modify the same object. The functions getpwent, endpwent, and setpwent are fairly useless in a networked environment and should be sl@0: avoided, if possible. sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn setpwent(void) sl@0: sl@0: Refer to getpwent() for the documentation sl@0: @see getgrent() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn getpwnam_r(const char *name, struct passwd *pwd, char *, size_t, struct passwd **result) sl@0: @param name sl@0: @param pwd sl@0: @param result sl@0: sl@0: Refer to getpwent() for the documentation sl@0: sl@0: @see getgrent() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn getpwuid_r(uid_t uid, struct passwd *pwd, char *, size_t, struct passwd **result) sl@0: @param uid sl@0: @param pwd sl@0: @param result sl@0: sl@0: Refer to getpwent() for the documentation sl@0: sl@0: @see getgrent() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @struct passwd sl@0: sl@0: The passwd data structure is used to hold information about entries in the system user data base sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @var passwd::pw_name sl@0: user name sl@0: */ sl@0: sl@0: /** @var passwd::pw_passwd sl@0: encrypted password sl@0: */ sl@0: sl@0: /** @var passwd::pw_uid sl@0: user uid sl@0: */ sl@0: sl@0: /** @var passwd::pw_gid sl@0: user gid sl@0: */ sl@0: sl@0: /** @var passwd::pw_change sl@0: password change time sl@0: */ sl@0: sl@0: /** @var passwd::pw_class sl@0: user access class sl@0: */ sl@0: sl@0: /** @var passwd::pw_gecos sl@0: login info sl@0: */ sl@0: sl@0: /** @var passwd::pw_dir sl@0: home directory sl@0: */ sl@0: sl@0: /** @var passwd::pw_shell sl@0: default shell sl@0: */ sl@0: sl@0: /** @var passwd::pw_expire sl@0: account expiration sl@0: */ sl@0: sl@0: /** @var passwd::pw_fields sl@0: internal: fields filled in sl@0: */ sl@0: sl@0: /** @def _PATH_PWD sl@0: sl@0: Defines to "//etc" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _PATH_PASSWD sl@0: sl@0: Defines to "//etc//passwd" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _PASSWD sl@0: sl@0: Defines to "passwd" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _PATH_MASTERPASSWD sl@0: sl@0: Defines to "//etc//master.passwd" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @def _MASTERPASSWD sl@0: sl@0: "master.passwd" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _PATH_MP_DB sl@0: sl@0: Defines to "//etc//pwd.db" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _MP_DB sl@0: sl@0: Defines to "pwd.db" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: sl@0: /** @def _PATH_SMP_DB sl@0: sl@0: Defines to "//etc//spwd.db" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _SMP_DB sl@0: sl@0: Defines to "spwd.db" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _PATH_PWD_MKDB sl@0: sl@0: Defines to "//usr//sbin//pwd_mkdb" sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @def _PASSWORD_LEN sl@0: sl@0: max length, not counting NULL sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: sl@0: