]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Silence mapping UID/GID messages
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Sep 2023 13:05:03 +0000 (13:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Sep 2023 13:05:03 +0000 (13:05 +0000)
This is waaaay to verbose in debug mode.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index b29a89a42c3d867046d89f284294c9ba8677f517..08a7fbb99261cdf530543a697365a0b773558a4f 100644 (file)
@@ -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) {