diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-07-19 11:47:13 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-07-19 11:47:13 +0000 |
commit | 62ae06fb599ccdbf3a97e6c584e0a055e763e2e9 (patch) | |
tree | f860ab2ee5e074220a95e1b46080a61a71edefd6 | |
parent | 7cbfae1c5ff60dcbb4e007dcc2e6997eba63c207 (diff) | |
parent | 955eb5e1fb25fc64c2c34501c3d9426057e3b1f8 (diff) | |
download | illumos-joyent-62ae06fb599ccdbf3a97e6c584e0a055e763e2e9.tar.gz |
[illumos-gate merge]
commit 955eb5e1fb25fc64c2c34501c3d9426057e3b1f8
10167 unable to check out illumos-gate on Windows
commit 4c6a557ef3ee09ce3af0b3773cf03d745a0bdcb6
11305 add smartos runfile to zfs test suite
commit 7ae7577ce925f555e5e3410f14a3ccc896c842f2
11462 enable smatch by default
Conflicts:
usr/src/test/zfs-tests/runfiles/smartos.run
-rw-r--r-- | usr/src/Makefile.smatch | 4 | ||||
-rw-r--r-- | usr/src/cmd/mailx/Makefile | 5 | ||||
-rw-r--r-- | usr/src/cmd/mailx/util.c (renamed from usr/src/cmd/mailx/aux.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/Makefile | 6 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/Makefile (renamed from usr/src/cmd/sendmail/aux/Makefile) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/editmap.c (renamed from usr/src/cmd/sendmail/aux/editmap.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/etrn.pl (renamed from usr/src/cmd/sendmail/aux/etrn.pl) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/mail.local.c (renamed from usr/src/cmd/sendmail/aux/mail.local.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/mailcompat.c (renamed from usr/src/cmd/sendmail/aux/mailcompat.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/mailq.c (renamed from usr/src/cmd/sendmail/aux/mailq.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/mailstats.c (renamed from usr/src/cmd/sendmail/aux/mailstats.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/makemap.c (renamed from usr/src/cmd/sendmail/aux/makemap.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/mconnect.c (renamed from usr/src/cmd/sendmail/aux/mconnect.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/praliases.c (renamed from usr/src/cmd/sendmail/aux/praliases.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/rfc2047.c (renamed from usr/src/cmd/sendmail/aux/rfc2047.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/smrsh.c (renamed from usr/src/cmd/sendmail/aux/smrsh.c) | 0 | ||||
-rw-r--r-- | usr/src/cmd/sendmail/util/vacation.c (renamed from usr/src/cmd/sendmail/aux/vacation.c) | 0 | ||||
-rw-r--r-- | usr/src/data/locale/Makefile | 9 | ||||
l--------- | usr/src/data/locale/data/zz_AA.UTF-8.src | 1 | ||||
-rw-r--r-- | usr/src/pkg/manifests/system-test-zfstest.mf | 1 | ||||
-rw-r--r-- | usr/src/tools/env/illumos.sh | 4 | ||||
-rw-r--r-- | usr/src/tools/scripts/git-pbchk.py | 83 | ||||
-rw-r--r-- | usr/src/tools/smatch/Makefile | 4 | ||||
-rw-r--r-- | usr/src/tools/smatch/src/smatch.c | 11 | ||||
-rw-r--r-- | usr/src/tools/smatch/src/smatch.h | 3 | ||||
-rw-r--r-- | usr/src/tools/smatch/src/smatch_implied.c | 6 |
26 files changed, 118 insertions, 19 deletions
diff --git a/usr/src/Makefile.smatch b/usr/src/Makefile.smatch index 028bbf9153..27f302cb47 100644 --- a/usr/src/Makefile.smatch +++ b/usr/src/Makefile.smatch @@ -8,7 +8,7 @@ # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # -# Copyright (c) 2019, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # # @@ -27,6 +27,8 @@ SMATCH_ARGS += -Wno-external-function-has-definition # we have lots of legacy "void foo();" in headers SMATCH_ARGS += -Wno-old-style-definition SMATCH_ARGS += -Wno-strict-prototypes +SMATCH_ARGS += --fatal-checks +SMATCH_ARGS += --timeout=120 CERRWARN += $(SMATCH_ARGS:%=-_smatch=%) diff --git a/usr/src/cmd/mailx/Makefile b/usr/src/cmd/mailx/Makefile index 939ed76141..57bc1bcfe5 100644 --- a/usr/src/cmd/mailx/Makefile +++ b/usr/src/cmd/mailx/Makefile @@ -23,18 +23,19 @@ # Use is subject to license terms. # # Copyright 2018 Joyent, Inc. +# Copyright 2019 Garrett D'Amore <garrett@damore.org> # # cmd/mailx/Makefile PROG= mailx -OBJS= myfopen.o aux.o cmd1.o cmd2.o cmd3.o \ +OBJS= myfopen.o cmd1.o cmd2.o cmd3.o \ cmd4.o cmdtab.o collect.o config.o edit.o \ init.o fio.o getname.o head.o \ hostname.o lex.o list.o lock.o lpaths.o \ main.o names.o optim.o popen.o quit.o \ receipt.o send.o sigretro.o stralloc.o temp.o \ - translate.o tty.o usg.local.o vars.o + translate.o tty.o usg.local.o util.o vars.o SRCS= $(OBJS:.o=.c) diff --git a/usr/src/cmd/mailx/aux.c b/usr/src/cmd/mailx/util.c index 09d0b5d018..09d0b5d018 100644 --- a/usr/src/cmd/mailx/aux.c +++ b/usr/src/cmd/mailx/util.c diff --git a/usr/src/cmd/sendmail/Makefile b/usr/src/cmd/sendmail/Makefile index 604b8d2959..ff427c0fde 100644 --- a/usr/src/cmd/sendmail/Makefile +++ b/usr/src/cmd/sendmail/Makefile @@ -23,14 +23,16 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2019 Garrett D'Amore <garrett@damore.org> +# # cmd/sendmail/Makefile # # Makefile for top level sendmail source directory # # static libraries (db, libsm, libsmdb, libsmutil) must be built before -# src and aux -SUBDIRS= cf lib db libsm libsmdb libsmutil .WAIT src aux +# src and util +SUBDIRS= cf lib db libsm libsmdb libsmutil .WAIT src util include ../Makefile.cmd diff --git a/usr/src/cmd/sendmail/aux/Makefile b/usr/src/cmd/sendmail/util/Makefile index 455879af02..455879af02 100644 --- a/usr/src/cmd/sendmail/aux/Makefile +++ b/usr/src/cmd/sendmail/util/Makefile diff --git a/usr/src/cmd/sendmail/aux/editmap.c b/usr/src/cmd/sendmail/util/editmap.c index a86a24d456..a86a24d456 100644 --- a/usr/src/cmd/sendmail/aux/editmap.c +++ b/usr/src/cmd/sendmail/util/editmap.c diff --git a/usr/src/cmd/sendmail/aux/etrn.pl b/usr/src/cmd/sendmail/util/etrn.pl index fc067b1a6a..fc067b1a6a 100644 --- a/usr/src/cmd/sendmail/aux/etrn.pl +++ b/usr/src/cmd/sendmail/util/etrn.pl diff --git a/usr/src/cmd/sendmail/aux/mail.local.c b/usr/src/cmd/sendmail/util/mail.local.c index 0d04d3c58c..0d04d3c58c 100644 --- a/usr/src/cmd/sendmail/aux/mail.local.c +++ b/usr/src/cmd/sendmail/util/mail.local.c diff --git a/usr/src/cmd/sendmail/aux/mailcompat.c b/usr/src/cmd/sendmail/util/mailcompat.c index aefc3dcfe5..aefc3dcfe5 100644 --- a/usr/src/cmd/sendmail/aux/mailcompat.c +++ b/usr/src/cmd/sendmail/util/mailcompat.c diff --git a/usr/src/cmd/sendmail/aux/mailq.c b/usr/src/cmd/sendmail/util/mailq.c index 4fadd88ff0..4fadd88ff0 100644 --- a/usr/src/cmd/sendmail/aux/mailq.c +++ b/usr/src/cmd/sendmail/util/mailq.c diff --git a/usr/src/cmd/sendmail/aux/mailstats.c b/usr/src/cmd/sendmail/util/mailstats.c index 6c5f9a18f8..6c5f9a18f8 100644 --- a/usr/src/cmd/sendmail/aux/mailstats.c +++ b/usr/src/cmd/sendmail/util/mailstats.c diff --git a/usr/src/cmd/sendmail/aux/makemap.c b/usr/src/cmd/sendmail/util/makemap.c index 3b4ab68ba5..3b4ab68ba5 100644 --- a/usr/src/cmd/sendmail/aux/makemap.c +++ b/usr/src/cmd/sendmail/util/makemap.c diff --git a/usr/src/cmd/sendmail/aux/mconnect.c b/usr/src/cmd/sendmail/util/mconnect.c index 3a4f1fa0e1..3a4f1fa0e1 100644 --- a/usr/src/cmd/sendmail/aux/mconnect.c +++ b/usr/src/cmd/sendmail/util/mconnect.c diff --git a/usr/src/cmd/sendmail/aux/praliases.c b/usr/src/cmd/sendmail/util/praliases.c index 8839334286..8839334286 100644 --- a/usr/src/cmd/sendmail/aux/praliases.c +++ b/usr/src/cmd/sendmail/util/praliases.c diff --git a/usr/src/cmd/sendmail/aux/rfc2047.c b/usr/src/cmd/sendmail/util/rfc2047.c index 8092a9a587..8092a9a587 100644 --- a/usr/src/cmd/sendmail/aux/rfc2047.c +++ b/usr/src/cmd/sendmail/util/rfc2047.c diff --git a/usr/src/cmd/sendmail/aux/smrsh.c b/usr/src/cmd/sendmail/util/smrsh.c index 32d9afa8eb..32d9afa8eb 100644 --- a/usr/src/cmd/sendmail/aux/smrsh.c +++ b/usr/src/cmd/sendmail/util/smrsh.c diff --git a/usr/src/cmd/sendmail/aux/vacation.c b/usr/src/cmd/sendmail/util/vacation.c index 5a0f93756d..5a0f93756d 100644 --- a/usr/src/cmd/sendmail/aux/vacation.c +++ b/usr/src/cmd/sendmail/util/vacation.c diff --git a/usr/src/data/locale/Makefile b/usr/src/data/locale/Makefile index 3f3cf0b003..e3313f5f58 100644 --- a/usr/src/data/locale/Makefile +++ b/usr/src/data/locale/Makefile @@ -14,6 +14,7 @@ # Copyright 2011 EveryCity Ltd. All rights reserved. # Copyright 2013 DEY Storage Systems, Inc. # Copyright 2016 Joyent, Inc. +# Copyright 2019 Garrett D'Amore <garrett@damore.org> # include $(SRC)/data/Makefile.data @@ -128,6 +129,14 @@ locale/%.UTF-8/stamp: data/%.UTF-8.src data/UTF-8.cm data/common.UTF-8.src $(LCDEF) -U -w data/widths.txt -f data/UTF-8.cm $(@D) $(TOUCH) $@ +# Special handling for zz_AA test locale +locale/zz_AA.UTF-8/stamp: data/en_US.UTF-8.src data/UTF-8.cm data/common.UTF-8.src + $(SED) \ + -e '/^LC_CTYPE/,/^END LC_CTYPE/d' \ + -e '$$r data/common.UTF-8.src' data/en_US.UTF-8.src | \ + $(LCDEF) -U -w data/widths.txt -f data/UTF-8.cm $(@D) + $(TOUCH) $@ + locale/%/$(DCOLL): locale/%/stamp locale/%/$(DCTYPE): locale/%/stamp locale/%/$(DMSGS): locale/%/stamp diff --git a/usr/src/data/locale/data/zz_AA.UTF-8.src b/usr/src/data/locale/data/zz_AA.UTF-8.src deleted file mode 120000 index 8a3463821d..0000000000 --- a/usr/src/data/locale/data/zz_AA.UTF-8.src +++ /dev/null @@ -1 +0,0 @@ -en_US.UTF-8.src
\ No newline at end of file diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf index 9e74a15465..22be5b30f2 100644 --- a/usr/src/pkg/manifests/system-test-zfstest.mf +++ b/usr/src/pkg/manifests/system-test-zfstest.mf @@ -207,6 +207,7 @@ file path=opt/zfs-tests/runfiles/longevity.run mode=0444 file path=opt/zfs-tests/runfiles/omnios.run mode=0444 file path=opt/zfs-tests/runfiles/openindiana.run mode=0444 file path=opt/zfs-tests/runfiles/perf-regression.run mode=0444 +file path=opt/zfs-tests/runfiles/smartos.run mode=0444 file path=opt/zfs-tests/runfiles/stress.run mode=0444 file path=opt/zfs-tests/tests/functional/acl/acl.cfg mode=0444 file path=opt/zfs-tests/tests/functional/acl/acl_common.kshlib mode=0444 diff --git a/usr/src/tools/env/illumos.sh b/usr/src/tools/env/illumos.sh index 1a81a2488d..fd687390d2 100644 --- a/usr/src/tools/env/illumos.sh +++ b/usr/src/tools/env/illumos.sh @@ -84,8 +84,8 @@ export PRIMARY_CCCS=gcc7,$GNUC_ROOT/bin/g++,gnu export SHADOW_CCS=gcc4,/opt/gcc/4.4.4/bin/gcc,gnu export SHADOW_CCCS=gcc4,/opt/gcc/4.4.4/bin/g++,gnu -# uncomment to enable smatch -#export ENABLE_SMATCH=1 +# comment to disable smatch +export ENABLE_SMATCH=1 # Comment this out to disable support for SMB printing, i.e. if you # don't want to bother providing the CUPS headers this needs. diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index 559cf7e9e5..99bce29087 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -17,7 +17,7 @@ # # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2008, 2012 Richard Lowe -# Copyright 2014 Garrett D'Amore <garrett@damore.org> +# Copyright 2019 Garrett D'Amore <garrett@damore.org> # Copyright (c) 2015, 2016 by Delphix. All rights reserved. # Copyright 2016 Nexenta Systems, Inc. # Copyright (c) 2019, Joyent, Inc. @@ -175,11 +175,14 @@ def not_check(root, cmd): os.path.join(root, "exception_lists", cmd)])) return Ignore.ignore(root, ignorefiles) -def gen_files(root, parent, paths, exclude): +def gen_files(root, parent, paths, exclude, filter=None): """Return a function producing file names, relative to the current directory, of any file changed on this branch (limited to 'paths' if requested), and excluding files for which exclude returns a true value """ + if filter is None: + filter = lambda x: os.path.isfile(x) + # Taken entirely from Python 2.6's os.path.relpath which we would use if we # could. def relpath(path, here): @@ -204,11 +207,18 @@ def gen_files(root, parent, paths, exclude): # will be caught by other invocations of git(). continue empty = not res - if (os.path.isfile(path) and not empty and + if (filter(path) and not empty and select(path) and not exclude(abspath)): yield path return ret +def gen_links(root, parent, paths, exclude): + """Return a function producing symbolic link names, relative to the current + directory, of any file changed on this branch (limited to 'paths' if + requested), and excluding files for which exclude returns a true value """ + + return gen_files(root, parent, paths, exclude, lambda x: os.path.islink(x)) + def comchk(root, parent, flist, output): output.write("Comments:\n") @@ -300,7 +310,53 @@ def wscheck(root, parent, flist, output): ret |= WsCheck.wscheck(fh, output=output) return ret -def run_checks(root, parent, cmds, paths='', opts={}): +def symlinks(root, parent, flist, output): + ret = 0 + output.write("Symbolic links:\n") + for f in flist(): + output.write(" "+f+"\n") + ret |= 1 + return ret + +def iswinreserved(name): + reserved = [ + 'con', 'prn', 'aux', 'nul', + 'com1', 'com2', 'com3', 'com4', 'com5', + 'com6', 'com7', 'com8', 'com9', 'com0', + 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', + 'lpt6', 'lpt7', 'lpt8', 'lpt9', 'lpt0' ] + l = name.lower() + for r in reserved: + if l == r or l.startswith(r+"."): + return True + return False + +def haswinspecial(name): + specials = '<>:"\\|?*' + for c in name: + if c in specials: + return True + return False + +def winnames(root, parent, flist, output): + ret = 0 + output.write("Illegal filenames (Windows):\n") + for f in flist(): + if haswinspecial(f): + output.write(" "+f+": invalid character in name\n") + ret |= 1 + continue + + parts = f.split('/') + for p in parts: + if iswinreserved(p): + output.write(" "+f+": reserved file name\n") + ret |= 1 + break + + return ret + +def run_checks(root, parent, cmds, scmds, paths='', opts={}): """Run the checks given in 'cmds', expected to have well-known signatures, and report results for any which fail. @@ -322,6 +378,17 @@ def run_checks(root, parent, cmds, paths='', opts={}): if result != 0: print(s.getvalue()) + for cmd in scmds: + s = StringIO() + + exclude = not_check(root, cmd.__name__) + result = cmd(root, parent, gen_links(root, parent, paths, exclude), + output=s) + ret |= result + + if result != 0: + print(s.getvalue()) + return ret def nits(root, parent, paths): @@ -332,8 +399,10 @@ def nits(root, parent, paths): keywords, manlint, mapfilechk, + winnames, wscheck] - run_checks(root, parent, cmds, paths) + scmds = [symlinks] + run_checks(root, parent, cmds, scmds, paths) def pbchk(root, parent, paths): cmds = [comchk, @@ -344,8 +413,10 @@ def pbchk(root, parent, paths): keywords, manlint, mapfilechk, + winnames, wscheck] - run_checks(root, parent, cmds) + scmds = [symlinks] + run_checks(root, parent, cmds, scmds) def main(cmd, args): parent_branch = None diff --git a/usr/src/tools/smatch/Makefile b/usr/src/tools/smatch/Makefile index b876b8bb36..c127b68b2d 100644 --- a/usr/src/tools/smatch/Makefile +++ b/usr/src/tools/smatch/Makefile @@ -13,14 +13,14 @@ # # The src/ sub-directory is un-modified copy of -# https://github.com/illumos/smatch/tree/0.5.1-il-1 +# https://github.com/illumos/smatch/tree/0.5.1-il-3 # # This Makefile installs just enough for us to be able to run smatch # locally. # PROG = smatch -SPARSE_VERSION = 0.5.1-il-1 +SPARSE_VERSION = 0.5.1-il-3 include ../Makefile.tools diff --git a/usr/src/tools/smatch/src/smatch.c b/usr/src/tools/smatch/src/smatch.c index 0675284796..450caeef40 100644 --- a/usr/src/tools/smatch/src/smatch.c +++ b/usr/src/tools/smatch/src/smatch.c @@ -13,6 +13,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt + * + * Copyright 2019 Joyent, Inc. */ #include <stdio.h> @@ -43,6 +45,7 @@ int option_mem; char *option_datadir_str; int option_fatal_checks; int option_succeed; +int option_timeout = 60; FILE *sm_outfd; FILE *sql_outfd; @@ -173,7 +176,7 @@ static int match_option(const char *arg, const char *option) } #define OPTION(_x) do { \ - if (match_option((*argvp)[1], #_x)) { \ + if (match_option((*argvp)[i], #_x)) { \ option_##_x = 1; \ } \ } while (0) @@ -218,6 +221,12 @@ void parse_args(int *argcp, char ***argvp) option_disable = 1; } + if (!strncmp((*argvp)[i], "--timeout=", 10)) { + if (sscanf((*argvp)[i] + 10, "%d", + &option_timeout) != 1) + sm_fatal("invalid option %s", (*argvp)[i]); + } + OPTION(fatal_checks); OPTION(spammy); OPTION(info); diff --git a/usr/src/tools/smatch/src/smatch.h b/usr/src/tools/smatch/src/smatch.h index b276ec125d..285321b039 100644 --- a/usr/src/tools/smatch/src/smatch.h +++ b/usr/src/tools/smatch/src/smatch.h @@ -13,6 +13,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt + * + * Copyright 2019 Joyent, Inc. */ #ifndef SMATCH_H_ @@ -200,6 +202,7 @@ extern int option_debug; extern int local_debug; extern int option_info; extern int option_spammy; +extern int option_timeout; extern char *trace_variable; extern struct stree *global_states; int is_skipped_function(void); diff --git a/usr/src/tools/smatch/src/smatch_implied.c b/usr/src/tools/smatch/src/smatch_implied.c index 441920c17d..ae5ff1dc4c 100644 --- a/usr/src/tools/smatch/src/smatch_implied.c +++ b/usr/src/tools/smatch/src/smatch_implied.c @@ -13,6 +13,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt + * + * Copyright 2019 Joyent, Inc. */ /* @@ -397,7 +399,7 @@ static int taking_too_long(void) if (out_of_memory()) return 1; - if (time_parsing_function() < 60) + if (time_parsing_function() < option_timeout) return 0; if (!__inline_fn && printed != cur_func_sym) { @@ -593,7 +595,7 @@ static void separate_and_filter(struct sm_state *sm, int comparison, struct rang gettimeofday(&time_after, NULL); sec = time_after.tv_sec - time_before.tv_sec; - if (sec > 20) { + if (sec > option_timeout) { sm->nr_children = 4000; sm_perror("Function too hairy. Ignoring implications after %d seconds.", sec); } |