49 if (
unames[x] == NULL)
continue;
58 if ((pw = getpwuid(uid)) == NULL)
73 if (
unames[x] == NULL)
continue;
74 if (!strcmp(
unames[x],uname))
82 if ((pw = getpwnam(uname)) == NULL) {
100 if (
unames[x] == NULL)
continue;
101 if (!strcmp(
unames[x],uname))
109 if ((pw = getpwnam(uname)) == NULL) {
116 return uids[uid_used++];
127 if (
gnames[x] == NULL)
continue;
136 if ((gr = getgrgid(gid)) == NULL)
140 return gnames[gid_used++];
151 if (
gnames[x] == NULL)
continue;
152 if (!strcmp(
gnames[x], gname))
160 if ((gr = getgrnam(gname)) == NULL) {
167 return gnames[gid_used++];
178 if (
gnames[x] == NULL)
continue;
179 if (!strcmp(
gnames[x], gname))
187 if ((gr = getgrnam(gname)) == NULL) {
194 return gids[gid_used++];
201 if (buildTime[0] == 0)
208 static char hostname[1024];
209 static int oneshot = 0;
213 (void) gethostname(hostname,
sizeof(hostname));
216 hbn = gethostbyname(hostname);
220 strcpy(hostname, hbn->h_name);
223 _(
"Could not canonicalize hostname: %s\n"), hostname);
static ugstr_t gnames[1024]
const char * buildHost(void)
Return build hostname.
char * xstrdup(const char *str)
static void rpmlog(int code, const char *fmt,...)
const char * getUnameS(const char *uname)
Return cached user name.
const char * getUname(uid_t uid)
Return cached user name from user id.
gid_t getGidS(const char *gname)
Return cached group id.
Yet Another syslog(3) API clone.
const char * getGname(gid_t gid)
Return cached group name from group id.
rpmuint32_t * getBuildTime(void)
Return build time stamp.
static ugstr_t unames[1024]
uid_t getUidS(const char *uname)
Return cached user id.
const char * getGnameS(const char *gname)
Return cached group name.
This is the only module users of librpmbuild should need to include.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
void freeNames(void)
Destroy uid/gid caches.