From 3d32a931a1a2fa6cbcda4ecc497192795994945f Mon Sep 17 00:00:00 2001 From: ume Date: Wed, 9 Jan 2013 15:22:37 +0000 Subject: Disable destination address selection support of getipnodebyname(1). RFC 2553 mentions IPv6 addresses are returned 1st. Spotted by: uqs MFC after: 1 week --- lib/libc/net/name6.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 0031f46..4d7cf79 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -200,6 +200,7 @@ static struct hostent *_hpmapv6(struct hostent *, int *); #endif static struct hostent *_hpsort(struct hostent *, res_state); +#ifdef ENABLE_IP6ADDRCTL static struct hostent *_hpreorder(struct hostent *); static int get_addrselectpolicy(struct policyhead *); static void free_addrselectpolicy(struct policyhead *); @@ -209,6 +210,7 @@ static void set_source(struct hp_order *, struct policyhead *); static int matchlen(struct sockaddr *, struct sockaddr *); static int comp_dst(const void *, const void *); static int gai_addr2scopetype(struct sockaddr *); +#endif /* * Functions defined in RFC2553 @@ -309,7 +311,11 @@ getipnodebyname(const char *name, int af, int flags, int *errp) *errp = statp->res_h_errno; statp->options = options; +#ifdef ENABLE_IP6ADDRCTL return _hpreorder(_hpsort(hp, statp)); +#else + return _hpsort(hp, statp); +#endif } struct hostent * @@ -632,6 +638,7 @@ _hpsort(struct hostent *hp, res_state statp) return hp; } +#ifdef ENABLE_IP6ADDRCTL /* * _hpreorder: sort address by default address selection */ @@ -1109,3 +1116,4 @@ gai_addr2scopetype(struct sockaddr *sa) return(-1); } } +#endif -- cgit v1.1 From 4873e359cf040abbf1858a6450b4f3e5a6f61431 Mon Sep 17 00:00:00 2001 From: ae Date: Wed, 9 Jan 2013 19:49:35 +0000 Subject: Fix the bindto parameter declaration. Submitted by: sem --- lib/libradius/libradius.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libradius/libradius.3 b/lib/libradius/libradius.3 index 253659c..f3ff700 100644 --- a/lib/libradius/libradius.3 +++ b/lib/libradius/libradius.3 @@ -38,7 +38,7 @@ .Ft int .Fn rad_add_server "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries" .Ft int -.Fn rad_add_server_ex "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries" "int dead_time" "struct in_addr bindto" +.Fn rad_add_server_ex "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries" "int dead_time" "struct in_addr *bindto" .Ft "struct rad_handle *" .Fn rad_auth_open "void" .Ft void -- cgit v1.1 From 48d4ca6f43e841b9dc56825f68e423088aaa4dfe Mon Sep 17 00:00:00 2001 From: ume Date: Thu, 10 Jan 2013 14:08:19 +0000 Subject: Re-enable ip6addrctl support but only for IPv6 address. Requested by: Ben Morrow MFC after: 1 week --- lib/libc/net/name6.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 4d7cf79..f360162 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -200,7 +200,7 @@ static struct hostent *_hpmapv6(struct hostent *, int *); #endif static struct hostent *_hpsort(struct hostent *, res_state); -#ifdef ENABLE_IP6ADDRCTL +#ifdef INET6 static struct hostent *_hpreorder(struct hostent *); static int get_addrselectpolicy(struct policyhead *); static void free_addrselectpolicy(struct policyhead *); @@ -287,8 +287,10 @@ getipnodebyname(const char *name, int af, int flags, int *errp) hp = gethostbyname2(name, af); hp = _hpcopy(hp, errp); - #ifdef INET6 + if (af == AF_INET6) + hp = _hpreorder(hp); + if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) && MAPADDRENABLED(flags)) { struct hostent *hp2 = gethostbyname2(name, AF_INET); @@ -311,11 +313,7 @@ getipnodebyname(const char *name, int af, int flags, int *errp) *errp = statp->res_h_errno; statp->options = options; -#ifdef ENABLE_IP6ADDRCTL - return _hpreorder(_hpsort(hp, statp)); -#else return _hpsort(hp, statp); -#endif } struct hostent * @@ -638,7 +636,7 @@ _hpsort(struct hostent *hp, res_state statp) return hp; } -#ifdef ENABLE_IP6ADDRCTL +#ifdef INET6 /* * _hpreorder: sort address by default address selection */ -- cgit v1.1 From 4059b9293fea590e8986a3c9ae8be3cea3f02a11 Mon Sep 17 00:00:00 2001 From: brooks Date: Fri, 11 Jan 2013 15:50:01 +0000 Subject: In r244401 I accidently moved strunvis and strunvisx from version 1.0 to 1.3 breaking the libc ABI. Revert that change (breaking the ABI again for users who updated after December 18th). --- lib/libc/gen/Symbol.map | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 0c6f48e..4cbf07c 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -298,6 +298,8 @@ FBSD_1.0 { ualarm; ulimit; uname; + strunvis; + strunvisx; usleep; utime; valloc; @@ -391,8 +393,6 @@ FBSD_1.3 { snvis; strnunvis; strnunvisx; - strunvis; - strunvisx; strnvis; strnvisx; strsnvis; -- cgit v1.1 From 05884d1e6d79cdf2481b31f3475ff4fc34369cb5 Mon Sep 17 00:00:00 2001 From: brooks Date: Fri, 11 Jan 2013 17:51:03 +0000 Subject: Add contrib/libc-vis to the include path so we reliably pick up the right version of vis.h. Reported by: dim --- lib/libc/gen/Makefile.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index abface8..0bbbb33 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -40,6 +40,7 @@ SRCS+= __getosreldate.c __xuname.c \ SRCS+= pwcache.c pwcache.h .PATH: ${.CURDIR}/../../contrib/libc-vis +CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis SRCS+= unvis.c vis.c MISRCS+=modf.c -- cgit v1.1 From 63a1e394aa3156ea61f726ad1fccbf6a8627e84b Mon Sep 17 00:00:00 2001 From: joel Date: Sat, 12 Jan 2013 09:07:19 +0000 Subject: editrc only read from $HOME. Submitted by: LEVAI Daniel (via jmc@OpenBSD) --- lib/libedit/editline.3 | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/libedit/editline.3 b/lib/libedit/editline.3 index fe58321..33f7666 100644 --- a/lib/libedit/editline.3 +++ b/lib/libedit/editline.3 @@ -526,8 +526,6 @@ If is .Dv NULL , try -.Pa $PWD/.editrc -then .Pa $HOME/.editrc . Refer to .Xr editrc 5 -- cgit v1.1 From 874cf76c76a7aaae4b28a1efd69de0089b19c920 Mon Sep 17 00:00:00 2001 From: joel Date: Sat, 12 Jan 2013 09:08:37 +0000 Subject: Add FILES section. Submitted by: jmc@OpenBSD --- lib/libedit/editrc.5 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/libedit/editrc.5 b/lib/libedit/editrc.5 index f46b874..6e04ea1 100644 --- a/lib/libedit/editrc.5 +++ b/lib/libedit/editrc.5 @@ -473,6 +473,13 @@ Move down one line. Editline extended command. .El .\" End of section automatically generated with makelist +.Sh FILES +.Bl -tag -width "~/.editrcXXX" +.It Pa ~/.editrc +User configuration file for the +.Xr editline 3 +library. +.El .Sh SEE ALSO .Xr editline 3 , .Xr regex 3 , -- cgit v1.1 From 15b9700547d6667a4e855e30cc7aaf11a2a9908a Mon Sep 17 00:00:00 2001 From: mjg Date: Sun, 13 Jan 2013 21:25:43 +0000 Subject: libutil: eliminate 'found' variable in gr_equal Submitted by: Christoph Mallon --- lib/libutil/gr_util.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c index acb9767..5e35ebe 100644 --- a/lib/libutil/gr_util.c +++ b/lib/libutil/gr_util.c @@ -346,7 +346,6 @@ gr_equal(const struct group *gr1, const struct group *gr2) { int gr1_ndx; int gr2_ndx; - bool found; /* Check that the non-member information is the same. */ if (gr1->gr_name == NULL || gr2->gr_name == NULL) { @@ -367,17 +366,15 @@ gr_equal(const struct group *gr1, const struct group *gr2) if (gr1->gr_mem != gr2->gr_mem) return (false); } else { - for (found = false, gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; - gr1_ndx++) { - for (gr2_ndx = 0; gr2->gr_mem[gr2_ndx] != NULL; - gr2_ndx++) + for (gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) { + for (gr2_ndx = 0;; gr2_ndx++) { + if (gr2->gr_mem[gr2_ndx] == NULL) + return (false); if (strcmp(gr1->gr_mem[gr1_ndx], gr2->gr_mem[gr2_ndx]) == 0) { - found = true; break; } - if (!found) - return (false); + } } /* Check that group2 does not have more members than group1. */ -- cgit v1.1 From c942285112a9fbe906033157e30ef8176d864337 Mon Sep 17 00:00:00 2001 From: mjg Date: Sun, 13 Jan 2013 21:26:57 +0000 Subject: libutil: move group_line_format into the scop of its only user. Submitted by: Christoph Mallon --- lib/libutil/gr_util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c index 5e35ebe..70a4c03 100644 --- a/lib/libutil/gr_util.c +++ b/lib/libutil/gr_util.c @@ -50,8 +50,6 @@ static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; -static const char group_line_format[] = "%s:%s:%ju:"; - /* * Initialize statics */ @@ -391,6 +389,7 @@ gr_equal(const struct group *gr1, const struct group *gr2) char * gr_make(const struct group *gr) { + const char *group_line_format = "%s:%s:%ju:"; char *line; size_t line_size; int ndx; -- cgit v1.1 From fecf48554c4a48311d707e584ba242e1a1e8243f Mon Sep 17 00:00:00 2001 From: mjg Date: Sun, 13 Jan 2013 21:28:47 +0000 Subject: libutil: utilize strsep instead of strcat in a loop in gr_make Submitted by: Christoph Mallon --- lib/libutil/gr_util.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c index 70a4c03..451a4a4 100644 --- a/lib/libutil/gr_util.c +++ b/lib/libutil/gr_util.c @@ -390,7 +390,9 @@ char * gr_make(const struct group *gr) { const char *group_line_format = "%s:%s:%ju:"; + const char *sep; char *line; + char *p; size_t line_size; int ndx; @@ -405,16 +407,18 @@ gr_make(const struct group *gr) } /* Create the group line and fill it. */ - if ((line = malloc(line_size)) == NULL) + if ((line = p = malloc(line_size)) == NULL) return (NULL); - snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd, + p += sprintf(p, group_line_format, gr->gr_name, gr->gr_passwd, (uintmax_t)gr->gr_gid); - if (gr->gr_mem != NULL) + if (gr->gr_mem != NULL) { + sep = ""; for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { - strcat(line, gr->gr_mem[ndx]); - if (gr->gr_mem[ndx + 1] != NULL) - strcat(line, ","); + p = stpcpy(p, sep); + p = stpcpy(p, gr->gr_mem[ndx]); + sep = ","; } + } return (line); } -- cgit v1.1 From 89fb0f254358fa3cbe1f95560d01fbec42006840 Mon Sep 17 00:00:00 2001 From: mjg Date: Sun, 13 Jan 2013 22:08:18 +0000 Subject: libutil: fix typo in comment for gr_fini. Submitted by: Christoph Mallon --- lib/libutil/gr_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c index 451a4a4..3f7e199 100644 --- a/lib/libutil/gr_util.c +++ b/lib/libutil/gr_util.c @@ -316,7 +316,7 @@ gr_mkdb(void) } /* - * Clean up. Preserver errno for the caller's convenience. + * Clean up. Preserves errno for the caller's convenience. */ void gr_fini(void) -- cgit v1.1 From 01fbf755f7ffdfa6fff78e7de2f20c60f11b2605 Mon Sep 17 00:00:00 2001 From: zont Date: Tue, 15 Jan 2013 14:09:08 +0000 Subject: - Use standard RETURN VALUES section. Approved by: kib (mentor) MFC after: 1 week --- lib/libc/sys/chroot.2 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/libc/sys/chroot.2 b/lib/libc/sys/chroot.2 index 060d064..36d0364 100644 --- a/lib/libc/sys/chroot.2 +++ b/lib/libc/sys/chroot.2 @@ -92,12 +92,8 @@ system call. Any other value for .Ql kern.chroot_allow_open_directories will bypass the check for open directories -.Pp -Upon successful completion, a value of 0 is returned. -Otherwise, -a value of -1 is returned and -.Va errno -is set to indicate an error. +.Sh RETURN VALUES +.Rv -std .Sh ERRORS The .Fn chroot -- cgit v1.1