mapped_id = subid->id;
}
- DEBUG(pakfire, "Mapping UID/GID %u to %u\n", id, mapped_id);
-
return mapped_id;
}
unmapped_id = subid->id;
}
- DEBUG(pakfire, "Mapping UID/GID %d from %d\n", unmapped_id, id);
-
return unmapped_id;
}
static const char* pakfire_user_lookup(void* data, la_int64_t uid) {
struct pakfire* pakfire = (struct pakfire*)data;
- DEBUG(pakfire, "Looking up name for UID %ld\n", uid);
-
// Unmap the UID first
uid = pakfire_unmap_id(pakfire, &pakfire->user.subuids, uid);
if (uid == 0)
return "root";
+ DEBUG(pakfire, "Looking up name for UID %ld\n", uid);
+
// Find a matching entry in /etc/passwd
struct passwd* entry = pakfire_getpwuid(pakfire, uid);
if (!entry) {
static const char* pakfire_group_lookup(void* data, la_int64_t gid) {
struct pakfire* pakfire = (struct pakfire*)data;
- DEBUG(pakfire, "Looking up name for GID %ld\n", gid);
-
// Unmap the GID first
gid = pakfire_unmap_id(pakfire, &pakfire->group.subgids, gid);
if (gid == 0)
return "root";
+ DEBUG(pakfire, "Looking up name for GID %ld\n", gid);
+
// Find a matching entry in /etc/group
struct group* entry = pakfire_getgrgid(pakfire, gid);
if (!entry) {
static la_int64_t pakfire_uid_lookup(void* data, const char* name, la_int64_t uid) {
struct pakfire* pakfire = (struct pakfire*)data;
- DEBUG(pakfire, "Looking up UID for '%s' (%ld)\n", name, uid);
-
// Fast path for "root"
if (strcmp(name, "root") == 0)
return pakfire_map_id(pakfire, &pakfire->user.subuids, 0);
+ DEBUG(pakfire, "Looking up UID for '%s' (%ld)\n", name, uid);
+
// Find a matching entry in /etc/passwd
struct passwd* entry = pakfire_getpwnam(pakfire, name);
if (!entry) {
static la_int64_t pakfire_gid_lookup(void* data, const char* name, la_int64_t gid) {
struct pakfire* pakfire = (struct pakfire*)data;
- DEBUG(pakfire, "Looking up GID for '%s' (%ld)\n", name, gid);
-
// Fast path for "root"
if (strcmp(name, "root") == 0)
return pakfire_map_id(pakfire, &pakfire->group.subgids, 0);
+ DEBUG(pakfire, "Looking up GID for '%s' (%ld)\n", name, gid);
+
// Find a matching entry in /etc/group
struct group* entry = pakfire_getgrnam(pakfire, name);
if (!entry) {