UID/GID are unsigned except special -1 value (which is also special in
context of specific keyctl commands), so special printing function
should be used.

* keyctl.c (keyctl_chown_key): Use printuid instead of printf with "%d"
  conversion for printing UID/GID.
  (keyctl_get_persistent): Likewise.
---
 keyctl.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/keyctl.c b/keyctl.c
index 456649e..ecb3e79 100644
--- a/keyctl.c
+++ b/keyctl.c
@@ -136,7 +136,8 @@ static void
 keyctl_chown_key(struct tcb *tcp, key_serial_t id, int user, int group)
 {
        print_keyring_serial_number(id);
-       tprintf(", %d, %d", user, group);
+       printuid(", ", user);
+       printuid(", ", group);
 }
 
 static void
@@ -189,7 +190,8 @@ keyctl_set_timeout(struct tcb *tcp, key_serial_t id, 
unsigned timeout)
 static void
 keyctl_get_persistent(struct tcb *tcp, int uid, key_serial_t id)
 {
-       tprintf("%d, ", uid);
+       printuid("", uid);
+       tprintf(", ");
        print_keyring_serial_number(id);
 }
 
-- 
1.7.10.4


------------------------------------------------------------------------------
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to