From: Michael Tremer Date: Fri, 29 Sep 2023 13:05:03 +0000 (+0000) Subject: pakfire: Silence mapping UID/GID messages X-Git-Tag: 0.9.30~1603 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe78f5eb14c59bb5e7b89cac0047aacd2b7554ae;p=pakfire.git pakfire: Silence mapping UID/GID messages This is waaaay to verbose in debug mode. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index b29a89a42..08a7fbb99 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -209,8 +209,6 @@ static unsigned int pakfire_map_id(struct pakfire* pakfire, mapped_id = subid->id; } - DEBUG(pakfire, "Mapping UID/GID %u to %u\n", id, mapped_id); - return mapped_id; } @@ -229,8 +227,6 @@ static unsigned int pakfire_unmap_id(struct pakfire* pakfire, unmapped_id = subid->id; } - DEBUG(pakfire, "Mapping UID/GID %d from %d\n", unmapped_id, id); - return unmapped_id; } @@ -1666,8 +1662,6 @@ int pakfire_confirm(struct pakfire* pakfire, const char* message, const char* qu 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); @@ -1675,6 +1669,8 @@ static const char* pakfire_user_lookup(void* data, la_int64_t 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) { @@ -1690,8 +1686,6 @@ static const char* pakfire_user_lookup(void* data, la_int64_t uid) { 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); @@ -1699,6 +1693,8 @@ static const char* pakfire_group_lookup(void* data, la_int64_t 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) { @@ -1739,12 +1735,12 @@ struct archive* pakfire_make_archive_disk_reader(struct pakfire* pakfire, int in 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) { @@ -1760,12 +1756,12 @@ static la_int64_t pakfire_uid_lookup(void* data, const char* name, la_int64_t ui 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) {