svn commit: r350338 - in stable: 11/sbin/bectl 11/stand/libsa/zfs 12/sbin/bectl
Kyle Evans
kevans at FreeBSD.org
Fri Jul 26 01:35:07 UTC 2019
Author: kevans
Date: Fri Jul 26 01:35:06 2019
New Revision: 350338
URL: https://svnweb.freebsd.org/changeset/base/350338
Log:
MFC r348328: bectl(8): Address Coverity complaints
CID 1400451: case 0 is missing a break/return and falling through to the
default case. waitpid(0, ...) makes little sense in the child, we likely
wanted to terminate immediately.
CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *)
and is assigned to a char **; sizeof's match but "this isn't a portable
assumption".
CID: 1400451, 1400453
Modified:
stable/11/sbin/bectl/bectl_jail.c
stable/11/stand/libsa/zfs/zfs.c
Directory Properties:
stable/11/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/12/sbin/bectl/bectl_jail.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/11/sbin/bectl/bectl_jail.c
==============================================================================
--- stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 00:27:47 2019 (r350337)
+++ stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:35:06 2019 (r350338)
@@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg
nargv += argc;
}
- jargv = *argvp = calloc(nargv, sizeof(jargv));
+ jargv = *argvp = calloc(nargv, sizeof(*jargv));
if (jargv == NULL)
err(2, "calloc");
@@ -346,6 +346,7 @@ bectl_cmd_jail(int argc, char *argv[])
case 0:
execv("/usr/sbin/jail", jargv);
fprintf(stderr, "bectl jail: failed to execute\n");
+ return (1);
default:
waitpid(pid, NULL, 0);
}
Modified: stable/11/stand/libsa/zfs/zfs.c
==============================================================================
--- stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 00:27:47 2019 (r350337)
+++ stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 01:35:06 2019 (r350338)
@@ -578,11 +578,10 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid
pa.fd = open(devname, O_RDONLY);
if (pa.fd == -1)
return (ENXIO);
- /*
- * We will not probe the whole disk, we can not boot from such
- * disks and some systems will misreport the disk sizes and will
- * hang while accessing the disk.
- */
+ /* Probe the whole disk */
+ ret = zfs_probe(pa.fd, pool_guid);
+ if (ret == 0)
+ return (0);
if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) {
int partition = dev->d_partition;
int slice = dev->d_slice;
More information about the svn-src-all
mailing list