summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-05-19 10:45:17 -0300
committerRenato Botelho <renato@netgate.com>2016-05-19 10:45:17 -0300
commit57a447a9c3cb69fb2e4f874104327cdc3203313a (patch)
tree5f882a4db4469e125c743f84b4f8998df4f015c3 /usr.sbin
parent5cf4da15d7c435594db5cc482d961f98986d0808 (diff)
parent0412106b46a9cffa2790ddc17339d96c0dc607c9 (diff)
downloadFreeBSD-src-57a447a9c3cb69fb2e4f874104327cdc3203313a.zip
FreeBSD-src-57a447a9c3cb69fb2e4f874104327cdc3203313a.tar.gz
Merge remote-tracking branch 'origin/master' into devel-11
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr2
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/Makefile1
-rw-r--r--usr.sbin/iscsid/login.c44
-rw-r--r--usr.sbin/makefs/cd9660.c13
-rw-r--r--usr.sbin/makefs/ffs.c6
-rw-r--r--usr.sbin/makefs/mtree.c2
-rw-r--r--usr.sbin/pciconf/pciconf.82
-rw-r--r--usr.sbin/ppp/link.c14
-rw-r--r--usr.sbin/rarpd/rarpd.c2
-rw-r--r--usr.sbin/rpc.lockd/lock_proc.c2
-rw-r--r--usr.sbin/rpc.statd/file.c12
11 files changed, 75 insertions, 25 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index 17e7b4a..a802efe 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -1815,7 +1815,7 @@ f_dialog_inputstr_fetch()
# f_dialog_input $var_to_set $prompt [$init [$hline]]
#
# Prompt the user with a dialog(1) inputbox to enter some value. The inputbox
-# remains until the the user presses ENTER or ESC, or otherwise ends the
+# remains until the user presses ENTER or ESC, or otherwise ends the
# editing session (by selecting `Cancel' for example).
#
# If the user presses ENTER, the exit status is zero (success), otherwise if
diff --git a/usr.sbin/bsnmpd/bsnmpd/Makefile b/usr.sbin/bsnmpd/bsnmpd/Makefile
index 1cf4a8b..e4106e0 100644
--- a/usr.sbin/bsnmpd/bsnmpd/Makefile
+++ b/usr.sbin/bsnmpd/bsnmpd/Makefile
@@ -47,6 +47,7 @@ MANFILTER= sed -e 's%@MODPATH@%${LIBDIR}/%g' \
-e 's%@DEFPATH@%${DEFSDIR}/%g' \
-e 's%@MIBSPATH@%${BMIBSDIR}/%g'
+NO_WCAST_ALIGN= yes
WARNS?= 6
.include <bsd.prog.mk>
diff --git a/usr.sbin/iscsid/login.c b/usr.sbin/iscsid/login.c
index ed0b9bf..6abb9d6 100644
--- a/usr.sbin/iscsid/login.c
+++ b/usr.sbin/iscsid/login.c
@@ -422,8 +422,38 @@ login_negotiate_key(struct connection *conn, const char *name,
/* Ignore */
} else if (strcmp(name, "IFMarker") == 0) {
/* Ignore */
+ } else if (strcmp(name, "RDMAExtensions") == 0) {
+ if (conn->conn_conf.isc_iser == 1 &&
+ strcmp(value, "Yes") != 0) {
+ log_errx(1, "received unsupported RDMAExtensions");
+ }
+ } else if (strcmp(name, "InitiatorRecvDataSegmentLength") == 0) {
+ tmp = strtoul(value, NULL, 10);
+ if (tmp <= 0)
+ log_errx(1, "received invalid "
+ "InitiatorRecvDataSegmentLength");
+ if ((size_t)tmp > conn->conn_limits.isl_max_data_segment_length) {
+ log_debugx("capping InitiatorRecvDataSegmentLength "
+ "from %d to %zd", tmp,
+ conn->conn_limits.isl_max_data_segment_length);
+ tmp = conn->conn_limits.isl_max_data_segment_length;
+ }
+ conn->conn_max_data_segment_length = tmp;
} else if (strcmp(name, "TargetPortalGroupTag") == 0) {
/* Ignore */
+ } else if (strcmp(name, "TargetRecvDataSegmentLength") == 0) {
+ tmp = strtoul(value, NULL, 10);
+ if (tmp <= 0) {
+ log_errx(1,
+ "received invalid TargetRecvDataSegmentLength");
+ }
+ if ((size_t)tmp > conn->conn_limits.isl_max_data_segment_length) {
+ log_debugx("capping TargetRecvDataSegmentLength "
+ "from %d to %zd", tmp,
+ conn->conn_limits.isl_max_data_segment_length);
+ tmp = conn->conn_limits.isl_max_data_segment_length;
+ }
+ conn->conn_max_data_segment_length = tmp;
} else {
log_debugx("unknown key \"%s\"; ignoring", name);
}
@@ -465,13 +495,23 @@ login_negotiate(struct connection *conn)
conn->conn_limits.isl_max_data_segment_length);
keys_add(request_keys, "InitialR2T", "Yes");
keys_add(request_keys, "MaxOutstandingR2T", "1");
+ if (conn->conn_conf.isc_iser == 1) {
+ keys_add_int(request_keys, "InitiatorRecvDataSegmentLength",
+ conn->conn_limits.isl_max_data_segment_length);
+ keys_add_int(request_keys, "TargetRecvDataSegmentLength",
+ conn->conn_limits.isl_max_data_segment_length);
+ keys_add(request_keys, "RDMAExtensions", "Yes");
+ } else {
+ keys_add_int(request_keys, "MaxRecvDataSegmentLength",
+ conn->conn_limits.isl_max_data_segment_length);
+ }
} else {
keys_add(request_keys, "HeaderDigest", "None");
keys_add(request_keys, "DataDigest", "None");
+ keys_add_int(request_keys, "MaxRecvDataSegmentLength",
+ conn->conn_limits.isl_max_data_segment_length);
}
- keys_add_int(request_keys, "MaxRecvDataSegmentLength",
- conn->conn_limits.isl_max_data_segment_length);
keys_add(request_keys, "DefaultTime2Wait", "0");
keys_add(request_keys, "DefaultTime2Retain", "0");
keys_add(request_keys, "ErrorRecoveryLevel", "0");
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index e05e52a..3f55b8d 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -685,6 +685,9 @@ cd9660_finalize_PVD(void)
cd9660_time_8426(
(unsigned char *)diskStructure.primaryDescriptor.effective_date,
tim);
+ /* make this sane */
+ cd9660_time_915(diskStructure.rootNode->dot_record->isoDirRecord->date,
+ tim);
}
static void
@@ -774,7 +777,7 @@ cd9660_setup_volume_descriptors(void)
temp->next = t;
memset(t->volumeDescriptorData, 0, 2048);
t->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_TERMINATOR;
- t->next = 0;
+ t->next = NULL;
t->volumeDescriptorData[6] = 1;
t->sector = sector;
memcpy(t->volumeDescriptorData + 1,
@@ -1403,7 +1406,7 @@ cd9660_convert_structure(fsnode *root, cd9660node *parent_node, int level,
this_node->level =
working_level - 1;
if (cd9660_rrip_move_directory(
- this_node) == 0) {
+ this_node) == NULL) {
warnx("Failure in "
"cd9660_rrip_"
"move_directory"
@@ -1416,7 +1419,7 @@ cd9660_convert_structure(fsnode *root, cd9660node *parent_node, int level,
}
/* Do the recursive call on the children */
- if (iterator->child != 0) {
+ if (iterator->child != NULL) {
cd9660_convert_structure(
iterator->child, this_node,
working_level,
@@ -1445,7 +1448,7 @@ cd9660_convert_structure(fsnode *root, cd9660node *parent_node, int level,
}
/*Allocate new temp_node */
- if (iterator->next != 0) {
+ if (iterator->next != NULL) {
this_node = cd9660_allocate_cd9660node();
if (this_node == NULL)
CD9660_MEM_ALLOC_ERROR(__func__);
@@ -1733,7 +1736,7 @@ cd9660_convert_filename(const char *oldname, char *newname, int is_file)
{
assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2);
/* NEW */
- cd9660_filename_conversion_functor conversion_function = 0;
+ cd9660_filename_conversion_functor conversion_function = NULL;
if (diskStructure.isoLevel == 1)
conversion_function = &cd9660_level1_convert_filename;
else if (diskStructure.isoLevel == 2)
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c
index dd97c01..dc749dc 100644
--- a/usr.sbin/makefs/ffs.c
+++ b/usr.sbin/makefs/ffs.c
@@ -1125,9 +1125,13 @@ ffs_write_inode(union dinode *dp, uint32_t ino, const fsinfo_t *fsopts)
initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
memset(buf, 0, fs->fs_bsize);
dip = (struct ufs2_dinode *)buf;
+ /*
+ * XXX: Time-based seeds should be avoided for
+ * reproduceable builds.
+ */
srandom(time(NULL));
for (i = 0; i < INOPB(fs); i++) {
- dip->di_gen = random() / 2 + 1;
+ dip->di_gen = random();
dip++;
}
ffs_wtfs(fsbtodb(fs, ino_to_fsba(fs,
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c
index 8a687bf..532b9e4 100644
--- a/usr.sbin/makefs/mtree.c
+++ b/usr.sbin/makefs/mtree.c
@@ -150,7 +150,7 @@ mtree_file_path(fsnode *node)
depth = 0;
rp[depth] = node->name;
- for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH;
+ for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH - 1;
pnode = pnode->parent) {
if (strcmp(pnode->name, ".") == 0)
break;
diff --git a/usr.sbin/pciconf/pciconf.8 b/usr.sbin/pciconf/pciconf.8
index 705b594..f0f47b8 100644
--- a/usr.sbin/pciconf/pciconf.8
+++ b/usr.sbin/pciconf/pciconf.8
@@ -237,7 +237,7 @@ prefix indicates if the keyword is read-only
or read-write
.Dq rw .
The second string provides the keyword name.
-The text after the the equals sign lists the value of the keyword which is
+The text after the equals sign lists the value of the keyword which is
usually an ASCII string.
.Pp
If the optional
diff --git a/usr.sbin/ppp/link.c b/usr.sbin/ppp/link.c
index dc5507d..f802b95 100644
--- a/usr.sbin/ppp/link.c
+++ b/usr.sbin/ppp/link.c
@@ -209,7 +209,7 @@ static struct protostatheader {
{ PROTO_LQR, "LQR" },
{ PROTO_CHAP, "CHAP" },
{ PROTO_MP, "MULTILINK" },
- { 0, "Others" }
+ { 0, "Others" } /* must be last */
};
void
@@ -218,13 +218,13 @@ link_ProtocolRecord(struct link *l, u_short proto, int type)
int i;
for (i = 0; i < NPROTOSTAT; i++)
- if (ProtocolStat[i].number == proto)
+ if (ProtocolStat[i].number == proto || ProtocolStat[i].number == 0) {
+ if (type == PROTO_IN)
+ l->proto_in[i]++;
+ else
+ l->proto_out[i]++;
break;
-
- if (type == PROTO_IN)
- l->proto_in[i]++;
- else
- l->proto_out[i]++;
+ }
}
void
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 74f7940..2bb333c 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -739,7 +739,7 @@ update_arptab(u_char *ep, in_addr_t ipaddr)
/* Get the type and interface index */
rt = &rtmsg.rthdr;
- bzero(rt, sizeof(rtmsg));
+ bzero(&rtmsg, sizeof(rtmsg));
rt->rtm_version = RTM_VERSION;
rt->rtm_addrs = RTA_DST;
rt->rtm_type = RTM_GET;
diff --git a/usr.sbin/rpc.lockd/lock_proc.c b/usr.sbin/rpc.lockd/lock_proc.c
index 8884ad9..595d625 100644
--- a/usr.sbin/rpc.lockd/lock_proc.c
+++ b/usr.sbin/rpc.lockd/lock_proc.c
@@ -112,7 +112,7 @@ log_netobj(netobj *obj)
}
/* Prevent the security hazard from the buffer overflow */
maxlen = (obj->n_len < MAX_NETOBJ_SZ ? obj->n_len : MAX_NETOBJ_SZ);
- for (i=0, tmp1 = objvalbuffer, tmp2 = objascbuffer; i < obj->n_len;
+ for (i=0, tmp1 = objvalbuffer, tmp2 = objascbuffer; i < maxlen;
i++, tmp1 +=2, tmp2 +=1) {
sprintf(tmp1,"%02X",*(obj->n_bytes+i));
sprintf(tmp2,"%c",*(obj->n_bytes+i));
diff --git a/usr.sbin/rpc.statd/file.c b/usr.sbin/rpc.statd/file.c
index 0625e30..beef0e4 100644
--- a/usr.sbin/rpc.statd/file.c
+++ b/usr.sbin/rpc.statd/file.c
@@ -82,6 +82,7 @@ HostInfo *find_host(char *hostname, int create)
struct addrinfo *ai1, *ai2;
int i;
+ ai2 = NULL;
if (getaddrinfo(hostname, NULL, NULL, &ai1) != 0)
ai1 = NULL;
for (i = 0, hp = status_info->hosts; i < status_info->noOfHosts; i++, hp++)
@@ -91,7 +92,7 @@ HostInfo *find_host(char *hostname, int create)
result = hp;
break;
}
- if (hp->hostname[0] &&
+ if (hp->hostname[0] != '\0' &&
getaddrinfo(hp->hostname, NULL, NULL, &ai2) != 0)
ai2 = NULL;
if (ai1 && ai2)
@@ -113,8 +114,10 @@ HostInfo *find_host(char *hostname, int create)
if (result)
break;
}
- if (ai2)
+ if (ai2) {
freeaddrinfo(ai2);
+ ai2 = NULL;
+ }
if (!spare_slot && !hp->monList && !hp->notifyReqd)
spare_slot = hp;
}
@@ -134,9 +137,8 @@ HostInfo *find_host(char *hostname, int create)
if (desired_size > status_file_len)
{
/* Extend file by writing 1 byte of junk at the desired end pos */
- lseek(status_fd, desired_size - 1, SEEK_SET);
- i = write(status_fd, &i, 1);
- if (i < 1)
+ if (lseek(status_fd, desired_size - 1, SEEK_SET) == -1 ||
+ write(status_fd, "\0", 1) < 0)
{
syslog(LOG_ERR, "Unable to extend status file");
return (NULL);
OpenPOWER on IntegriCloud