| 1 |
/** $MirOS: src/bin/pax/cache.c,v 1.3 2006/07/16 17:55:18 tg Exp $ */ |
/** $MirOS: src/bin/pax/cache.c,v 1.4 2007/02/17 04:52:40 tg Exp $ */ |
| 2 |
/* $OpenBSD: cache.c,v 1.17 2004/03/16 03:28:34 tedu Exp $ */ |
/* $OpenBSD: cache.c,v 1.17 2004/03/16 03:28:34 tedu Exp $ */ |
| 3 |
/* $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $ */ |
/* $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $ */ |
| 4 |
|
|
| 35 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
| 36 |
*/ |
*/ |
| 37 |
|
|
| 38 |
#include <sys/types.h> |
#include <sys/param.h> |
| 39 |
#include <sys/time.h> |
#include <sys/time.h> |
| 40 |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <sys/param.h> |
|
| 41 |
#include <string.h> |
#include <string.h> |
| 42 |
#include <stdio.h> |
#include <stdio.h> |
| 43 |
#include <pwd.h> |
#include <pwd.h> |
| 49 |
#include "extern.h" |
#include "extern.h" |
| 50 |
|
|
| 51 |
__SCCSID("@(#)cache.c 8.1 (Berkeley) 5/31/93"); |
__SCCSID("@(#)cache.c 8.1 (Berkeley) 5/31/93"); |
| 52 |
__RCSID("$MirOS: src/bin/pax/cache.c,v 1.3 2006/07/16 17:55:18 tg Exp $"); |
__RCSID("$MirOS: src/bin/pax/cache.c,v 1.4 2007/02/17 04:52:40 tg Exp $"); |
| 53 |
|
|
| 54 |
/* |
/* |
| 55 |
* routines that control user, group, uid and gid caches (for the archive |
* routines that control user, group, uid and gid caches (for the archive |
| 169 |
* Pointer to stored name (or a empty string) |
* Pointer to stored name (or a empty string) |
| 170 |
*/ |
*/ |
| 171 |
|
|
| 172 |
char * |
const char * |
| 173 |
name_uid(uid_t uid, int frc) |
name_uid(uid_t uid, int frc) |
| 174 |
{ |
{ |
| 175 |
struct passwd *pw; |
struct passwd *pw; |
| 237 |
* Pointer to stored name (or a empty string) |
* Pointer to stored name (or a empty string) |
| 238 |
*/ |
*/ |
| 239 |
|
|
| 240 |
char * |
const char * |
| 241 |
name_gid(gid_t gid, int frc) |
name_gid(gid_t gid, int frc) |
| 242 |
{ |
{ |
| 243 |
struct group *gr; |
struct group *gr; |
| 305 |
*/ |
*/ |
| 306 |
|
|
| 307 |
int |
int |
| 308 |
uid_name(char *name, uid_t *uid) |
uid_name(const char *name, uid_t *uid) |
| 309 |
{ |
{ |
| 310 |
struct passwd *pw; |
struct passwd *pw; |
| 311 |
UIDC *ptr; |
UIDC *ptr; |
| 370 |
*/ |
*/ |
| 371 |
|
|
| 372 |
int |
int |
| 373 |
gid_name(char *name, gid_t *gid) |
gid_name(const char *name, gid_t *gid) |
| 374 |
{ |
{ |
| 375 |
struct group *gr; |
struct group *gr; |
| 376 |
GIDC *ptr; |
GIDC *ptr; |