summaryrefslogtreecommitdiff
path: root/build/names.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-01-10 13:39:00 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-01-10 13:39:00 +0200
commit735c83ad5291858cc981f739c3db5165d50598d5 (patch)
tree0d930d3a49e7c423577b220d974461138beda6c5 /build/names.c
parent76d8c768363731b89da2c5db7625d2369adc5175 (diff)
downloadrpm-735c83ad5291858cc981f739c3db5165d50598d5.tar.gz
rpm-735c83ad5291858cc981f739c3db5165d50598d5.tar.bz2
rpm-735c83ad5291858cc981f739c3db5165d50598d5.zip
Define and use UGIDMAX instead of hardcoded 1024 all over
Diffstat (limited to 'build/names.c')
-rw-r--r--build/names.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/build/names.c b/build/names.c
index 26a352b1f..ccbeb29b9 100644
--- a/build/names.c
+++ b/build/names.c
@@ -10,14 +10,16 @@
#include <rpm/rpmlog.h>
#include "debug.h"
+#define UGIDMAX 1024
+
typedef char * ugstr_t;
-static uid_t uids[1024];
-static ugstr_t unames[1024];
+static uid_t uids[UGIDMAX];
+static ugstr_t unames[UGIDMAX];
static int uid_used = 0;
-static gid_t gids[1024];
-static ugstr_t gnames[1024];
+static gid_t gids[UGIDMAX];
+static ugstr_t gnames[UGIDMAX];
static int gid_used = 0;
void freeNames(void)
@@ -41,7 +43,7 @@ const char *getUname(uid_t uid)
}
/* XXX - This is the other hard coded limit */
- if (x == 1024)
+ if (x == UGIDMAX)
rpmlog(RPMLOG_CRIT, _("getUname: too many uid's\n"));
if ((pw = getpwuid(uid)) == NULL)
@@ -63,7 +65,7 @@ const char *getUnameS(const char *uname)
}
/* XXX - This is the other hard coded limit */
- if (x == 1024)
+ if (x == UGIDMAX)
rpmlog(RPMLOG_CRIT, _("getUnameS: too many uid's\n"));
if ((pw = getpwnam(uname)) == NULL) {
@@ -88,7 +90,7 @@ uid_t getUidS(const char *uname)
}
/* XXX - This is the other hard coded limit */
- if (x == 1024)
+ if (x == UGIDMAX)
rpmlog(RPMLOG_CRIT, _("getUidS: too many uid's\n"));
if ((pw = getpwnam(uname)) == NULL) {
@@ -113,7 +115,7 @@ const char *getGname(gid_t gid)
}
/* XXX - This is the other hard coded limit */
- if (x == 1024)
+ if (x == UGIDMAX)
rpmlog(RPMLOG_CRIT, _("getGname: too many gid's\n"));
if ((gr = getgrgid(gid)) == NULL)
@@ -135,7 +137,7 @@ const char *getGnameS(const char *gname)
}
/* XXX - This is the other hard coded limit */
- if (x == 1024)
+ if (x == UGIDMAX)
rpmlog(RPMLOG_CRIT, _("getGnameS: too many gid's\n"));
if ((gr = getgrnam(gname)) == NULL) {
@@ -160,7 +162,7 @@ gid_t getGidS(const char *gname)
}
/* XXX - This is the other hard coded limit */
- if (x == 1024)
+ if (x == UGIDMAX)
rpmlog(RPMLOG_CRIT, _("getGidS: too many gid's\n"));
if ((gr = getgrnam(gname)) == NULL) {