From d2c38031dc9620a78d2a264eeda8d9bc448a1276 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Mon, 11 Feb 2019 17:07:26 +0100 Subject: [PATCH 1/2] Don't assume the __x86_64__ pointer size to avoid warnings on x32. __x86_64__ is defined on the on the x32 architecture and the conditionals in debug.c therefore assume the size of (void*) etc: debug.c: In function 'getMcontextEip': debug.c:757:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return (void*) uc->uc_mcontext.gregs[16]; /* Linux 64 */ ^ debug.c: In function 'logRegisters': debug.c:920:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] logStackContent((void**)uc->uc_mcontext.gregs[15]); We can remedy this by checking for __ILP32__ first. See: https://wiki.debian.org/ArchitectureSpecificsMemo ... for more info. --- src/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index a98bc61ad..0c6b5630c 100644 --- a/src/debug.c +++ b/src/debug.c @@ -803,7 +803,7 @@ static void *getMcontextEip(ucontext_t *uc) { #endif #elif defined(__linux__) /* Linux */ - #if defined(__i386__) + #if defined(__i386__) || defined(__ILP32__) return (void*) uc->uc_mcontext.gregs[14]; /* Linux 32 */ #elif defined(__X86_64__) || defined(__x86_64__) return (void*) uc->uc_mcontext.gregs[16]; /* Linux 64 */ @@ -915,7 +915,7 @@ void logRegisters(ucontext_t *uc) { /* Linux */ #elif defined(__linux__) /* Linux x86 */ - #if defined(__i386__) + #if defined(__i386__) || defined(__ILP32__) serverLog(LL_WARNING, "\n" "EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n" From 9150d9246ee58b95af970ddf7040596454aeadb0 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Tue, 12 Feb 2019 16:03:58 +0800 Subject: [PATCH 2/2] ACL: show client's user --- src/networking.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/networking.c b/src/networking.c index 9e62cb6be..621570d5f 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1781,7 +1781,7 @@ sds catClientInfoString(sds s, client *client) { if (emask & AE_WRITABLE) *p++ = 'w'; *p = '\0'; return sdscatfmt(s, - "id=%U addr=%s fd=%i name=%s age=%I idle=%I flags=%s db=%i sub=%i psub=%i multi=%i qbuf=%U qbuf-free=%U obl=%U oll=%U omem=%U events=%s cmd=%s", + "id=%U addr=%s fd=%i name=%s age=%I idle=%I flags=%s db=%i sub=%i psub=%i multi=%i qbuf=%U qbuf-free=%U obl=%U oll=%U omem=%U events=%s cmd=%s user=%s", (unsigned long long) client->id, getClientPeerId(client), client->fd, @@ -1799,7 +1799,8 @@ sds catClientInfoString(sds s, client *client) { (unsigned long long) listLength(client->reply), (unsigned long long) getClientOutputBufferMemoryUsage(client), events, - client->lastcmd ? client->lastcmd->name : "NULL"); + client->lastcmd ? client->lastcmd->name : "NULL", + client->user ? client->user->name : ""); } sds getAllClientsInfoString(int type) {