From 4f16d2e03a6cc2415a0eefcf50410d1943319543 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 9 Dec 2005 15:43:30 +0000 Subject: Implement hidden poll, switch user to hidden *printf/*scanf/poll --- libc/inet/ether_addr.c | 2 +- libc/inet/ntop.c | 2 +- libc/inet/resolv.c | 7 ++++--- libc/inet/rpc/clnt_perror.c | 14 +++++++------- libc/inet/rpc/clnt_tcp.c | 1 + libc/inet/rpc/clnt_udp.c | 1 + libc/inet/rpc/clnt_unix.c | 1 + libc/inet/rpc/pmap_rmt.c | 1 + libc/inet/rpc/rcmd.c | 2 ++ libc/inet/rpc/rexec.c | 3 ++- libc/inet/rpc/rtime.c | 1 + libc/inet/rpc/ruserpass.c | 28 ++++++++++++++-------------- libc/inet/rpc/svc_auth_unix.c | 2 +- libc/inet/rpc/svc_run.c | 1 + libc/inet/rpc/svc_tcp.c | 1 + libc/inet/rpc/svc_unix.c | 1 + 16 files changed, 40 insertions(+), 28 deletions(-) (limited to 'libc/inet') diff --git a/libc/inet/ether_addr.c b/libc/inet/ether_addr.c index 83af50210..0a1e2aede 100644 --- a/libc/inet/ether_addr.c +++ b/libc/inet/ether_addr.c @@ -79,7 +79,7 @@ struct ether_addr *ether_aton(const char *asc) char attribute_hidden *__ether_ntoa_r(const struct ether_addr *addr, char *buf) { - sprintf(buf, "%x:%x:%x:%x:%x:%x", + __sprintf(buf, "%x:%x:%x:%x:%x:%x", addr->ether_addr_octet[0], addr->ether_addr_octet[1], addr->ether_addr_octet[2], addr->ether_addr_octet[3], addr->ether_addr_octet[4], addr->ether_addr_octet[5]); diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 2fcc77591..91fa2b899 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -163,7 +163,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) tp += __strlen(tp); break; } - tp += sprintf(tp, "%x", words[i]); + tp += __sprintf(tp, "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == 8) diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index d93adede8..be0ab457b 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -148,6 +148,7 @@ #define select __select #define recv __recv #define send __send +#define snprintf __snprintf #define __FORCE_GLIBC #include @@ -1397,7 +1398,7 @@ int res_querydomain(name, domain, class, type, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) - printf(";; res_querydomain(%s, %s, %d, %d)\n", + __printf(";; res_querydomain(%s, %s, %d, %d)\n", name, domain?domain:"", class, type); #endif if (domain == NULL) { @@ -2335,7 +2336,7 @@ int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int typ addr_list[0] = in; - sprintf(buf, "%u.%u.%u.%u.in-addr.arpa", + __sprintf(buf, "%u.%u.%u.%u.in-addr.arpa", tmp_addr[3], tmp_addr[2], tmp_addr[1], tmp_addr[0]); #ifdef __UCLIBC_HAS_IPV6__ } else { @@ -2345,7 +2346,7 @@ int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int typ qp = buf; for (i = len - 1; i >= 0; i--) { - qp += sprintf(qp, "%x.%x.", in6->s6_addr[i] & 0xf, + qp += __sprintf(qp, "%x.%x.", in6->s6_addr[i] & 0xf, (in6->s6_addr[i] >> 4) & 0xf); } __strcpy(qp, "ip6.int"); diff --git a/libc/inet/rpc/clnt_perror.c b/libc/inet/rpc/clnt_perror.c index 9173f17af..611ca998c 100644 --- a/libc/inet/rpc/clnt_perror.c +++ b/libc/inet/rpc/clnt_perror.c @@ -220,7 +220,7 @@ __clnt_sperror (CLIENT * rpch, const char *msg) return NULL; CLNT_GETERR (rpch, &e); - len = sprintf (str, "%s: ", msg); + len = __sprintf (str, "%s: ", msg); str += len; (void) __strcpy(str, __clnt_sperrno(e.re_status)); @@ -246,12 +246,12 @@ __clnt_sperror (CLIENT * rpch, const char *msg) case RPC_CANTSEND: case RPC_CANTRECV: strerror_r (e.re_errno, chrbuf, sizeof chrbuf); - len = sprintf (str, "; errno = %s", chrbuf); + len = __sprintf (str, "; errno = %s", chrbuf); str += len; break; case RPC_VERSMISMATCH: - len= sprintf (str, _("; low version = %lu, high version = %lu"), + len= __sprintf (str, _("; low version = %lu, high version = %lu"), e.re_vers.low, e.re_vers.high); str += len; break; @@ -268,20 +268,20 @@ __clnt_sperror (CLIENT * rpch, const char *msg) } else { - len = sprintf (str, _("(unknown authentication error - %d)"), + len = __sprintf (str, _("(unknown authentication error - %d)"), (int) e.re_why); str += len; } break; case RPC_PROGVERSMISMATCH: - len = sprintf (str, _("; low version = %lu, high version = %lu"), + len = __sprintf (str, _("; low version = %lu, high version = %lu"), e.re_vers.low, e.re_vers.high); str += len; break; default: /* unknown */ - len = sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); + len = __sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); str += len; break; } @@ -315,7 +315,7 @@ __clnt_spcreateerror (const char *msg) if (str == NULL) return NULL; ce = &get_rpc_createerr (); - len = sprintf (str, "%s: ", msg); + len = __sprintf (str, "%s: ", msg); cp = str + len; (void) __strcpy(cp, __clnt_sperrno (ce->cf_stat)); cp += __strlen(cp); diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index 67892cc4b..c415a447d 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -62,6 +62,7 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro"; #define _seterr_reply __seterr_reply #define connect __connect #define bindresvport __bindresvport +#define poll __poll #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index 7855dcb2f..2a9f7b135 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -52,6 +52,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; #define recvfrom __recvfrom #define sendto __sendto #define recvmsg __recvmsg +#define poll __poll #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c index 56f23b749..c97edba42 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -61,6 +61,7 @@ #define connect __connect #define recvmsg __recvmsg #define sendmsg __sendmsg +#define poll __poll #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c index 60821ec6c..dbba18378 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; #define setsockopt __setsockopt #define recvfrom __recvfrom #define sendto __sendto +#define poll __poll #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index ffcfb9977..3837aed8d 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -51,6 +51,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #define bind __bind #define connect __connect #define sigblock __sigblock +#define snprintf __snprintf +#define poll __poll #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c index cac783cc3..771f85a6b 100644 --- a/libc/inet/rpc/rexec.c +++ b/libc/inet/rpc/rexec.c @@ -34,6 +34,7 @@ #define sleep __sleep #define atoi __atoi #define connect __connect +#define snprintf __snprintf #define __FORCE_GLIBC #include @@ -136,7 +137,7 @@ retry: NULL, 0, servbuff, sizeof(servbuff), NI_NUMERICSERV)) port = atoi(servbuff); - (void) sprintf(num, "%u", port); + (void) __sprintf(num, "%u", port); (void) __write(s, num, __strlen(num)+1); { socklen_t len = sizeof (from); s3 = accept(s2, (struct sockaddr *)&from, &len); diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c index 728dbab61..b4bbca19c 100644 --- a/libc/inet/rpc/rtime.c +++ b/libc/inet/rpc/rtime.c @@ -46,6 +46,7 @@ static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S #define connect __connect #define recvfrom __recvfrom #define sendto __sendto +#define poll __poll #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index a3408dee0..b7bc36864 100644 --- a/libc/inet/rpc/ruserpass.c +++ b/libc/inet/rpc/ruserpass.c @@ -122,7 +122,7 @@ int attribute_hidden __ruserpass(const char *host, const char **aname, const cha cfile = fopen(buf, "r"); if (cfile == NULL) { if (errno != ENOENT) - printf("%s", buf); + __printf("%s", buf); return (0); } /* No threads use this stream. */ @@ -170,7 +170,7 @@ next: newp = malloc((unsigned) __strlen(tokval) + 1); if (newp == NULL) { - printf(_("out of memory")); + __printf(_("out of memory")); goto bad; } *aname = __strcpy(newp, tokval); @@ -184,8 +184,8 @@ next: if (__strcmp(*aname, "anonymous") && fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { - printf(_("Error: .netrc file is readable by others.")); - printf(_("Remove password or make file unreadable by others.")); + __printf(_("Error: .netrc file is readable by others.")); + __printf(_("Remove password or make file unreadable by others.")); goto bad; } if (token() && *apass == 0) { @@ -193,7 +193,7 @@ next: newp = malloc((unsigned) __strlen(tokval) + 1); if (newp == NULL) { - printf(_("out of memory")); + __printf(_("out of memory")); goto bad; } *apass = __strcpy(newp, tokval); @@ -203,8 +203,8 @@ next: #if 0 if (fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { - printf("Error: .netrc file is readable by others."); - printf("Remove account or make file unreadable by others."); + __printf("Error: .netrc file is readable by others."); + __printf("Remove account or make file unreadable by others."); goto bad; } if (token() && *aacct == 0) { @@ -222,11 +222,11 @@ next: while ((c=getc_unlocked(cfile)) != EOF && c == ' ' || c == '\t'); if (c == EOF || c == '\n') { - printf("Missing macdef name argument.\n"); + __printf("Missing macdef name argument.\n"); goto bad; } if (macnum == 16) { - printf("Limit of 16 macros have already been defined\n"); + __printf("Limit of 16 macros have already been defined\n"); goto bad; } tmp = macros[macnum].mac_name; @@ -236,7 +236,7 @@ next: *tmp++ = c; } if (c == EOF) { - printf("Macro definition missing null line terminator.\n"); + __printf("Macro definition missing null line terminator.\n"); goto bad; } *tmp = '\0'; @@ -245,7 +245,7 @@ next: && c != '\n'); } if (c == EOF) { - printf("Macro definition missing null line terminator.\n"); + __printf("Macro definition missing null line terminator.\n"); goto bad; } if (macnum == 0) { @@ -257,7 +257,7 @@ next: tmp = macros[macnum].mac_start; while (tmp != macbuf + 4096) { if ((c=getc_unlocked(cfile)) == EOF) { - printf("Macro definition missing null line terminator.\n"); + __printf("Macro definition missing null line terminator.\n"); goto bad; } *tmp = c; @@ -271,13 +271,13 @@ next: tmp++; } if (tmp == macbuf + 4096) { - printf("4K macro buffer exceeded\n"); + __printf("4K macro buffer exceeded\n"); goto bad; } #endif break; default: - printf(_("Unknown .netrc keyword %s"), tokval); + __printf(_("Unknown .netrc keyword %s"), tokval); break; } goto done; diff --git a/libc/inet/rpc/svc_auth_unix.c b/libc/inet/rpc/svc_auth_unix.c index 6c0f44f7d..0562a42fe 100644 --- a/libc/inet/rpc/svc_auth_unix.c +++ b/libc/inet/rpc/svc_auth_unix.c @@ -110,7 +110,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg) */ if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) { - (void) printf ("bad auth_len gid %d str %d auth %d\n", + (void) __printf ("bad auth_len gid %d str %d auth %d\n", gid_len, str_len, auth_len); stat = AUTH_BADCRED; goto done; diff --git a/libc/inet/rpc/svc_run.c b/libc/inet/rpc/svc_run.c index b46320871..d2c06b895 100644 --- a/libc/inet/rpc/svc_run.c +++ b/libc/inet/rpc/svc_run.c @@ -32,6 +32,7 @@ */ #define svc_getreq_poll __svc_getreq_poll +#define poll __poll /* used by svc_[max_]pollfd */ #define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c index 2638d55be..6a25d7c42 100644 --- a/libc/inet/rpc/svc_tcp.c +++ b/libc/inet/rpc/svc_tcp.c @@ -52,6 +52,7 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; #define getsockname __getsockname #define bind __bind #define bindresvport __bindresvport +#define poll __poll #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c index ed40146eb..33ea5cf40 100644 --- a/libc/inet/rpc/svc_unix.c +++ b/libc/inet/rpc/svc_unix.c @@ -52,6 +52,7 @@ #define bind __bind #define recvmsg __recvmsg #define sendmsg __sendmsg +#define poll __poll #define __FORCE_GLIBC #include -- cgit v1.2.3