diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-01 16:27:13 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-01 16:27:13 +0100 |
commit | 7d65abea092e917bc2320cbf1d5a2dccb2a8288f (patch) | |
tree | 48d54d5150bedd8eb980b1760d75deb6f6df8949 /libbb | |
parent | 3b28dae17dc93584f0e38388d0dbdbd6761d705e (diff) | |
download | busybox-w32-7d65abea092e917bc2320cbf1d5a2dccb2a8288f.tar.gz busybox-w32-7d65abea092e917bc2320cbf1d5a2dccb2a8288f.tar.bz2 busybox-w32-7d65abea092e917bc2320cbf1d5a2dccb2a8288f.zip |
libbb: make user/group name cache strings longer (~27 chars)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/bb_pwd.c | 4 | ||||
-rw-r--r-- | libbb/procps.c | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/libbb/bb_pwd.c b/libbb/bb_pwd.c index 32406cb58..4829b723a 100644 --- a/libbb/bb_pwd.c +++ b/libbb/bb_pwd.c | |||
@@ -72,13 +72,13 @@ char* FAST_FUNC gid2group(gid_t gid) | |||
72 | return (gr) ? gr->gr_name : NULL; | 72 | return (gr) ? gr->gr_name : NULL; |
73 | } | 73 | } |
74 | 74 | ||
75 | char* FAST_FUNC uid2uname_utoa(long uid) | 75 | char* FAST_FUNC uid2uname_utoa(uid_t uid) |
76 | { | 76 | { |
77 | char *name = uid2uname(uid); | 77 | char *name = uid2uname(uid); |
78 | return (name) ? name : utoa(uid); | 78 | return (name) ? name : utoa(uid); |
79 | } | 79 | } |
80 | 80 | ||
81 | char* FAST_FUNC gid2group_utoa(long gid) | 81 | char* FAST_FUNC gid2group_utoa(gid_t gid) |
82 | { | 82 | { |
83 | char *name = gid2group(gid); | 83 | char *name = gid2group(gid); |
84 | return (name) ? name : utoa(gid); | 84 | return (name) ? name : utoa(gid); |
diff --git a/libbb/procps.c b/libbb/procps.c index fb4c32001..5833a1f0d 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -12,13 +12,13 @@ | |||
12 | #include "libbb.h" | 12 | #include "libbb.h" |
13 | 13 | ||
14 | 14 | ||
15 | typedef struct unsigned_to_name_map_t { | 15 | typedef struct id_to_name_map_t { |
16 | long id; | 16 | uid_t id; |
17 | char name[USERNAME_MAX_SIZE]; | 17 | char name[USERNAME_MAX_SIZE]; |
18 | } unsigned_to_name_map_t; | 18 | } id_to_name_map_t; |
19 | 19 | ||
20 | typedef struct cache_t { | 20 | typedef struct cache_t { |
21 | unsigned_to_name_map_t *cache; | 21 | id_to_name_map_t *cache; |
22 | int size; | 22 | int size; |
23 | } cache_t; | 23 | } cache_t; |
24 | 24 | ||
@@ -39,7 +39,7 @@ void FAST_FUNC clear_username_cache(void) | |||
39 | #if 0 /* more generic, but we don't need that yet */ | 39 | #if 0 /* more generic, but we don't need that yet */ |
40 | /* Returns -N-1 if not found. */ | 40 | /* Returns -N-1 if not found. */ |
41 | /* cp->cache[N] is allocated and must be filled in this case */ | 41 | /* cp->cache[N] is allocated and must be filled in this case */ |
42 | static int get_cached(cache_t *cp, unsigned id) | 42 | static int get_cached(cache_t *cp, uid_t id) |
43 | { | 43 | { |
44 | int i; | 44 | int i; |
45 | for (i = 0; i < cp->size; i++) | 45 | for (i = 0; i < cp->size; i++) |
@@ -52,8 +52,8 @@ static int get_cached(cache_t *cp, unsigned id) | |||
52 | } | 52 | } |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | static char* get_cached(cache_t *cp, long id, | 55 | static char* get_cached(cache_t *cp, uid_t id, |
56 | char* FAST_FUNC x2x_utoa(long id)) | 56 | char* FAST_FUNC x2x_utoa(uid_t id)) |
57 | { | 57 | { |
58 | int i; | 58 | int i; |
59 | for (i = 0; i < cp->size; i++) | 59 | for (i = 0; i < cp->size; i++) |