]> granicus.if.org Git - strace/commitdiff
Use printstr for sethostname, setdomainname, and gethostname decoding
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 28 May 2014 16:38:44 +0000 (16:38 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 28 May 2014 18:09:46 +0000 (18:09 +0000)
The argument passed to sethostname and setdomainname syscalls, as well
as the string returned by gethostname syscall, is not a pathname, so
printpathn is not the right method for its decoding.

* process.c (sys_sethostname, sys_setdomainname): Decode 1st argument
using printstr instead of printpathn.
[ALPHA] (sys_gethostname): Likewise.

process.c

index 4347a872b003de75b700c4de360cfa2572f79bd2..4a059ccfe9e91ad36bec2b9dc0ee7f763c84cb5c 100644 (file)
--- a/process.c
+++ b/process.c
@@ -390,7 +390,7 @@ int
 sys_sethostname(struct tcb *tcp)
 {
        if (entering(tcp)) {
-               printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+               printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
                tprintf(", %lu", tcp->u_arg[1]);
        }
        return 0;
@@ -404,7 +404,7 @@ sys_gethostname(struct tcb *tcp)
                if (syserror(tcp))
                        tprintf("%#lx", tcp->u_arg[0]);
                else
-                       printpath(tcp, tcp->u_arg[0]);
+                       printstr(tcp, tcp->u_arg[0], -1);
                tprintf(", %lu", tcp->u_arg[1]);
        }
        return 0;
@@ -415,7 +415,7 @@ int
 sys_setdomainname(struct tcb *tcp)
 {
        if (entering(tcp)) {
-               printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+               printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
                tprintf(", %lu", tcp->u_arg[1]);
        }
        return 0;