version 1.28, 2014/07/05 06:18:58 |
version 1.29, 2014/07/05 06:55:29 |
|
|
* Variables common to both client and server |
* Variables common to both client and server |
*/ |
*/ |
char host[MAXHOSTNAMELEN]; /* Name of this host */ |
char host[MAXHOSTNAMELEN]; /* Name of this host */ |
UID_T userid = (UID_T)-1; /* User's UID */ |
uid_t userid = (uid_t)-1; /* User's UID */ |
GID_T groupid = (GID_T)-1; /* User's GID */ |
gid_t groupid = (gid_t)-1; /* User's GID */ |
char *homedir = NULL; /* User's $HOME */ |
char *homedir = NULL; /* User's $HOME */ |
char *locuser = NULL; /* Local User's name */ |
char *locuser = NULL; /* Local User's name */ |
int isserver = FALSE; /* We're the server */ |
int isserver = FALSE; /* We're the server */ |
|
|
* Get the user name for the uid. |
* Get the user name for the uid. |
*/ |
*/ |
char * |
char * |
getusername(UID_T uid, char *file, opt_t opts) |
getusername(uid_t uid, char *file, opt_t opts) |
{ |
{ |
static char buf[100]; |
static char buf[100]; |
static UID_T lastuid = (UID_T)-1; |
static uid_t lastuid = (uid_t)-1; |
struct passwd *pwd = NULL; |
struct passwd *pwd = NULL; |
|
|
/* |
/* |
|
|
* Get the group name for the gid. |
* Get the group name for the gid. |
*/ |
*/ |
char * |
char * |
getgroupname(GID_T gid, char *file, opt_t opts) |
getgroupname(gid_t gid, char *file, opt_t opts) |
{ |
{ |
static char buf[100]; |
static char buf[100]; |
static GID_T lastgid = (GID_T)-1; |
static gid_t lastgid = (gid_t)-1; |
struct group *grp = NULL; |
struct group *grp = NULL; |
|
|
/* |
/* |