f8cb30712e
functions by ones reading /etc/{group,passwd}. * Added quasi-standard getpwent_r() and getgrent_r(). * Added _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX sysconf() constants. * Moved initgroups() and getgrouplist() definition to grp.cpp. They use the same backend as the <grp.h> functions. * Set the permissions of files created by the build system to what they should be on the image (executables: 755, others: 644). Otherwise only root could do anything under Haiku. * Added build system variables HAIKU_ROOT_USER_NAME and HAIKU_ROOT_USER_REAL_NAME to customize name and real name of Haiku's root user. * Added build system rules AddUserToHaikuImage and AddGroupToHaikuImage for adding additional users and groups (by default only root user and group and a "users" group are created). * Adjusted BIND port and coreutils config.h files according to what features have become available. * Fixed HAIKU_DOCUMENTATION_OBJECT_DIR definition. Untested, but it used a wrong variable name before. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24750 a95241bf-73f2-0310-859d-f6bbb57e9c96
43 lines
956 B
C
43 lines
956 B
C
#ifndef _PWD_H_
|
|
#define _PWD_H_
|
|
/*
|
|
** Distributed under the terms of the OpenBeOS License.
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct passwd {
|
|
char *pw_name;
|
|
char *pw_passwd;
|
|
uid_t pw_uid;
|
|
gid_t pw_gid;
|
|
char *pw_dir;
|
|
char *pw_shell;
|
|
char *pw_gecos;
|
|
};
|
|
|
|
/* traverse the user password database */
|
|
extern struct passwd *getpwent(void);
|
|
extern int getpwent_r(struct passwd* pwbuf, char* buf, size_t buflen,
|
|
struct passwd** pwbufp);
|
|
extern void setpwent(void);
|
|
extern void endpwent(void);
|
|
|
|
/* search the user password database */
|
|
extern struct passwd *getpwnam(const char *name);
|
|
extern int getpwnam_r(const char *name, struct passwd *passwd, char *buffer,
|
|
size_t bufferSize, struct passwd **result);
|
|
extern struct passwd *getpwuid(uid_t uid);
|
|
extern int getpwuid_r(uid_t uid, struct passwd *passwd, char *buffer,
|
|
size_t bufferSize, struct passwd **result);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _PWD_H_ */
|