summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-01-17 07:04:37 +0000
committerneel <neel@FreeBSD.org>2013-01-17 07:04:37 +0000
commitd20dd131b5d2bbd1178a4ea9124b83aa7f9576df (patch)
tree3c8bad9569de99664550198eec8885bbdf6edf93 /lib
parentdee2455ab597b46c857f50c31c4ae88b56c694d4 (diff)
parentecb4042c11ebefee647476c31655e844f5e32bfe (diff)
downloadFreeBSD-src-d20dd131b5d2bbd1178a4ea9124b83aa7f9576df.zip
FreeBSD-src-d20dd131b5d2bbd1178a4ea9124b83aa7f9576df.tar.gz
IFC @ r245509
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/Makefile.inc1
-rw-r--r--lib/libc/gen/Symbol.map4
-rw-r--r--lib/libc/net/name6.c10
-rw-r--r--lib/libc/sys/chroot.28
-rw-r--r--lib/libedit/editline.32
-rw-r--r--lib/libedit/editrc.57
-rw-r--r--lib/libradius/libradius.32
-rw-r--r--lib/libutil/gr_util.c34
8 files changed, 38 insertions, 30 deletions
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
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;
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index 0031f46..f360162 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 INET6
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
@@ -285,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);
@@ -309,7 +313,7 @@ getipnodebyname(const char *name, int af, int flags, int *errp)
*errp = statp->res_h_errno;
statp->options = options;
- return _hpreorder(_hpsort(hp, statp));
+ return _hpsort(hp, statp);
}
struct hostent *
@@ -632,6 +636,7 @@ _hpsort(struct hostent *hp, res_state statp)
return hp;
}
+#ifdef INET6
/*
* _hpreorder: sort address by default address selection
*/
@@ -1109,3 +1114,4 @@ gai_addr2scopetype(struct sockaddr *sa)
return(-1);
}
}
+#endif
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
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
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 ,
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
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index acb9767..3f7e199 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
*/
@@ -318,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)
@@ -346,7 +344,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 +364,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. */
@@ -394,7 +389,10 @@ 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:";
+ const char *sep;
char *line;
+ char *p;
size_t line_size;
int ndx;
@@ -409,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);
}
OpenPOWER on IntegriCloud