diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-10-30 12:03:14 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-10-30 12:03:14 +0000 |
commit | eacc5467041c23968e9447b7143975ee4eaaeeee (patch) | |
tree | e654de48d06640d11ee4b9e815fcfecab7658bac | |
parent | d84c48b412a8b9237a5f5ebbd017bc17997a127d (diff) | |
parent | 106e8bd44b02f4b8cd3c825790276c1c7081e67a (diff) | |
download | illumos-joyent-eacc5467041c23968e9447b7143975ee4eaaeeee.tar.gz |
[illumos-gate merge]
commit 106e8bd44b02f4b8cd3c825790276c1c7081e67a
11867 PCIe expansion slots mis-labelled in topo
commit 00f453f4ebc211cb928f19a54d3f4edd61f43279
11862 cleanup smatch/cstyle/wscheck issues in usr/src/lib/sun_sas/
commit 744b124e8caed130fec6baedb0c53d1b6de03e41
11885 man3m: missing symlinks
commit 6b734416901818aa8c4bbb09c12b691ea771dc94
11858 crontab could support /step
commit ece0bc848de931052064be9faf07f4e44c150a15
11883 loader: zio_checksum_verify should check byteswap
commit 1a2641f606f3bfa50cdbbe8770af78116de52563
11521 ::whereopen should be usable in a pipeline
commit 042b56085944fdf280ee8e4a93b329c206054f88
11882 loader: rs_alloc() may return NULL
commit b12258b69ac245658b0ca5ae070b3ff004186148
11866 Use -fstack-protector-strong when available
commit 241bfedfbd27da9d3f2aa7ffaafa5da978f23afe
11842 Want audit events for auditon(A_SETPMASK) and friends
commit 8675de3a4bb7d310dd672e8f2bf479154e07c678
11872 Fix incremental recursive encrypted receive
commit 7ca0d613a17085b59a8b231daa9eddfa74fd83ee
11845 acquire-spray test could be improved
11857 kmc-update test missing from runfile
commit a0ee54468d6e6b136d1ca470a03bb44165c66e6e
11871 smatch should not hammer linux procfs path
Conflicts:
usr/src/uts/intel/Makefile.intel
usr/src/cmd/cron/cron.h
usr/src/cmd/cron/cron.c
usr/src/cmd/cron/Makefile
48 files changed, 1834 insertions, 516 deletions
@@ -16377,49 +16377,132 @@ f usr/share/man/man3lib/libxnet.3lib 0444 root bin f usr/share/man/man3lib/liby.3lib 0444 root bin d usr/share/man/man3m 0755 root bin f usr/share/man/man3m/acos.3m 0444 root bin +s usr/share/man/man3m/acosf.3m=acos.3m f usr/share/man/man3m/acosh.3m 0444 root bin +s usr/share/man/man3m/acoshf.3m=acosh.3m +s usr/share/man/man3m/acoshl.3m=acosh.3m +s usr/share/man/man3m/acosl.3m=acos.3m f usr/share/man/man3m/asin.3m 0444 root bin +s usr/share/man/man3m/asinf.3m=asin.3m f usr/share/man/man3m/asinh.3m 0444 root bin +s usr/share/man/man3m/asinhf.3m=asinh.3m +s usr/share/man/man3m/asinhl.3m=asinh.3m +s usr/share/man/man3m/asinl.3m=asin.3m f usr/share/man/man3m/atan.3m 0444 root bin f usr/share/man/man3m/atan2.3m 0444 root bin +s usr/share/man/man3m/atan2f.3m=atan2.3m +s usr/share/man/man3m/atan2l.3m=atan2.3m +s usr/share/man/man3m/atanf.3m=atan.3m f usr/share/man/man3m/atanh.3m 0444 root bin +s usr/share/man/man3m/atanhf.3m=atanh.3m +s usr/share/man/man3m/atanhl.3m=atanh.3m +s usr/share/man/man3m/atanl.3m=atan.3m f usr/share/man/man3m/cabs.3m 0444 root bin +s usr/share/man/man3m/cabsf.3m=cabs.3m +s usr/share/man/man3m/cabsl.3m=cabs.3m f usr/share/man/man3m/cacos.3m 0444 root bin +s usr/share/man/man3m/cacosf.3m=cacos.3m f usr/share/man/man3m/cacosh.3m 0444 root bin +s usr/share/man/man3m/cacoshf.3m=cacosh.3m +s usr/share/man/man3m/cacoshl.3m=cacosh.3m +s usr/share/man/man3m/cacosl.3m=cacos.3m f usr/share/man/man3m/carg.3m 0444 root bin +s usr/share/man/man3m/cargf.3m=carg.3m +s usr/share/man/man3m/cargl.3m=carg.3m f usr/share/man/man3m/casin.3m 0444 root bin +s usr/share/man/man3m/casinf.3m=casin.3m f usr/share/man/man3m/casinh.3m 0444 root bin +s usr/share/man/man3m/casinhf.3m=casinh.3m +s usr/share/man/man3m/casinhl.3m=casinh.3m +s usr/share/man/man3m/casinl.3m=casin.3m f usr/share/man/man3m/catan.3m 0444 root bin +s usr/share/man/man3m/catanf.3m=catan.3m f usr/share/man/man3m/catanh.3m 0444 root bin +s usr/share/man/man3m/catanhf.3m=catanh.3m +s usr/share/man/man3m/catanhl.3m=catanh.3m +s usr/share/man/man3m/catanl.3m=catan.3m f usr/share/man/man3m/cbrt.3m 0444 root bin +s usr/share/man/man3m/cbrtf.3m=cbrt.3m +s usr/share/man/man3m/cbrtl.3m=cbrt.3m f usr/share/man/man3m/ccos.3m 0444 root bin +s usr/share/man/man3m/ccosf.3m=ccos.3m f usr/share/man/man3m/ccosh.3m 0444 root bin +s usr/share/man/man3m/ccoshf.3m=ccosh.3m +s usr/share/man/man3m/ccoshl.3m=ccosh.3m +s usr/share/man/man3m/ccosl.3m=ccos.3m f usr/share/man/man3m/ceil.3m 0444 root bin +s usr/share/man/man3m/ceilf.3m=ceil.3m +s usr/share/man/man3m/ceill.3m=ceil.3m f usr/share/man/man3m/cexp.3m 0444 root bin +s usr/share/man/man3m/cexpf.3m=cexp.3m +s usr/share/man/man3m/cexpl.3m=cexp.3m f usr/share/man/man3m/cimag.3m 0444 root bin +s usr/share/man/man3m/cimagf.3m=cimag.3m +s usr/share/man/man3m/cimagl.3m=cimag.3m f usr/share/man/man3m/clog.3m 0444 root bin +s usr/share/man/man3m/clogf.3m=clog.3m +s usr/share/man/man3m/clogl.3m=clog.3m f usr/share/man/man3m/conj.3m 0444 root bin +s usr/share/man/man3m/conjf.3m=conj.3m +s usr/share/man/man3m/conjl.3m=conj.3m f usr/share/man/man3m/copysign.3m 0444 root bin +s usr/share/man/man3m/copysignf.3m=copysign.3m +s usr/share/man/man3m/copysignl.3m=copysign.3m f usr/share/man/man3m/cos.3m 0444 root bin +s usr/share/man/man3m/cosf.3m=cos.3m f usr/share/man/man3m/cosh.3m 0444 root bin +s usr/share/man/man3m/coshf.3m=cosh.3m +s usr/share/man/man3m/coshl.3m=cosh.3m +s usr/share/man/man3m/cosl.3m=cos.3m f usr/share/man/man3m/cpow.3m 0444 root bin +s usr/share/man/man3m/cpowf.3m=cpow.3m +s usr/share/man/man3m/cpowl.3m=cpow.3m f usr/share/man/man3m/cproj.3m 0444 root bin +s usr/share/man/man3m/cprojf.3m=cproj.3m +s usr/share/man/man3m/cprojl.3m=cproj.3m f usr/share/man/man3m/creal.3m 0444 root bin +s usr/share/man/man3m/crealf.3m=creal.3m +s usr/share/man/man3m/creall.3m=creal.3m f usr/share/man/man3m/csin.3m 0444 root bin +s usr/share/man/man3m/csinf.3m=csin.3m f usr/share/man/man3m/csinh.3m 0444 root bin +s usr/share/man/man3m/csinhf.3m=csinh.3m +s usr/share/man/man3m/csinhl.3m=csinh.3m +s usr/share/man/man3m/csinl.3m=csin.3m f usr/share/man/man3m/csqrt.3m 0444 root bin +s usr/share/man/man3m/csqrtf.3m=csqrt.3m +s usr/share/man/man3m/csqrtl.3m=csqrt.3m f usr/share/man/man3m/ctan.3m 0444 root bin +s usr/share/man/man3m/ctanf.3m=ctan.3m f usr/share/man/man3m/ctanh.3m 0444 root bin +s usr/share/man/man3m/ctanhf.3m=ctanh.3m +s usr/share/man/man3m/ctanhl.3m=ctanh.3m +s usr/share/man/man3m/ctanl.3m=ctan.3m f usr/share/man/man3m/erf.3m 0444 root bin f usr/share/man/man3m/erfc.3m 0444 root bin +s usr/share/man/man3m/erfcf.3m=erfc.3m +s usr/share/man/man3m/erfcl.3m=erfc.3m +s usr/share/man/man3m/erff.3m=erf.3m +s usr/share/man/man3m/erfl.3m=erf.3m f usr/share/man/man3m/exp.3m 0444 root bin f usr/share/man/man3m/exp2.3m 0444 root bin +s usr/share/man/man3m/exp2f.3m=exp2.3m +s usr/share/man/man3m/exp2l.3m=exp2.3m +s usr/share/man/man3m/expf.3m=exp.3m +s usr/share/man/man3m/expl.3m=exp.3m f usr/share/man/man3m/expm1.3m 0444 root bin +s usr/share/man/man3m/expm1f.3m=expm1.3m +s usr/share/man/man3m/expm1l.3m=expm1.3m f usr/share/man/man3m/fabs.3m 0444 root bin +s usr/share/man/man3m/fabsf.3m=fabs.3m +s usr/share/man/man3m/fabsl.3m=fabs.3m f usr/share/man/man3m/fdim.3m 0444 root bin +s usr/share/man/man3m/fdimf.3m=fdim.3m +s usr/share/man/man3m/fdiml.3m=fdim.3m f usr/share/man/man3m/feclearexcept.3m 0444 root bin f usr/share/man/man3m/fegetenv.3m 0444 root bin f usr/share/man/man3m/fegetexceptflag.3m 0444 root bin +s usr/share/man/man3m/fegetprec.3m=fesetprec.3m f usr/share/man/man3m/fegetround.3m 0444 root bin f usr/share/man/man3m/feholdexcept.3m 0444 root bin f usr/share/man/man3m/feraiseexcept.3m 0444 root bin @@ -16429,18 +16512,47 @@ f usr/share/man/man3m/fesetprec.3m 0444 root bin s usr/share/man/man3m/fesetround.3m=fegetround.3m f usr/share/man/man3m/fetestexcept.3m 0444 root bin f usr/share/man/man3m/feupdateenv.3m 0444 root bin +s usr/share/man/man3m/fex_get_handling.3m=fex_set_handling.3m +s usr/share/man/man3m/fex_get_log.3m=fex_set_log.3m +s usr/share/man/man3m/fex_get_log_depth.3m=fex_set_log.3m +s usr/share/man/man3m/fex_getexcepthandler.3m=fex_set_handling.3m +s usr/share/man/man3m/fex_log_entry.3m=fex_set_log.3m f usr/share/man/man3m/fex_merge_flags.3m 0444 root bin f usr/share/man/man3m/fex_set_handling.3m 0444 root bin f usr/share/man/man3m/fex_set_log.3m 0444 root bin +s usr/share/man/man3m/fex_set_log_depth.3m=fex_set_log.3m +s usr/share/man/man3m/fex_setexcepthandler.3m=fex_set_handling.3m f usr/share/man/man3m/floor.3m 0444 root bin +s usr/share/man/man3m/floorf.3m=floor.3m +s usr/share/man/man3m/floorl.3m=floor.3m f usr/share/man/man3m/fma.3m 0444 root bin +s usr/share/man/man3m/fmaf.3m=fma.3m +s usr/share/man/man3m/fmal.3m=fma.3m f usr/share/man/man3m/fmax.3m 0444 root bin +s usr/share/man/man3m/fmaxf.3m=fmax.3m +s usr/share/man/man3m/fmaxl.3m=fmax.3m f usr/share/man/man3m/fmin.3m 0444 root bin +s usr/share/man/man3m/fminf.3m=fmin.3m +s usr/share/man/man3m/fminl.3m=fmin.3m f usr/share/man/man3m/fmod.3m 0444 root bin +s usr/share/man/man3m/fmodf.3m=fmod.3m +s usr/share/man/man3m/fmodl.3m=fmod.3m f usr/share/man/man3m/fpclassify.3m 0444 root bin f usr/share/man/man3m/frexp.3m 0444 root bin +s usr/share/man/man3m/frexpf.3m=frexp.3m +s usr/share/man/man3m/frexpl.3m=frexp.3m +s usr/share/man/man3m/gamma.3m=lgamma.3m +s usr/share/man/man3m/gamma_r.3m=lgamma.3m +s usr/share/man/man3m/gammaf.3m=lgamma.3m +s usr/share/man/man3m/gammaf_r.3m=lgamma.3m +s usr/share/man/man3m/gammal.3m=lgamma.3m +s usr/share/man/man3m/gammal_r.3m=lgamma.3m f usr/share/man/man3m/hypot.3m 0444 root bin +s usr/share/man/man3m/hypotf.3m=hypot.3m +s usr/share/man/man3m/hypotl.3m=hypot.3m f usr/share/man/man3m/ilogb.3m 0444 root bin +s usr/share/man/man3m/ilogbf.3m=ilogb.3m +s usr/share/man/man3m/ilogbl.3m=ilogb.3m f usr/share/man/man3m/isfinite.3m 0444 root bin f usr/share/man/man3m/isgreater.3m 0444 root bin f usr/share/man/man3m/isgreaterequal.3m 0444 root bin @@ -16452,42 +16564,127 @@ f usr/share/man/man3m/isnan.3m 0444 root bin f usr/share/man/man3m/isnormal.3m 0444 root bin f usr/share/man/man3m/isunordered.3m 0444 root bin f usr/share/man/man3m/j0.3m 0444 root bin +s usr/share/man/man3m/j0f.3m=j0.3m +s usr/share/man/man3m/j0l.3m=j0.3m +s usr/share/man/man3m/j1.3m=j0.3m +s usr/share/man/man3m/j1f.3m=j0.3m +s usr/share/man/man3m/j1l.3m=j0.3m +s usr/share/man/man3m/jn.3m=j0.3m +s usr/share/man/man3m/jnf.3m=j0.3m +s usr/share/man/man3m/jnl.3m=j0.3m f usr/share/man/man3m/ldexp.3m 0444 root bin +s usr/share/man/man3m/ldexpf.3m=ldexp.3m +s usr/share/man/man3m/ldexpl.3m=ldexp.3m f usr/share/man/man3m/lgamma.3m 0444 root bin +s usr/share/man/man3m/lgamma_r.3m=lgamma.3m +s usr/share/man/man3m/lgammaf.3m=lgamma.3m +s usr/share/man/man3m/lgammaf_r.3m=lgamma.3m +s usr/share/man/man3m/lgammal.3m=lgamma.3m +s usr/share/man/man3m/lgammal_r.3m=lgamma.3m f usr/share/man/man3m/llrint.3m 0444 root bin +s usr/share/man/man3m/llrintf.3m=llrint.3m +s usr/share/man/man3m/llrintl.3m=llrint.3m f usr/share/man/man3m/llround.3m 0444 root bin +s usr/share/man/man3m/llroundf.3m=llround.3m +s usr/share/man/man3m/llroundl.3m=llround.3m f usr/share/man/man3m/log.3m 0444 root bin f usr/share/man/man3m/log10.3m 0444 root bin +s usr/share/man/man3m/log10f.3m=log10.3m +s usr/share/man/man3m/log10l.3m=log10.3m f usr/share/man/man3m/log1p.3m 0444 root bin +s usr/share/man/man3m/log1pf.3m=log1p.3m +s usr/share/man/man3m/log1pl.3m=log1p.3m f usr/share/man/man3m/log2.3m 0444 root bin +s usr/share/man/man3m/log2f.3m=log2.3m +s usr/share/man/man3m/log2l.3m=log2.3m f usr/share/man/man3m/logb.3m 0444 root bin +s usr/share/man/man3m/logbf.3m=logb.3m +s usr/share/man/man3m/logbl.3m=logb.3m +s usr/share/man/man3m/logf.3m=log.3m +s usr/share/man/man3m/logl.3m=log.3m f usr/share/man/man3m/lrint.3m 0444 root bin +s usr/share/man/man3m/lrintf.3m=lrint.3m +s usr/share/man/man3m/lrintl.3m=lrint.3m f usr/share/man/man3m/lround.3m 0444 root bin +s usr/share/man/man3m/lroundf.3m=lround.3m +s usr/share/man/man3m/lroundl.3m=lround.3m f usr/share/man/man3m/matherr.3m 0444 root bin f usr/share/man/man3m/modf.3m 0444 root bin +s usr/share/man/man3m/modff.3m=modf.3m +s usr/share/man/man3m/modfl.3m=modf.3m f usr/share/man/man3m/nan.3m 0444 root bin s usr/share/man/man3m/nanf.3m=nan.3m s usr/share/man/man3m/nanl.3m=nan.3m f usr/share/man/man3m/nearbyint.3m 0444 root bin +s usr/share/man/man3m/nearbyintf.3m=nearbyint.3m +s usr/share/man/man3m/nearbyintl.3m=nearbyint.3m f usr/share/man/man3m/nextafter.3m 0444 root bin +s usr/share/man/man3m/nextafterf.3m=nextafter.3m +s usr/share/man/man3m/nextafterl.3m=nextafter.3m +s usr/share/man/man3m/nexttoward.3m=nextafter.3m +s usr/share/man/man3m/nexttowardf.3m=nextafter.3m +s usr/share/man/man3m/nexttowardl.3m=nextafter.3m f usr/share/man/man3m/pow.3m 0444 root bin +s usr/share/man/man3m/powf.3m=pow.3m +s usr/share/man/man3m/powl.3m=pow.3m f usr/share/man/man3m/remainder.3m 0444 root bin +s usr/share/man/man3m/remainderf.3m=remainder.3m +s usr/share/man/man3m/remainderl.3m=remainder.3m f usr/share/man/man3m/remquo.3m 0444 root bin +s usr/share/man/man3m/remquof.3m=remquo.3m +s usr/share/man/man3m/remquol.3m=remquo.3m f usr/share/man/man3m/rint.3m 0444 root bin +s usr/share/man/man3m/rintf.3m=rint.3m +s usr/share/man/man3m/rintl.3m=rint.3m f usr/share/man/man3m/round.3m 0444 root bin +s usr/share/man/man3m/roundf.3m=round.3m +s usr/share/man/man3m/roundl.3m=round.3m f usr/share/man/man3m/scalb.3m 0444 root bin +s usr/share/man/man3m/scalbf.3m=scalb.3m +s usr/share/man/man3m/scalbl.3m=scalb.3m f usr/share/man/man3m/scalbln.3m 0444 root bin +s usr/share/man/man3m/scalblnf.3m=scalbln.3m +s usr/share/man/man3m/scalblnl.3m=scalbln.3m +s usr/share/man/man3m/scalbn.3m=scalbln.3m +s usr/share/man/man3m/scalbnf.3m=scalbln.3m +s usr/share/man/man3m/scalbnl.3m=scalbln.3m f usr/share/man/man3m/signbit.3m 0444 root bin f usr/share/man/man3m/significand.3m 0444 root bin +s usr/share/man/man3m/significandf.3m=significand.3m +s usr/share/man/man3m/significandl.3m=significand.3m f usr/share/man/man3m/sin.3m 0444 root bin f usr/share/man/man3m/sincos.3m 0444 root bin +s usr/share/man/man3m/sincosf.3m=sincos.3m +s usr/share/man/man3m/sincosl.3m=sincos.3m +s usr/share/man/man3m/sinf.3m=sin.3m f usr/share/man/man3m/sinh.3m 0444 root bin +s usr/share/man/man3m/sinhf.3m=sinh.3m +s usr/share/man/man3m/sinhl.3m=sinh.3m +s usr/share/man/man3m/sinl.3m=sin.3m f usr/share/man/man3m/sqrt.3m 0444 root bin +s usr/share/man/man3m/sqrtf.3m=sqrt.3m +s usr/share/man/man3m/sqrtl.3m=sqrt.3m f usr/share/man/man3m/tan.3m 0444 root bin +s usr/share/man/man3m/tanf.3m=tan.3m f usr/share/man/man3m/tanh.3m 0444 root bin +s usr/share/man/man3m/tanhf.3m=tanh.3m +s usr/share/man/man3m/tanhl.3m=tanh.3m +s usr/share/man/man3m/tanl.3m=tan.3m f usr/share/man/man3m/tgamma.3m 0444 root bin +s usr/share/man/man3m/tgammaf.3m=tgamma.3m +s usr/share/man/man3m/tgammal.3m=tgamma.3m f usr/share/man/man3m/trunc.3m 0444 root bin +s usr/share/man/man3m/truncf.3m=trunc.3m +s usr/share/man/man3m/truncl.3m=trunc.3m f usr/share/man/man3m/y0.3m 0444 root bin +s usr/share/man/man3m/y0f.3m=y0.3m +s usr/share/man/man3m/y0l.3m=y0.3m +s usr/share/man/man3m/y1.3m=y0.3m +s usr/share/man/man3m/y1f.3m=y0.3m +s usr/share/man/man3m/y1l.3m=y0.3m +s usr/share/man/man3m/yn.3m=y0.3m +s usr/share/man/man3m/ynf.3m=y0.3m +s usr/share/man/man3m/ynl.3m=y0.3m d usr/share/man/man3mail 0755 root bin f usr/share/man/man3mail/maillock.3mail 0444 root bin s usr/share/man/man3mail/mailunlock.3mail=maillock.3mail diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index 612360ac32..30e5014dea 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -33,4 +33,4 @@ LOADER_VERSION = 1.1 # Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes. # The version is processed from left to right, the version number can only # be increased. -BOOT_VERSION = $(LOADER_VERSION)-2019.10.19.1 +BOOT_VERSION = $(LOADER_VERSION)-2019.10.26.1 diff --git a/usr/src/boot/lib/libstand/zfs/zfsimpl.c b/usr/src/boot/lib/libstand/zfs/zfsimpl.c index 458fc1ec1e..9958d5ea4b 100644 --- a/usr/src/boot/lib/libstand/zfs/zfsimpl.c +++ b/usr/src/boot/lib/libstand/zfs/zfsimpl.c @@ -838,12 +838,17 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize, void *arg) list_t stack; spa_t *spa = vd->spa; zio_t *zio = arg; + remap_segment_t *rs; list_create(&stack, sizeof (remap_segment_t), offsetof(remap_segment_t, rs_node)); - for (remap_segment_t *rs = rs_alloc(vd, offset, asize, 0); - rs != NULL; rs = list_remove_head(&stack)) { + rs = rs_alloc(vd, offset, asize, 0); + if (rs == NULL) { + printf("vdev_indirect_remap: out of memory.\n"); + zio->io_error = ENOMEM; + } + for ( ; rs != NULL; rs = list_remove_head(&stack)) { vdev_t *v = rs->rs_vd; uint64_t num_entries = 0; /* vdev_indirect_mapping_t *vim = v->v_mapping; */ @@ -851,6 +856,9 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize, void *arg) vdev_indirect_mapping_duplicate_adjacent_entries(v, rs->rs_offset, rs->rs_asize, &num_entries); + if (num_entries == 0) + zio->io_error = ENOMEM; + for (uint64_t i = 0; i < num_entries; i++) { vdev_indirect_mapping_entry_phys_t *m = &mapping[i]; uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); @@ -863,9 +871,18 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize, void *arg) vdev_t *dst_v = vdev_lookup_top(spa, dst_vdev); if (dst_v->v_read == vdev_indirect_read) { - list_insert_head(&stack, - rs_alloc(dst_v, dst_offset + inner_offset, - inner_size, rs->rs_split_offset)); + remap_segment_t *o; + + o = rs_alloc(dst_v, dst_offset + inner_offset, + inner_size, rs->rs_split_offset); + if (o == NULL) { + printf("vdev_indirect_remap: " + "out of memory.\n"); + zio->io_error = ENOMEM; + break; + } + + list_insert_head(&stack, o); } vdev_indirect_gather_splits(rs->rs_split_offset, dst_v, dst_offset + inner_offset, diff --git a/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h b/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h index 5997260616..459324b88a 100644 --- a/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h +++ b/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h @@ -444,6 +444,13 @@ _NOTE(CONSTCOND) } while (0) ZIO_SET_CHECKSUM(&(bp)->blk_cksum, 0, 0, 0, 0); \ } +#if BYTE_ORDER == _BIG_ENDIAN +#define ZFS_HOST_BYTEORDER (0ULL) +#else +#define ZFS_HOST_BYTEORDER (1ULL) +#endif + +#define BP_SHOULD_BYTESWAP(bp) (BP_GET_BYTEORDER(bp) != ZFS_HOST_BYTEORDER) #define BPE_NUM_WORDS 14 #define BPE_PAYLOAD_SIZE (BPE_NUM_WORDS * sizeof (uint64_t)) #define BPE_IS_PAYLOADWORD(bp, wp) \ diff --git a/usr/src/boot/sys/cddl/boot/zfs/zfssubr.c b/usr/src/boot/sys/cddl/boot/zfs/zfssubr.c index 3a81418c6a..4cfd337213 100644 --- a/usr/src/boot/sys/cddl/boot/zfs/zfssubr.c +++ b/usr/src/boot/sys/cddl/boot/zfs/zfssubr.c @@ -320,8 +320,9 @@ zio_checksum_verify(const spa_t *spa, const blkptr_t *bp, void *data) byteswap_uint64_array(&expected_cksum, sizeof (zio_cksum_t)); } else { + byteswap = BP_SHOULD_BYTESWAP(bp); expected_cksum = bp->blk_cksum; - ci->ci_func[0](data, size, ctx, &actual_cksum); + ci->ci_func[byteswap](data, size, ctx, &actual_cksum); } if (!ZIO_CHECKSUM_EQUAL(actual_cksum, expected_cksum)) { diff --git a/usr/src/cmd/auditrecord/audit_record_attr.txt b/usr/src/cmd/auditrecord/audit_record_attr.txt index 6284b554cf..fdc4fa46eb 100644 --- a/usr/src/cmd/auditrecord/audit_record_attr.txt +++ b/usr/src/cmd/auditrecord/audit_record_attr.txt @@ -459,6 +459,36 @@ label=AUE_AUDITON_SQCTRL # return,failure: Not owner,-1 # trailer,176 +label=AUE_AUDITON_SETPMASK + format=[arg]1:[arg]2 + comment=3, "setpmask:pid", process + comment=3, "setpmask:as_success", audit ID mask: + comment=3, "setpmask:as_failure", audit ID mask + syscall=auditon: SETPMASK + +label=AUE_AUDITON_SETKAUDIT + format=arg1:arg2:arg3:inaddr4:arg5:arg6:arg7 + comment=1, audit user ID, "auid": + comment=1, terminal ID, "port": + comment=1, type, "type": + comment=1, terminal ID, "ip address": + comment=1, preselection mask, "as_success": + comment=1, preselection mask, "as_failure": + comment=1, audit session ID, "asid" + syscall=auditon: SETKAUDIT + +label=AUE_AUDITON_GETPINFO + format=kernel + syscall=auditon: GETPINFO + +label=AUE_AUDITON_GETKAUDIT + format=kernel + syscall=auditon: GETKAUDIT + +label=AUE_AUDITON_OTHER + format=kernel + syscall=auditon: OTHER + label=AUE_AUDITON_STERMID skip=Not used. diff --git a/usr/src/cmd/cron/Makefile b/usr/src/cmd/cron/Makefile index bfd9e19840..de59fa73cb 100644 --- a/usr/src/cmd/cron/Makefile +++ b/usr/src/cmd/cron/Makefile @@ -23,6 +23,7 @@ # Use is subject to license terms. # # Copyright 2019 Joyent, Inc. +# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. DEFAULTFILES = cron.dfl @@ -58,6 +59,7 @@ PROG2 = at atq atrm crontab XPG6PROG = crontab XPG4PROG = at crontab PROG = $(PROG1) $(PROG2) +PARSETEST = parsetest SCRIPT = batch XPG4SCRIPT = batch.xpg4 @@ -80,14 +82,15 @@ GETRESPOBJ= getresponse.o COMMONOBJ1= permit.o COMMONOBJ2= funcs.o COMMONOBJS= $(COMMONOBJ1) $(COMMONOBJ2) -CRONOBJS= cron.o elm.o +CRONOBJS= cron.o elm.o parse.o ATOBJS= at.o att1.o att2.o XPG4OBJS= values-xpg4.o ATRMOBJS1= atrm.o ATRMOBJS= $(ATRMOBJS1) $(GETRESPOBJ) ATQOBJS= atq.o -CRONTABOBJS1= crontab.o +CRONTABOBJS1= crontab.o parse.o CRONTABOBJS= $(CRONTABOBJS1) $(GETRESPOBJ) +PARSETESTOBJS= parse.o # /usr/xpg*/bin/crontab isn't linked with values-xpg*.o since it isn't # required by any specific behavior differences; this makes these @@ -99,14 +102,15 @@ XPG4ATOBJS= $(ATOBJS:%=objs.xpg4/%) $(XPG4OBJS:%=objs.xpg4/%) XPG6COMMONOBJS= $(COMMONOBJS:%=objs.xpg6/%) XPG6CTOBJS= $(CRONTABOBJS:%=objs.xpg6/%) -cron := OBJS = $(CRONOBJS) $(COMMONOBJ2) -at := OBJS = $(ATOBJS) $(COMMONOBJS) -at.xpg4 := OBJS = $(XPG4ATOBJS) $(XPG4COMMONOBJS) -atrm := OBJS = $(ATRMOBJS) $(COMMONOBJS) -atq := OBJS = $(ATQOBJS) $(COMMONOBJS) -crontab := OBJS = $(CRONTABOBJS) $(COMMONOBJS) -crontab.xpg4 := OBJS = $(XPG4CTOBJS) $(XPG4COMMONOBJS) -crontab.xpg6 := OBJS = $(XPG6CTOBJS) $(XPG6COMMONOBJS) +cron := POBJS = $(CRONOBJS) $(COMMONOBJ2) +at := POBJS = $(ATOBJS) $(COMMONOBJS) +at.xpg4 := POBJS = $(XPG4ATOBJS) $(XPG4COMMONOBJS) +atrm := POBJS = $(ATRMOBJS) $(COMMONOBJS) +atq := POBJS = $(ATQOBJS) $(COMMONOBJS) +crontab := POBJS = $(CRONTABOBJS) $(COMMONOBJS) +crontab.xpg4 := POBJS = $(XPG4CTOBJS) $(XPG4COMMONOBJS) +crontab.xpg6 := POBJS = $(XPG6CTOBJS) $(XPG6COMMONOBJS) +parsetest := POBJS = $(PARSETESTOBJS) CFLAGS += $(CCVERBOSE) @@ -137,13 +141,15 @@ at := LDLIBS += -lproject -lsecdb at.xpg4 := LDLIBS += -lproject -lsecdb atq := LDLIBS += -lsecdb atrm := LDLIBS += -lsecdb -cron := LDLIBS += -lpam -lproject -lcontract -lzoneinfo -crontab := LDLIBS += -lsecdb -lpam -lzoneinfo -crontab.xpg6 := LDLIBS += -lsecdb -lpam -lzoneinfo -crontab.xpg4 := LDLIBS += -lsecdb -lpam -lzoneinfo +cron := LDLIBS += -lpam -lproject -lcontract -lzoneinfo -lcustr +crontab := LDLIBS += -lsecdb -lpam -lzoneinfo -lcustr +crontab.xpg6 := LDLIBS += -lsecdb -lpam -lzoneinfo -lcustr +crontab.xpg4 := LDLIBS += -lsecdb -lpam -lzoneinfo -lcustr +parsetest := LDLIBS += -lcustr -$(XPG4) := CFLAGS += -DXPG4 -$(XPG6) := CFLAGS += -DXPG6 +$(XPG4) := CFLAGS += -DXPG4 +$(XPG6) := CFLAGS += -DXPG6 +parsetest := CFLAGS += -DPARSETEST $(ROOTSVCSYSTEM)/cron.xml := FILEMODE = 0444 $(ROOTLIBSVCMETHOD)/svc-cron := FILEMODE = 0555 @@ -151,13 +157,14 @@ $(ROOTLIBSVCMETHOD)/svc-cron := FILEMODE = 0555 .KEEP_STATE: -all : $(PROG) $(XPG4) $(XPG6) $(SCRIPT) $(XPG4SCRIPT) $(FILES) +all : $(PROG) $(XPG4) $(XPG6) $(SCRIPT) $(XPG4SCRIPT) $(FILES) \ + $(PARSETEST) install : all $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTSYMLINK) \ $(ROOTMANIFEST) $(ROOTMETHOD) $(ROOTCRONDCRONTABS)/root -$(PROG) : $$(OBJS) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) +$(PROG) $(PARSETEST): $$(POBJS) + $(LINK.c) $(POBJS) -o $@ $(LDLIBS) $(POST_PROCESS) $(XPG4) : objs.xpg4 $$(OBJS) @@ -222,7 +229,7 @@ $(POFILE): $(POFILES) $(RM) $@; cat $(POFILES) > $@ clean : - $(RM) $(COBJS) att1.h att1.c att2.c + $(RM) $(OBJS) att1.h att1.c att2.c strip : $(STRIP) $(PROG) $(XPG4) $(XPG6) diff --git a/usr/src/cmd/cron/cron.c b/usr/src/cmd/cron/cron.c index 247eb10c94..02843837ba 100644 --- a/usr/src/cmd/cron/cron.c +++ b/usr/src/cmd/cron/cron.c @@ -26,6 +26,7 @@ * Copyright 2013 Joyent, Inc. All rights reserved. * Copyright (c) 2014 Gary Mills * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -34,11 +35,6 @@ /* Copyright (c) 1987, 1988 Microsoft Corporation */ /* All Rights Reserved */ -#ifdef lint -/* make lint happy */ -#define __EXTENSIONS__ -#endif - #include <sys/contract/process.h> #include <sys/ctfs.h> #include <sys/param.h> @@ -461,7 +457,7 @@ begin: (void) setlocale(LC_ALL, ""); /* fork unless 'nofork' is specified */ if ((argc <= 1) || (strcmp(argv[1], "nofork"))) { - if (rfork = fork()) { + if ((rfork = fork()) != 0) { if (rfork == (pid_t)-1) { (void) sleep(30); goto begin; @@ -986,7 +982,8 @@ mod_ctab(char *name, time_t reftime) return; } #ifdef DEBUG - (void) fprintf(stderr, "%s has revised his crontab\n", u->name); + (void) fprintf(stderr, "%s has revised their crontab\n", + u->name); #endif rm_ctevents(u); el_remove(u->ctid, 0); @@ -994,9 +991,8 @@ mod_ctab(char *name, time_t reftime) } } -/* ARGSUSED */ static void -mod_atjob(char *name, time_t reftime) +mod_atjob(char *name, time_t reftime __unused) { char *ptr; time_t tim; @@ -1289,11 +1285,18 @@ readcronfile(FILE *cf, struct usr *u, time_t reftime) e = xmalloc(sizeof (struct event)); e->etype = CRONEVENT; - if (!(((e->of.ct.minute = next_field(0, 59)) != NULL) && - ((e->of.ct.hour = next_field(0, 23)) != NULL) && - ((e->of.ct.daymon = next_field(1, 31)) != NULL) && - ((e->of.ct.month = next_field(1, 12)) != NULL) && - ((e->of.ct.dayweek = next_field(0, 6)) != NULL))) { + + if (next_field(0, 59, line, &cursor, + &e->of.ct.minute) != CFOK || + next_field(0, 23, line, &cursor, &e->of.ct.hour) != CFOK || + next_field(1, 31, line, &cursor, + &e->of.ct.daymon) != CFOK || + next_field(1, 12, line, &cursor, &e->of.ct.month) != CFOK || + next_field(0, 6, line, &cursor, + &e->of.ct.dayweek) != CFOK) { +#ifdef DEBUG + (void) fprintf(stderr, "Error: %d %s", lineno, line); +#endif free(e); cte_add(lineno, line); continue; @@ -1521,67 +1524,6 @@ mail(char *usrname, char *mesg, int format) } } -static char * -next_field(int lower, int upper) -{ - /* - * next_field returns a pointer to a string which holds the next - * field of a line of a crontab file. - * if (numbers in this field are out of range (lower..upper), - * or there is a syntax error) then - * NULL is returned, and a mail message is sent to the - * user telling them which line the error was in. - */ - - char *s; - int num, num2, start; - - while ((line[cursor] == ' ') || (line[cursor] == '\t')) - cursor++; - start = cursor; - if (line[cursor] == '\0') { - return (NULL); - } - if (line[cursor] == '*') { - cursor++; - if ((line[cursor] != ' ') && (line[cursor] != '\t')) - return (NULL); - s = xmalloc(2); - (void) strcpy(s, "*"); - return (s); - } - for (;;) { - if (!isdigit(line[cursor])) - return (NULL); - num = 0; - do { - num = num*10 + (line[cursor]-'0'); - } while (isdigit(line[++cursor])); - if ((num < lower) || (num > upper)) - return (NULL); - if (line[cursor] == '-') { - if (!isdigit(line[++cursor])) - return (NULL); - num2 = 0; - do { - num2 = num2*10 + (line[cursor]-'0'); - } while (isdigit(line[++cursor])); - if ((num2 < lower) || (num2 > upper)) - return (NULL); - } - if ((line[cursor] == ' ') || (line[cursor] == '\t')) - break; - if (line[cursor] == '\0') - return (NULL); - if (line[cursor++] != ',') - return (NULL); - } - s = xmalloc(cursor-start + 1); - (void) strncpy(s, line + start, cursor-start); - s[cursor-start] = '\0'; - return (s); -} - #define tm_cmp(t1, t2) (\ (t1)->tm_year == (t2)->tm_year && \ (t1)->tm_mon == (t2)->tm_mon && \ @@ -3011,24 +2953,21 @@ rinfo_free(struct runinfo *entry) } } -/* ARGSUSED */ static void -thaw_handler(int sig) +thaw_handler(int sig __unused) { refresh = 1; } -/* ARGSUSED */ static void -cronend(int sig) +cronend(int sig __unused) { crabort("SIGTERM", REMOVE_FIFO); } -/*ARGSUSED*/ static void -child_handler(int sig) +child_handler(int sig __unused) { ; } @@ -3554,10 +3493,9 @@ process_anc_files(int del) } } -/*ARGSUSED*/ static int cron_conv(int num_msg, struct pam_message **msgs, - struct pam_response **response, void *appdata_ptr) + struct pam_response **response __unused, void *appdata_ptr __unused) { struct pam_message **m = msgs; int i; @@ -3679,14 +3617,14 @@ contract_abandon_latest(pid_t pid) crabort("repeated failure to abandon contracts", REMOVE_FIFO | CONSOLE_MSG); - if (r = contract_latest(&id)) { + if ((r = contract_latest(&id)) != 0) { msg("could not obtain latest contract for " "PID %ld: %s", pid, strerror(r)); cts_lost++; return; } - if (r = contract_abandon_id(id)) { + if ((r = contract_abandon_id(id)) != 0) { msg("could not abandon latest contract %ld: %s", id, strerror(r)); cts_lost++; diff --git a/usr/src/cmd/cron/cron.h b/usr/src/cmd/cron/cron.h index 93e21e7b41..0620572f8c 100644 --- a/usr/src/cmd/cron/cron.h +++ b/usr/src/cmd/cron/cron.h @@ -23,13 +23,17 @@ * Use is subject to license terms. */ +/* + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + */ + #ifndef _CRON_H #define _CRON_H #include <unistd.h> /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ #ifdef __cplusplus extern "C" { @@ -74,6 +78,19 @@ struct message { /* anything below here can be changed */ #define SYSCRONDIR "/etc/cron.d/crontabs" + +/* + * Errors from the crontab field parser. + */ +typedef enum { + CFOK = 0, + CFEOLN, + CFUNEXPECT, + CFOUTOFBOUND, + CFEOVERFLOW, + CFENOMEM +} cferror_t; + #define CRONDIR "/var/spool/cron/crontabs" #define ATDIR "/var/spool/cron/atjobs" #define ACCTFILE "/var/cron/log" @@ -107,6 +124,7 @@ extern int isvalid_shell(const char *shell); extern int isvalid_dir(const char *dir); extern int cron_admin(const char *); +extern cferror_t next_field(uint_t, uint_t, char *, int *, char **); #ifdef __cplusplus } diff --git a/usr/src/cmd/cron/crontab.c b/usr/src/cmd/cron/crontab.c index c6f1673ad8..2d9eea8755 100644 --- a/usr/src/cmd/cron/crontab.c +++ b/usr/src/cmd/cron/crontab.c @@ -25,6 +25,9 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ +/* + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + */ #include <sys/types.h> #include <sys/stat.h> @@ -81,6 +84,7 @@ #define EOLN "unexpected end of line." #define UNEXPECT "unexpected character found in line." #define OUTOFBOUND "number out of bounds." +#define OVERFLOW "too many elements." #define ERRSFND "errors detected in input, no crontab file generated." #define ED_ERROR \ " The editor indicates that an error occurred while you were\n"\ @@ -108,7 +112,6 @@ char edtemp[5+13+1]; char line[CTLINESIZE]; static char login[UNAMESIZE]; -static int next_field(int, int); static void catch(int); static void crabort(char *); static void cerror(char *); @@ -433,6 +436,7 @@ copycron(FILE *fp) char pid[6], *tnam_end; int t; char buf[LINE_MAX]; + cferror_t cferr; sprintf(pid, "%-5d", getpid()); tnam = xmalloc(strlen(CRONDIR)+strlen(TMPFILE)+7); @@ -510,11 +514,34 @@ copycron(FILE *fp) } } - if (next_field(0, 59)) continue; - if (next_field(0, 23)) continue; - if (next_field(1, 31)) continue; - if (next_field(1, 12)) continue; - if (next_field(0, 06)) continue; + if ((cferr = next_field(0, 59, line, &cursor, NULL)) != CFOK || + (cferr = next_field(0, 23, line, &cursor, NULL)) != CFOK || + (cferr = next_field(1, 31, line, &cursor, NULL)) != CFOK || + (cferr = next_field(1, 12, line, &cursor, NULL)) != CFOK || + (cferr = next_field(0, 6, line, &cursor, NULL)) != CFOK) { + switch (cferr) { + case CFEOLN: + cerror(EOLN); + break; + case CFUNEXPECT: + cerror(UNEXPECT); + break; + case CFOUTOFBOUND: + cerror(OUTOFBOUND); + break; + case CFEOVERFLOW: + cerror(OVERFLOW); + break; + case CFENOMEM: + (void) fprintf(stderr, "Out of memory\n"); + exit(55); + break; + default: + break; + } + continue; + } + if (line[++cursor] == '\0') { cerror(EOLN); continue; @@ -544,64 +571,6 @@ cont: unlink(tnam); } -static int -next_field(int lower, int upper) -{ - int num, num2; - - while ((line[cursor] == ' ') || (line[cursor] == '\t')) cursor++; - if (line[cursor] == '\0') { - cerror(EOLN); - return (1); - } - if (line[cursor] == '*') { - cursor++; - if ((line[cursor] != ' ') && (line[cursor] != '\t')) { - cerror(UNEXPECT); - return (1); - } - return (0); - } - while (TRUE) { - if (!isdigit(line[cursor])) { - cerror(UNEXPECT); - return (1); - } - num = 0; - do { - num = num*10 + (line[cursor]-'0'); - } while (isdigit(line[++cursor])); - if ((num < lower) || (num > upper)) { - cerror(OUTOFBOUND); - return (1); - } - if (line[cursor] == '-') { - if (!isdigit(line[++cursor])) { - cerror(UNEXPECT); - return (1); - } - num2 = 0; - do { - num2 = num2*10 + (line[cursor]-'0'); - } while (isdigit(line[++cursor])); - if ((num2 < lower) || (num2 > upper)) { - cerror(OUTOFBOUND); - return (1); - } - } - if ((line[cursor] == ' ') || (line[cursor] == '\t')) break; - if (line[cursor] == '\0') { - cerror(EOLN); - return (1); - } - if (line[cursor++] != ',') { - cerror(UNEXPECT); - return (1); - } - } - return (0); -} - static void cerror(char *msg) { diff --git a/usr/src/cmd/cron/parse.c b/usr/src/cmd/cron/parse.c new file mode 100644 index 0000000000..e82c751bd2 --- /dev/null +++ b/usr/src/cmd/cron/parse.c @@ -0,0 +1,277 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + +/* + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + */ + +#include <stdio.h> +#include <err.h> +#include <sys/types.h> +#include <string.h> +#include <stdlib.h> +#include <ctype.h> +#include <assert.h> +#include <libcustr.h> +#include "cron.h" + +#ifdef PARSETEST +#define xstrdup(x) strdup((x)) +#endif + +#define MAX_ELEMENTS 60 + +#define READNUMBER(x) \ + do { \ + (x) = (x) * 10 + (line[cursor] - '0'); \ + if ((x) > MAX_ELEMENTS) { \ + err = CFOUTOFBOUND; \ + goto out; \ + } \ + } while (isdigit(line[++cursor])) + +#define ADDELEMENT(x) \ + do { \ + if (eindex >= MAX_ELEMENTS) { \ + err = CFEOVERFLOW; \ + goto out; \ + } \ + elements[eindex++] = (x); \ + } while (0) + +/* A more restrictive version of isspace(3C) that only looks for space/tab */ +#define ISSPACE(x) \ + ((x) == ' ' || (x) == '\t') + +cferror_t +next_field(uint_t lower, uint_t upper, char *line, int *cursorp, char **ret) +{ + uint_t elements[MAX_ELEMENTS]; + uint_t eindex = 0, i; + int cursor = *cursorp; + cferror_t err = CFOK; + + assert(upper - lower <= MAX_ELEMENTS); + + if (ret != NULL) + *ret = NULL; + + while (ISSPACE(line[cursor])) + cursor++; + + if (line[cursor] == '\0') { + err = CFEOLN; + goto out; + } + + for (;;) { + uint_t num = 0, num2 = 0, step = 0; + + if (line[cursor] == '*') { + cursor++; + + /* Short circuit for plain '*' */ + if (ISSPACE(line[cursor])) { + if (ret != NULL) + *ret = xstrdup("*"); + goto out; + } + + /* + * '*' is only permitted alongside other elements if + * it has an associated step. + */ + + if (line[cursor] != '/') { + err = CFUNEXPECT; + goto out; + } + + /* Treat it as a range covering all values */ + num = lower; + num2 = upper; + } else { + if (!isdigit(line[cursor])) { + err = CFUNEXPECT; + goto out; + } + + READNUMBER(num); + + if (num < lower || num > upper) { + err = CFOUTOFBOUND; + goto out; + } + + if (line[cursor] == '-') { + cursor++; + if (!isdigit(line[cursor])) { + err = CFUNEXPECT; + goto out; + } + + READNUMBER(num2); + + if (num2 < lower || num2 > upper) { + err = CFOUTOFBOUND; + goto out; + } + } else { + ADDELEMENT(num); + goto next; + } + } + + /* Look for a step definition */ + if (line[cursor] == '/') { + cursor++; + if (!isdigit(line[cursor])) { + err = CFUNEXPECT; + goto out; + } + + READNUMBER(step); + + if (step == 0) { + err = CFOUTOFBOUND; + goto out; + } + } else { + step = 1; + } + + if (num <= num2) { + for (i = num; i <= num2; i += step) { + ADDELEMENT(i); + } + } else { + /* Wrap-around range */ + for (i = num; i <= upper; i += step) { + ADDELEMENT(i); + } + + i -= (upper - lower + 1); + for (; i <= num2; i += step) { + ADDELEMENT(i); + } + } + +next: + + if (line[cursor] != ',') + break; + + cursor++; + } + + if (line[cursor] == '\0') { + err = CFEOLN; + goto out; + } + + if (!ISSPACE(line[cursor])) { + err = CFUNEXPECT; + goto out; + } + + if (ret != NULL) { + custr_t *cs = NULL; + + if (custr_alloc(&cs) != 0) { + err = CFENOMEM; + goto out; + } + + for (i = 0; i < eindex; i++) { + if (custr_len(cs) > 0) { + if (custr_appendc(cs, ',') != 0) { + custr_free(cs); + err = CFENOMEM; + goto out; + } + } + if (custr_append_printf(cs, "%u", elements[i]) != 0) { + custr_free(cs); + err = CFENOMEM; + goto out; + } + } + + if (custr_len(cs) != 0) + *ret = xstrdup(custr_cstr(cs)); + custr_free(cs); + } + +out: + + *cursorp = cursor; + + return (err); +} + +#ifdef PARSETEST +int +main(int argc, char **argv) +{ + int lower, upper, cursor = 0; + char *ret; + + if (argc != 4) + errx(1, "<lower> <upper> <string>"); + + lower = atoi(argv[1]); + upper = atoi(argv[2]); + + switch (next_field(lower, upper, argv[3], &cursor, &ret)) { + case CFOK: + (void) printf("%s\n", ret); + break; + case CFEOLN: + (void) printf("UnexpectedEOL\n"); + break; + case CFUNEXPECT: + (void) printf("UnexpectedChar\n"); + break; + case CFOUTOFBOUND: + (void) printf("OutOfBounds\n"); + break; + case CFEOVERFLOW: + (void) printf("Overflow\n"); + break; + case CFENOMEM: + (void) printf("OutOfMemory\n"); + break; + default: + (void) printf("UnknownError\n"); + break; + } + + return (0); +} +#endif diff --git a/usr/src/cmd/mdb/common/modules/genunix/genunix.c b/usr/src/cmd/mdb/common/modules/genunix/genunix.c index f524a4c60c..de710993ff 100644 --- a/usr/src/cmd/mdb/common/modules/genunix/genunix.c +++ b/usr/src/cmd/mdb/common/modules/genunix/genunix.c @@ -2061,13 +2061,25 @@ lminfo(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) return (mdb_pwalk("lock_graph", lminfo_cb, NULL, 0)); } +typedef struct mdb_whereopen { + uint_t mwo_flags; + uintptr_t mwo_target; + boolean_t mwo_found; +} mdb_whereopen_t; + /*ARGSUSED*/ int -whereopen_fwalk(uintptr_t addr, struct file *f, uintptr_t *target) +whereopen_fwalk(uintptr_t addr, const void *farg, void *arg) { - if ((uintptr_t)f->f_vnode == *target) { - mdb_printf("file %p\n", addr); - *target = 0; + const struct file *f = farg; + mdb_whereopen_t *mwo = arg; + + if ((uintptr_t)f->f_vnode == mwo->mwo_target) { + if ((mwo->mwo_flags & DCMD_PIPE_OUT) == 0 && + !mwo->mwo_found) { + mdb_printf("file %p\n", addr); + } + mwo->mwo_found = B_TRUE; } return (WALK_NEXT); @@ -2075,17 +2087,19 @@ whereopen_fwalk(uintptr_t addr, struct file *f, uintptr_t *target) /*ARGSUSED*/ int -whereopen_pwalk(uintptr_t addr, void *ignored, uintptr_t *target) +whereopen_pwalk(uintptr_t addr, const void *ignored, void *arg) { - uintptr_t t = *target; + mdb_whereopen_t *mwo = arg; - if (mdb_pwalk("file", (mdb_walk_cb_t)whereopen_fwalk, &t, addr) == -1) { + mwo->mwo_found = B_FALSE; + if (mdb_pwalk("file", whereopen_fwalk, mwo, addr) == -1) { mdb_warn("couldn't file walk proc %p", addr); return (WALK_ERR); } - if (t == 0) + if (mwo->mwo_found) { mdb_printf("%p\n", addr); + } return (WALK_NEXT); } @@ -2094,12 +2108,16 @@ whereopen_pwalk(uintptr_t addr, void *ignored, uintptr_t *target) int whereopen(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) { - uintptr_t target = addr; + mdb_whereopen_t mwo; if (!(flags & DCMD_ADDRSPEC) || addr == 0) return (DCMD_USAGE); - if (mdb_walk("proc", (mdb_walk_cb_t)whereopen_pwalk, &target) == -1) { + mwo.mwo_flags = flags; + mwo.mwo_target = addr; + mwo.mwo_found = B_FALSE; + + if (mdb_walk("proc", whereopen_pwalk, &mwo) == -1) { mdb_warn("can't proc walk"); return (DCMD_ERR); } diff --git a/usr/src/lib/fm/topo/modules/common/pcibus/did.c b/usr/src/lib/fm/topo/modules/common/pcibus/did.c index 59ba171c75..a15d722eb1 100644 --- a/usr/src/lib/fm/topo/modules/common/pcibus/did.c +++ b/usr/src/lib/fm/topo/modules/common/pcibus/did.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2019 Joyent, Inc. */ /* @@ -104,11 +105,37 @@ di_devtype_get(topo_mod_t *mp, di_node_t src, char **devtype) typedef struct smbios_slot_cb { int cb_slotnum; + int cb_bdf; const char *cb_label; } smbios_slot_cb_t; static int -di_smbios_find_slot(smbios_hdl_t *shp, const smbios_struct_t *strp, void *data) +di_smbios_find_slot_by_bdf(smbios_hdl_t *shp, const smbios_struct_t *strp, + void *data) +{ + smbios_slot_cb_t *cbp = data; + smbios_slot_t slot; + int bus, df; + + bus = (cbp->cb_bdf & 0xFF00) >> 8; + df = cbp->cb_bdf & 0xFF; + + if (strp->smbstr_type != SMB_TYPE_SLOT || + smbios_info_slot(shp, strp->smbstr_id, &slot) != 0) + return (0); + + if (slot.smbl_bus == bus && slot.smbl_df == df) { + cbp->cb_label = slot.smbl_name; + cbp->cb_slotnum = slot.smbl_id; + return (1); + } + + return (0); +} + +static int +di_smbios_find_slot_by_id(smbios_hdl_t *shp, const smbios_struct_t *strp, + void *data) { smbios_slot_cb_t *cbp = data; smbios_slot_t slot; @@ -126,9 +153,10 @@ di_smbios_find_slot(smbios_hdl_t *shp, const smbios_struct_t *strp, void *data) } static int -di_physlotinfo_get(topo_mod_t *mp, di_node_t src, int *slotnum, char **slotname) +di_physlotinfo_get(topo_mod_t *mp, di_node_t src, int bdf, int *slotnum, + char **slotname) { - char *slotbuf; + char *slotbuf = NULL; int sz; uchar_t *buf; smbios_hdl_t *shp; @@ -154,55 +182,90 @@ di_physlotinfo_get(topo_mod_t *mp, di_node_t src, int *slotnum, char **slotname) (void) sscanf((char *)&buf[4], "Slot%d", slotnum); } - if (*slotnum == -1) - return (0); - /* - * Order of preference - * 1) take slotnum and look up in SMBIOS table - * 2) use slot-names - * 3) fabricate name based on slotnum + * If the system supports SMBIOS (virtual certainty on X86) then we will + * source the label from the Type 9 (Slot) records. If we're unable + * to correlate the device with a slot record (as would happen with + * onboard PCIe devices), we return without setting slotname, which will + * ultimately result in the node inheriting the FRU label from its + * parent node. + * + * In the absence of any SMBIOS support (i.e. SPARC) then we will use + * the slot-names property, if available. Otherwise we'll fall back + * to fabricating a label based on the slot number. */ if ((shp = topo_mod_smbios(mp)) != NULL) { /* * The PCI spec describes slot number 0 as reserved for - * internal PCI devices. Not all platforms respect - * this, so we have to treat slot 0 as a valid device. - * But other platforms use 0 to identify an internal - * device. We deal with this by letting SMBIOS be the - * final decision maker. If SMBIOS is supported, but - * the given slot number is not represented in the - * SMBIOS tables, then ignore the slot entirely. + * internal PCI devices. Unfortunately, not all platforms + * respect this. For that reason, we prefer to lookup the slot + * record using the device's BDF. However, SMBIOS + * implementations prior to 2.6 don't encode the BDF in the + * slot record. In that case we resort to looking up the + * slot record using the slot number. */ smbios_slot_cb_t cbdata; + smbios_version_t smbv; + boolean_t bdf_supp = B_TRUE; cbdata.cb_slotnum = *slotnum; + cbdata.cb_bdf = bdf; cbdata.cb_label = NULL; - if (smbios_iter(shp, di_smbios_find_slot, &cbdata) <= 0) + + /* + * The bus and device/fn payload members of the SMBIOS slot + * record were added in SMBIOS 2.6. + */ + smbios_info_smbios_version(shp, &smbv); + if (smbv.smbv_major < 2 || + (smbv.smbv_major == 2 && smbv.smbv_minor < 6)) { + bdf_supp = B_FALSE; + } + + /* + * If the SMBIOS implementation is too old to look up the slot + * records by BDF and we weren't able to derive a slotnum then + * there is nothing we can do here. + */ + if (!bdf_supp && *slotnum == -1) + return (0); + + if (bdf_supp) + (void) smbios_iter(shp, di_smbios_find_slot_by_bdf, + &cbdata); + else + (void) smbios_iter(shp, di_smbios_find_slot_by_id, + &cbdata); + + if (cbdata.cb_label == NULL) return (0); + slotbuf = (char *)cbdata.cb_label; - topo_mod_dprintf(mp, "%s: node=%p: using smbios name\n", - __func__, src); - } else if (got_slotprop == B_TRUE) { + topo_mod_dprintf(mp, "%s: di_node=%p: using smbios name: %s\n", + __func__, src, slotbuf); + } else if (got_slotprop) { slotbuf = (char *)&buf[4]; - topo_mod_dprintf(mp, "%s: node=%p: found %s property\n", - __func__, src, DI_SLOTPROP); + topo_mod_dprintf(mp, "%s: di_node=%p: using %s property: %s\n", + __func__, src, DI_SLOTPROP, slotbuf); } else { /* * Make generic description string "SLOT <num>", allow up to - * 10 digits for number + * 10 digits for number. Bail, if we weren't able to derive + * a slotnum. */ + if (*slotnum == -1) + return (0); + slotbuf = alloca(16); (void) snprintf(slotbuf, 16, "SLOT %d", *slotnum); - topo_mod_dprintf(mp, "%s: node=%p: using generic slot name\n", - __func__, src); + topo_mod_dprintf(mp, "%s: di_node=%p: using fabricated slot " + "name: %s\n", __func__, src, slotbuf); } - if ((*slotname = topo_mod_strdup(mp, slotbuf)) == NULL) - return (-1); - - topo_mod_dprintf(mp, "%s: node=%p: slotname=%s\n", - __func__, src, *slotname); + if ((*slotname = topo_mod_strdup(mp, slotbuf)) == NULL) { + /* topo errno set */ + return (-1); + } return (0); } @@ -325,7 +388,7 @@ did_create(topo_mod_t *mp, di_node_t src, /* * This is a pciex node. */ - if (di_physlotinfo_get(mp, src, &np->dp_physlot, + if (di_physlotinfo_get(mp, src, np->dp_bdf, &np->dp_physlot, &np->dp_physlot_name) < 0) { if (np->dp_devtype != NULL) topo_mod_strfree(mp, np->dp_devtype); diff --git a/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c b/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c index a7e59ec300..1a767312a1 100644 --- a/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c +++ b/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2019 Joyent, Inc. */ #include <alloca.h> @@ -245,7 +246,7 @@ pci_slot_label_lookup(topo_mod_t *mod, tnode_t *node, did_t *dp, did_t *pdp) * of a slot while the child contains the label. * * Note that this algorithm only applies to nodes which have - * a physcal slot number. (i.e. PCIE devices or PCI/PCIX + * a physical slot number. (i.e. PCIE devices or PCI/PCIX * devices off of a PCIE to PCIX switch) */ if (did_physlot(pdp) >= 0) { @@ -258,7 +259,6 @@ pci_slot_label_lookup(topo_mod_t *mod, tnode_t *node, did_t *dp, did_t *pdp) * Get this device's physical slot name. */ l = (char *)did_physlot_name(pdp, d); - anode = topo_node_parent(node); /* @@ -386,7 +386,7 @@ pci_slot_label_lookup(topo_mod_t *mod, tnode_t *node, did_t *dp, did_t *pdp) */ if ((l = (char *)pci_label_physlot_lookup(mod, pp, pdp)) == NULL) { - if ((l = (char *)did_physlot_name(pdp, d)) != NULL) { + if ((l = (char *)did_physlot_name(dp, d)) != NULL) { l = (char *) pci_label_slotname_lookup(mod, pp, l, dp); } diff --git a/usr/src/lib/libbsm/audit_class.txt b/usr/src/lib/libbsm/audit_class.txt index 30b0d84716..da241cbe77 100644 --- a/usr/src/lib/libbsm/audit_class.txt +++ b/usr/src/lib/libbsm/audit_class.txt @@ -25,8 +25,6 @@ # # User Level Class Masks # -# Developers: If you change this file you must also edit audit.h. -# # "Meta-classes" can be created; these are supersets composed of multiple base # classes, and thus will have more than 1 bit in its mask. See "ad", "all", # "am", and "pc" below for examples. diff --git a/usr/src/lib/libbsm/audit_event.txt b/usr/src/lib/libbsm/audit_event.txt index 393d98ab62..2db2fc017e 100644 --- a/usr/src/lib/libbsm/audit_event.txt +++ b/usr/src/lib/libbsm/audit_event.txt @@ -363,6 +363,11 @@ 311:AUE_AUDITON_SETAMASK:auditon(2) - set default user preselection mask:as 312:AUE_PSECFLAGS:psecflags(2) - set process security flags:pm 313:AUE_SACL:SACL-based File Access Auditing:sa +314:AUE_AUDITON_GETPINFO:auditon(2) - get process info:aa +315:AUE_AUDITON_SETPMASK:auditon(2) - set process preselection mask:as +316:AUE_AUDITON_GETKAUDIT:auditon(2) - get kernel audit characteristics:aa +317:AUE_AUDITON_SETKAUDIT:auditon(2) - set kernel audit characteristics:as +318:AUE_AUDITON_OTHER:auditon(2) - other event:aa # # user level audit events # 2048 - 6143 Reserved diff --git a/usr/src/lib/libzfs/common/libzfs_sendrecv.c b/usr/src/lib/libzfs/common/libzfs_sendrecv.c index 13e1bafa5d..36683ac8e2 100644 --- a/usr/src/lib/libzfs/common/libzfs_sendrecv.c +++ b/usr/src/lib/libzfs/common/libzfs_sendrecv.c @@ -3481,11 +3481,21 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type, /* raw streams can't override encryption properties */ if ((zfs_prop_encryption_key_param(prop) || - prop == ZFS_PROP_ENCRYPTION) && (raw || !newfs)) { + prop == ZFS_PROP_ENCRYPTION) && raw) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "encryption property '%s' cannot " - "be set or excluded for raw or incremental " - "streams."), name); + "be set or excluded for raw streams."), name); + ret = zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + + /* incremental streams can only exclude encryption properties */ + if ((zfs_prop_encryption_key_param(prop) || + prop == ZFS_PROP_ENCRYPTION) && !newfs && + nvpair_type(nvp) != DATA_TYPE_BOOLEAN) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "encryption property '%s' cannot " + "be set for incremental streams."), name); ret = zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } @@ -3503,10 +3513,12 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type, */ if (nvlist_exists(origprops, name)) { nvlist_t *attrs; + char *source = NULL; attrs = fnvlist_lookup_nvlist(origprops, name); - if (strcmp(fnvlist_lookup_string(attrs, - ZPROP_SOURCE), ZPROP_SOURCE_VAL_RECVD) != 0) + if (nvlist_lookup_string(attrs, + ZPROP_SOURCE, &source) == 0 && + strcmp(source, ZPROP_SOURCE_VAL_RECVD) != 0) continue; } /* diff --git a/usr/src/lib/sun_sas/Makefile.com b/usr/src/lib/sun_sas/Makefile.com index a4c1ea4b0b..853108091f 100644 --- a/usr/src/lib/sun_sas/Makefile.com +++ b/usr/src/lib/sun_sas/Makefile.com @@ -22,47 +22,47 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# Copyright (c) 2018, Joyent, Inc. +# Copyright 2019 Joyent, Inc. LIBRARY = libsun_sas.a VERS = .1 OBJECTS = devtree_hba_disco.o \ - devtree_device_disco.o \ - devtree_phy_disco.o \ - devlink_disco.o \ - event.o \ - verify.o \ - SMHBA_RegisterLibrary.o \ - Sun_sasLoadLibrary.o \ - Sun_sasGetNumberOfAdapters.o \ - Sun_sasGetTargetMapping.o \ - Sun_sasGetAdapterName.o \ + devtree_device_disco.o \ + devtree_phy_disco.o \ + devlink_disco.o \ + event.o \ + verify.o \ + SMHBA_RegisterLibrary.o \ + Sun_sasLoadLibrary.o \ + Sun_sasGetNumberOfAdapters.o \ + Sun_sasGetTargetMapping.o \ + Sun_sasGetAdapterName.o \ Sun_sasGetAdapterAttributes.o \ Sun_sasGetAdapterPortAttributes.o \ Sun_sasGetDiscoveredPortAttributes.o \ Sun_sasGetPortAttributesByWWN.o \ Sun_sasGetSASPhyAttributes.o \ Sun_sasGetPortType.o \ - Sun_sasGetNumberOfPorts.o \ - Sun_sasGetVersion.o \ - Sun_sasGetPhyStatistics.o \ - Sun_sasGetVendorLibraryAttributes.o \ - Sun_sasFreeLibrary.o \ - Sun_sasOpenAdapter.o \ - Sun_sasCloseAdapter.o \ - Sun_sasRefreshInformation.o \ - Sun_sasRefreshAdapterConfiguration.o \ - Sun_sasGetLUNStatistics.o \ - Sun_sasGetProtocolStatistics.o \ - Sun_sasGetPersistentBinding.o \ - Sun_sasSetPersistentBinding.o \ + Sun_sasGetNumberOfPorts.o \ + Sun_sasGetVersion.o \ + Sun_sasGetPhyStatistics.o \ + Sun_sasGetVendorLibraryAttributes.o \ + Sun_sasFreeLibrary.o \ + Sun_sasOpenAdapter.o \ + Sun_sasCloseAdapter.o \ + Sun_sasRefreshInformation.o \ + Sun_sasRefreshAdapterConfiguration.o \ + Sun_sasGetLUNStatistics.o \ + Sun_sasGetProtocolStatistics.o \ + Sun_sasGetPersistentBinding.o \ + Sun_sasSetPersistentBinding.o \ Sun_sasSendSMPPassThru.o \ Sun_sasScsiInquiry.o \ Sun_sasScsiReportLUNs.o \ Sun_sasScsiReadCapacity.o \ sun_sas.o \ - log.o + log.o include ../../Makefile.lib @@ -81,12 +81,6 @@ CFLAGS64 += $(CCVERBOSE) CPPFLAGS += $(INCS) -D_POSIX_PTHREAD_SEMANTICS CPPFLAGS += -DBUILD_TIME='"Wed Feb 4 12:00:00 2009"' -CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-unused-value - -# not linted -SMATCH=off - LDLIBS += -ldevinfo LDLIBS += -lsysevent LDLIBS += -lnvpair diff --git a/usr/src/lib/sun_sas/common/Sun_sasFreeLibrary.c b/usr/src/lib/sun_sas/common/Sun_sasFreeLibrary.c index caffe52de1..b30e975fe1 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasFreeLibrary.c +++ b/usr/src/lib/sun_sas/common/Sun_sasFreeLibrary.c @@ -23,7 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> @@ -31,8 +33,10 @@ * Frees the HBA Library. Must be called after all HBA library functions * to free all resources */ -HBA_STATUS Sun_sasFreeLibrary() { - HBA_STATUS status; +HBA_STATUS +Sun_sasFreeLibrary(void) +{ + HBA_STATUS status; lock(&all_hbas_lock); @@ -58,7 +62,9 @@ HBA_STATUS Sun_sasFreeLibrary() { /* * Internal routine to free up hba_ptr's (and all sub-structures) */ -HBA_STATUS FreeHBA(struct sun_sas_hba *hba) { +HBA_STATUS +FreeHBA(struct sun_sas_hba *hba) +{ struct sun_sas_hba *hba_ptr = NULL; struct sun_sas_hba *last_hba_ptr = NULL; struct sun_sas_port *hba_port = NULL; @@ -74,57 +80,55 @@ HBA_STATUS FreeHBA(struct sun_sas_hba *hba) { last_hba_ptr = NULL; /* walk through global_hba_head list freeing each handle */ - for (hba_ptr = hba; - hba_ptr != NULL; - hba_ptr = hba_ptr->next) { + for (hba_ptr = hba; hba_ptr != NULL; hba_ptr = hba_ptr->next) { /* Free the nested structures (port and attached port) */ hba_port = hba_ptr->first_port; while (hba_port != NULL) { - /* Free discovered port structure list. */ - tgt_port = hba_port->first_attached_port; - while (tgt_port != NULL) { - /* Free target mapping data list first. */ - scsi_info = tgt_port->scsiInfo; - while (scsi_info != NULL) { - last_scsi_info = scsi_info; - scsi_info = scsi_info->next; - free(last_scsi_info); - } - last_tgt_port = tgt_port; - tgt_port = tgt_port->next; - free(last_tgt_port->port_attributes.\ + /* Free discovered port structure list. */ + tgt_port = hba_port->first_attached_port; + while (tgt_port != NULL) { + /* Free target mapping data list first. */ + scsi_info = tgt_port->scsiInfo; + while (scsi_info != NULL) { + last_scsi_info = scsi_info; + scsi_info = scsi_info->next; + free(last_scsi_info); + } + last_tgt_port = tgt_port; + tgt_port = tgt_port->next; + free(last_tgt_port->port_attributes.\ + PortSpecificAttribute.SASPort); + free(last_tgt_port); + } + + phy_ptr = hba_port->first_phy; + while (phy_ptr != NULL) { + last_phy = phy_ptr; + phy_ptr = phy_ptr->next; + free(last_phy); + } + + last_hba_port = hba_port; + hba_port = hba_port->next; + free(last_hba_port->port_attributes.\ PortSpecificAttribute.SASPort); - free(last_tgt_port); - } - - phy_ptr = hba_port->first_phy; - while (phy_ptr != NULL) { - last_phy = phy_ptr; - phy_ptr = phy_ptr->next; - free(last_phy); - } - - last_hba_port = hba_port; - hba_port = hba_port->next; - free(last_hba_port->port_attributes.\ - PortSpecificAttribute.SASPort); - free(last_hba_port); + free(last_hba_port); } open_handle = hba_ptr->open_handles; while (open_handle != NULL) { - last_open_handle = open_handle; - open_handle = open_handle->next; - free(last_open_handle); + last_open_handle = open_handle; + open_handle = open_handle->next; + free(last_open_handle); } /* Free up the top level HBA structure from the last spin */ if (last_hba_ptr != NULL) { - free(last_hba_ptr); + free(last_hba_ptr); } last_hba_ptr = hba_ptr; } if (last_hba_ptr != NULL) { - free(last_hba_ptr); + free(last_hba_ptr); } return (HBA_STATUS_OK); diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetAdapterAttributes.c b/usr/src/lib/sun_sas/common/Sun_sasGetAdapterAttributes.c index d5e5e55ec1..07dae789b9 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetAdapterAttributes.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetAdapterAttributes.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> /* @@ -30,14 +33,15 @@ */ HBA_STATUS Sun_sasGetAdapterAttributes(HBA_HANDLE handle, - PSMHBA_ADAPTERATTRIBUTES attributes) { + PSMHBA_ADAPTERATTRIBUTES attributes) +{ const char ROUTINE[] = "Sun_sasGetAdapterAttributes"; - struct sun_sas_hba *hba_ptr; - int index = 0; + struct sun_sas_hba *hba_ptr; + int index = 0; if (attributes == NULL) { - log(LOG_DEBUG, ROUTINE, "NULL attributes pointer"); - return (HBA_STATUS_ERROR_ARG); + log(LOG_DEBUG, ROUTINE, "NULL attributes pointer"); + return (HBA_STATUS_ERROR_ARG); } lock(&all_hbas_lock); @@ -45,11 +49,10 @@ Sun_sasGetAdapterAttributes(HBA_HANDLE handle, lock(&open_handles_lock); hba_ptr = RetrieveHandle(index); if (hba_ptr == NULL) { - log(LOG_DEBUG, ROUTINE, - "Invalid handle %08lx", handle); - unlock(&open_handles_lock); - unlock(&all_hbas_lock); - return (HBA_STATUS_ERROR_INVALID_HANDLE); + log(LOG_DEBUG, ROUTINE, "Invalid handle %08lx", handle); + unlock(&open_handles_lock); + unlock(&all_hbas_lock); + return (HBA_STATUS_ERROR_INVALID_HANDLE); } (void) memcpy(attributes, &hba_ptr->adapter_attributes, diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetAdapterName.c b/usr/src/lib/sun_sas/common/Sun_sasGetAdapterName.c index bf945aedb9..041874e1d6 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetAdapterName.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetAdapterName.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include "sun_sas.h" @@ -31,36 +34,40 @@ * open the adapter with the library. * * Arguments: - * index the index to which adapter to retrive the name + * index the index to which adapter to retrieve the name * name buffer to which the adapter name will be placed */ -HBA_STATUS Sun_sasGetAdapterName(HBA_UINT32 index, char *name) { +HBA_STATUS +Sun_sasGetAdapterName(HBA_UINT32 index, char *name) +{ const char ROUTINE[] = "Sun_sasGetAdapterName"; struct sun_sas_hba *hba_ptr; if (name == NULL) { - log(LOG_DEBUG, ROUTINE, "NULL adapter name"); - return (HBA_STATUS_ERROR_ARG); + log(LOG_DEBUG, ROUTINE, "NULL adapter name"); + return (HBA_STATUS_ERROR_ARG); } lock(&all_hbas_lock); for (hba_ptr = global_hba_head; hba_ptr != NULL; - hba_ptr = hba_ptr->next) { - if (hba_ptr->index == index) { - if (hba_ptr->handle_name == NULL) { - hba_ptr = NULL; + hba_ptr = hba_ptr->next) { + if (hba_ptr->index == index) { + if (hba_ptr->handle_name[0] == '\0') { + hba_ptr = NULL; + break; + } + /* + * Flaw in the spec! How do we know the size of name? + */ + (void) strlcpy(name, hba_ptr->handle_name, + strlen(hba_ptr->handle_name)+1); break; - } - /* Flaw in the spec! How do we know the size of name? */ - (void) strlcpy(name, hba_ptr->handle_name, - strlen(hba_ptr->handle_name)+1); - break; - } + } } unlock(&all_hbas_lock); if (hba_ptr == NULL) { - log(LOG_DEBUG, ROUTINE, - "Unable to find adapter index %d.", index); - return (HBA_STATUS_ERROR_ILLEGAL_INDEX); + log(LOG_DEBUG, ROUTINE, + "Unable to find adapter index %d.", index); + return (HBA_STATUS_ERROR_ILLEGAL_INDEX); } return (HBA_STATUS_OK); diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetAdapterPortAttributes.c b/usr/src/lib/sun_sas/common/Sun_sasGetAdapterPortAttributes.c index cd60698a72..175df42a47 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetAdapterPortAttributes.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetAdapterPortAttributes.c @@ -23,15 +23,18 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> /* * Retrieves the attributes for a specified port of an adapter */ HBA_STATUS -Sun_sasGetAdapterPortAttributes(HBA_HANDLE handle, - HBA_UINT32 port, PSMHBA_PORTATTRIBUTES attributes) { +Sun_sasGetAdapterPortAttributes(HBA_HANDLE handle, HBA_UINT32 port, + PSMHBA_PORTATTRIBUTES attributes) +{ const char ROUTINE[] = "Sun_sasGetAdapterPortAttributes"; HBA_STATUS status; struct sun_sas_hba *hba_ptr; @@ -41,8 +44,8 @@ Sun_sasGetAdapterPortAttributes(HBA_HANDLE handle, /* Validate the arguments */ if ((attributes == NULL) || (attributes->PortSpecificAttribute.SASPort == NULL)) { - log(LOG_DEBUG, ROUTINE, "NULL attributes"); - return (HBA_STATUS_ERROR_ARG); + log(LOG_DEBUG, ROUTINE, "NULL attributes"); + return (HBA_STATUS_ERROR_ARG); } lock(&all_hbas_lock); @@ -66,19 +69,17 @@ Sun_sasGetAdapterPortAttributes(HBA_HANDLE handle, } if (hba_ptr->first_port == NULL) { - /* This is probably an internal failure of the library */ - if (hba_ptr->device_path) { - log(LOG_DEBUG, ROUTINE, - "Internal failure: Adapter %s contains no port data", - hba_ptr->device_path); - } else { - log(LOG_DEBUG, ROUTINE, - "Internal failure: Adapter at index %d contains no port " - "data", hba_ptr->index); - } - unlock(&open_handles_lock); - unlock(&all_hbas_lock); - return (HBA_STATUS_ERROR); + /* This is probably an internal failure of the library */ + if (hba_ptr->device_path[0] != '\0') { + log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter " + "%s contains no port data", hba_ptr->device_path); + } else { + log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter at" + " index %d contains no port data", hba_ptr->index); + } + unlock(&open_handles_lock); + unlock(&all_hbas_lock); + return (HBA_STATUS_ERROR); } for (hba_port_ptr = hba_ptr->first_port; hba_port_ptr != NULL; hba_port_ptr = hba_port_ptr->next) { diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetDiscoveredPortAttributes.c b/usr/src/lib/sun_sas/common/Sun_sasGetDiscoveredPortAttributes.c index 10de1cbcff..75609ffbc2 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetDiscoveredPortAttributes.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetDiscoveredPortAttributes.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> @@ -31,8 +34,9 @@ */ HBA_STATUS Sun_sasGetDiscoveredPortAttributes(HBA_HANDLE handle, - HBA_UINT32 port, HBA_UINT32 discoveredport, - SMHBA_PORTATTRIBUTES *attributes) { + HBA_UINT32 port, HBA_UINT32 discoveredport, + SMHBA_PORTATTRIBUTES *attributes) +{ const char ROUTINE[] = "Sun_sasGetDiscoveredPortAttributes"; HBA_STATUS status; @@ -42,10 +46,10 @@ Sun_sasGetDiscoveredPortAttributes(HBA_HANDLE handle, int index; if (attributes == NULL) { - log(LOG_DEBUG, ROUTINE, - "NULL attributes argument. Handle %08lx, port %d, " - "discovered port %d", handle, port, discoveredport); - return (HBA_STATUS_ERROR_ARG); + log(LOG_DEBUG, ROUTINE, + "NULL attributes argument. Handle %08lx, port %d, " + "discovered port %d", handle, port, discoveredport); + return (HBA_STATUS_ERROR_ARG); } lock(&all_hbas_lock); @@ -53,37 +57,34 @@ Sun_sasGetDiscoveredPortAttributes(HBA_HANDLE handle, lock(&open_handles_lock); hba_ptr = RetrieveHandle(index); if (hba_ptr == NULL) { - log(LOG_DEBUG, ROUTINE, - "Invalid handle %08lx.", handle); - unlock(&open_handles_lock); - unlock(&all_hbas_lock); - return (HBA_STATUS_ERROR_INVALID_HANDLE); + log(LOG_DEBUG, ROUTINE, "Invalid handle %08lx.", handle); + unlock(&open_handles_lock); + unlock(&all_hbas_lock); + return (HBA_STATUS_ERROR_INVALID_HANDLE); } /* Check for stale data */ status = verifyAdapter(hba_ptr); if (status != HBA_STATUS_OK) { - log(LOG_DEBUG, ROUTINE, "Verify Adapter failed"); - unlock(&open_handles_lock); - unlock(&all_hbas_lock); - return (status); + log(LOG_DEBUG, ROUTINE, "Verify Adapter failed"); + unlock(&open_handles_lock); + unlock(&all_hbas_lock); + return (status); } if (hba_ptr->first_port == NULL) { - /* This is probably an internal failure of the library */ - if (hba_ptr->device_path) { - log(LOG_DEBUG, ROUTINE, - "Internal failure: Adapter %s contains no port data", - hba_ptr->device_path); - } else { - log(LOG_DEBUG, ROUTINE, - "Internal failure: Adapter at index %d contains no port " - "data", hba_ptr->index); - } - unlock(&open_handles_lock); - unlock(&all_hbas_lock); - return (HBA_STATUS_ERROR); + /* This is probably an internal failure of the library */ + if (hba_ptr->device_path[0] != '\0') { + log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter %s" + " contains no port data", hba_ptr->device_path); + } else { + log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter at" + " index %d contains no port data", hba_ptr->index); + } + unlock(&open_handles_lock); + unlock(&all_hbas_lock); + return (HBA_STATUS_ERROR); } for (hba_port_ptr = hba_ptr->first_port; @@ -105,11 +106,11 @@ Sun_sasGetDiscoveredPortAttributes(HBA_HANDLE handle, /* check to make sure there are devices attached to this port */ if (hba_port_ptr->first_attached_port != NULL) { for (hba_disco_port = hba_port_ptr->first_attached_port; - hba_disco_port != NULL; - hba_disco_port = hba_disco_port->next) { - if (hba_disco_port->index == discoveredport) { - break; - } + hba_disco_port != NULL; + hba_disco_port = hba_disco_port->next) { + if (hba_disco_port->index == discoveredport) { + break; + } } if (hba_disco_port == NULL) { log(LOG_DEBUG, ROUTINE, @@ -118,16 +119,17 @@ Sun_sasGetDiscoveredPortAttributes(HBA_HANDLE handle, discoveredport, port, handle); ret = HBA_STATUS_ERROR_ILLEGAL_INDEX; } else { - attributes->PortType = - hba_disco_port->port_attributes.PortType; - attributes->PortState = - hba_disco_port->port_attributes.PortState; - (void) strlcpy(attributes->OSDeviceName, - hba_disco_port->port_attributes.OSDeviceName, - sizeof (attributes->OSDeviceName)); - (void) memcpy(attributes->PortSpecificAttribute.SASPort, - hba_disco_port->port_attributes.PortSpecificAttribute. - SASPort, sizeof (struct SMHBA_SAS_Port)); + attributes->PortType = + hba_disco_port->port_attributes.PortType; + attributes->PortState = + hba_disco_port->port_attributes.PortState; + (void) strlcpy(attributes->OSDeviceName, + hba_disco_port->port_attributes.OSDeviceName, + sizeof (attributes->OSDeviceName)); + (void) memcpy(attributes->PortSpecificAttribute.SASPort, + hba_disco_port->port_attributes.\ + PortSpecificAttribute.SASPort, + sizeof (struct SMHBA_SAS_Port)); } } else { /* No ports, so we can't possibly return anything */ diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetNumberOfAdapters.c b/usr/src/lib/sun_sas/common/Sun_sasGetNumberOfAdapters.c index 71bf0fc315..2d114e8486 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetNumberOfAdapters.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetNumberOfAdapters.c @@ -23,17 +23,21 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> /* * Returns the number of HBAs supported by the library. This returns the * current number of HBAs, even if this changes - * */ -HBA_UINT32 Sun_sasGetNumberOfAdapters() { - int count; - struct sun_sas_hba *hba_ptr; +HBA_UINT32 +Sun_sasGetNumberOfAdapters(void) +{ + int count; + struct sun_sas_hba *hba_ptr; lock(&all_hbas_lock); /* goes through hba list counting all the hbas found */ diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetPhyStatistics.c b/usr/src/lib/sun_sas/common/Sun_sasGetPhyStatistics.c index 10f73604cf..4839c5860a 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetPhyStatistics.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetPhyStatistics.c @@ -23,15 +23,19 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - +/* + * Copyright 2019 Joyent, Inc. + */ #include <kstat.h> #include <sun_sas.h> /* * Retrieves the statistics for a specified port.phy on an adapter */ -HBA_STATUS Sun_sasGetPhyStatistics(HBA_HANDLE handle, - HBA_UINT32 port, HBA_UINT32 phy, SMHBA_PHYSTATISTICS *pStatistics) { +HBA_STATUS +Sun_sasGetPhyStatistics(HBA_HANDLE handle, HBA_UINT32 port, HBA_UINT32 phy, + SMHBA_PHYSTATISTICS *pStatistics) +{ const char ROUTINE[] = "Sun_sasGetPhyStatistics"; HBA_STATUS status = HBA_STATUS_OK; struct sun_sas_hba *hba_ptr; @@ -125,7 +129,7 @@ HBA_STATUS Sun_sasGetPhyStatistics(HBA_HANDLE handle, /* First, we need the deivce path to locate the devinfo node. */ - (void *) strlcpy(path, hba_port_ptr->device_path, + (void) strlcpy(path, hba_port_ptr->device_path, sizeof (path)); charptr = strrchr(path, ':'); if (charptr) { @@ -216,7 +220,7 @@ HBA_STATUS Sun_sasGetPhyStatistics(HBA_HANDLE handle, for (i = 0; i < ksp->ks_ndata; i++, kname++) { if (strcmp(kname->name, "SecondsSinceLastReset") == 0) { - psas->SecondsSinceLastReset = kname->value.ull; + psas->SecondsSinceLastReset = kname->value.ull; continue; } if (strcmp(kname->name, "TxFrames") == 0) { diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetPortAttributesByWWN.c b/usr/src/lib/sun_sas/common/Sun_sasGetPortAttributesByWWN.c index 5c4723791a..321eb5b441 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetPortAttributesByWWN.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetPortAttributesByWWN.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> @@ -70,8 +73,8 @@ Sun_sasGetPortAttributesByWWN(HBA_HANDLE handle, HBA_WWN portWWN, } if (hba_ptr->first_port == NULL) { - /* This is probably an internal failure of the library */ - if (hba_ptr->device_path) { + /* This is probably an internal failure of the library */ + if (hba_ptr->device_path[0] != '\0') { log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter %s contains " "no port data", hba_ptr->device_path); diff --git a/usr/src/lib/sun_sas/common/Sun_sasGetPortType.c b/usr/src/lib/sun_sas/common/Sun_sasGetPortType.c index 3c422e4777..b1c81cb3b3 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasGetPortType.c +++ b/usr/src/lib/sun_sas/common/Sun_sasGetPortType.c @@ -23,7 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> /* @@ -31,8 +33,8 @@ * current number of HBAs, even if this changes * */ -HBA_UINT32 Sun_sasGetPortType(HBA_HANDLE handle, HBA_UINT32 port, - HBA_PORTTYPE *porttype) +HBA_UINT32 +Sun_sasGetPortType(HBA_HANDLE handle, HBA_UINT32 port, HBA_PORTTYPE *porttype) { const char ROUTINE[] = "Sun_sasGetPortType"; int index; @@ -58,8 +60,8 @@ HBA_UINT32 Sun_sasGetPortType(HBA_HANDLE handle, HBA_UINT32 port, } if (hba_ptr->first_port == NULL) { - /* This is probably an internal failure of the library */ - if (hba_ptr->device_path) { + /* This is probably an internal failure of the library */ + if (hba_ptr->device_path[0] != '\0') { log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter %s contains no port " "data.", hba_ptr->device_path); diff --git a/usr/src/lib/sun_sas/common/Sun_sasOpenAdapter.c b/usr/src/lib/sun_sas/common/Sun_sasOpenAdapter.c index 4556b4f86e..f4f515efd0 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasOpenAdapter.c +++ b/usr/src/lib/sun_sas/common/Sun_sasOpenAdapter.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> @@ -36,7 +39,7 @@ */ HBA_HANDLE Sun_sasOpenAdapter(char *name) { const char ROUTINE[] = "Sun_sasOpenAdapter"; - struct sun_sas_hba *hba_ptr; + struct sun_sas_hba *hba_ptr; if (name == NULL) { log(LOG_DEBUG, ROUTINE, "NULL adapter name."); diff --git a/usr/src/lib/sun_sas/common/Sun_sasRefreshAdapterConfiguration.c b/usr/src/lib/sun_sas/common/Sun_sasRefreshAdapterConfiguration.c index 591342ad39..b3b22fe991 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasRefreshAdapterConfiguration.c +++ b/usr/src/lib/sun_sas/common/Sun_sasRefreshAdapterConfiguration.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> @@ -56,7 +59,7 @@ find_matching_hba(di_node_t node, void *arg) devpath); if ((strstr(fulldevpath, wa->devpath)) != NULL) { - *wa->flag = B_TRUE; + *wa->flag = B_TRUE; /* Found a node. No need to walk any more. */ di_devfs_path_free(devpath); return (DI_WALK_TERMINATE); diff --git a/usr/src/lib/sun_sas/common/Sun_sasScsiInquiry.c b/usr/src/lib/sun_sas/common/Sun_sasScsiInquiry.c index 144a85d89d..f6dc9f367a 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasScsiInquiry.c +++ b/usr/src/lib/sun_sas/common/Sun_sasScsiInquiry.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> @@ -67,9 +70,9 @@ SendScsiInquiry(const char *devpath, HBA_UINT8 cdb1, HBA_UINT8 cdb2, */ HBA_STATUS Sun_sasScsiInquiry(HBA_HANDLE handle, HBA_WWN portWWN, HBA_WWN targetPortWWN, - HBA_WWN domainPortWWN, SMHBA_SCSILUN smhbaLUN, HBA_UINT8 cdb1, - HBA_UINT8 cdb2, void *responseBuffer, HBA_UINT32 *responseSize, - HBA_UINT8 *scsiStatus, void *senseBuffer, HBA_UINT32 *senseSize) + HBA_WWN domainPortWWN, SMHBA_SCSILUN smhbaLUN, HBA_UINT8 cdb1, + HBA_UINT8 cdb2, void *responseBuffer, HBA_UINT32 *responseSize, + HBA_UINT8 *scsiStatus, void *senseBuffer, HBA_UINT32 *senseSize) { const char ROUTINE[] = "Sun_sasScsiInquiry"; HBA_STATUS status; @@ -131,9 +134,9 @@ Sun_sasScsiInquiry(HBA_HANDLE handle, HBA_WWN portWWN, HBA_WWN targetPortWWN, * By verifying this information here, we will take a big performance * hit. This check will be done later only if the Inquiry ioctl fails */ - if (hba_ptr->device_path == NULL) { + if (hba_ptr->device_path[0] == '\0') { log(LOG_DEBUG, ROUTINE, - "HBA handle had NULL device path. \ + "HBA handle had empty device path. \ Unable to send SCSI cmd"); unlock(&open_handles_lock); unlock(&all_hbas_lock); diff --git a/usr/src/lib/sun_sas/common/Sun_sasSendSMPPassThru.c b/usr/src/lib/sun_sas/common/Sun_sasSendSMPPassThru.c index 914f47de06..74eccacf24 100644 --- a/usr/src/lib/sun_sas/common/Sun_sasSendSMPPassThru.c +++ b/usr/src/lib/sun_sas/common/Sun_sasSendSMPPassThru.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> #include <sys/scsi/impl/usmp.h> @@ -32,7 +35,8 @@ */ static HBA_STATUS SendSMPPassThru(const char *devpath, void *reqframe, HBA_UINT32 *reqsize, - void *rspframe, HBA_UINT32 *rspsize) { + void *rspframe, HBA_UINT32 *rspsize) +{ const char ROUTINE[] = "SendSMPPassThru"; int fd; usmp_cmd_t ucmd_buf; @@ -63,11 +67,11 @@ SendSMPPassThru(const char *devpath, void *reqframe, HBA_UINT32 *reqsize, if (ioctl(fd, USMPFUNC, &ucmd_buf) == -1) { if ((errno == ETIME) || (errno == ETIMEDOUT) || (errno == EAGAIN)) { - ret = HBA_STATUS_ERROR_TRY_AGAIN; + ret = HBA_STATUS_ERROR_TRY_AGAIN; } else if (errno == EBUSY) { - ret = HBA_STATUS_ERROR_BUSY; + ret = HBA_STATUS_ERROR_BUSY; } else { - ret = HBA_STATUS_ERROR; + ret = HBA_STATUS_ERROR; } log(LOG_DEBUG, ROUTINE, "ioctl:USMPFUNC failed due to %s", strerror(errno)); @@ -133,9 +137,9 @@ Sun_sasSendSMPPassThru(HBA_HANDLE handle, HBA_WWN hbaPortWWN, * hit. This check will be done later only if the Inquiry ioctl fails */ - if (hba_ptr->device_path == NULL) { + if (hba_ptr->device_path[0] == '\0') { log(LOG_DEBUG, ROUTINE, - "HBA handle had NULL device path.\ + "HBA handle had empty device path.\ Unable to send SCSI cmd"); unlock(&all_hbas_lock); return (HBA_STATUS_ERROR); diff --git a/usr/src/lib/sun_sas/common/devlink_disco.c b/usr/src/lib/sun_sas/common/devlink_disco.c index 9b616e2293..96f5b7bbcb 100644 --- a/usr/src/lib/sun_sas/common/devlink_disco.c +++ b/usr/src/lib/sun_sas/common/devlink_disco.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> #include <sys/types.h> @@ -198,7 +201,7 @@ lookupLink(char *path, char *link, const char *dir, const char *mname) charptr = dirp->d_name; (void) snprintf(node, strlen(charptr) + strlen(dir) + 2, "%s/%s", dir, charptr); - if (count = readlink(node, buf, sizeof (buf))) { + if ((count = readlink(node, buf, sizeof (buf))) > 0) { subpath = NULL; subpath = strstr(buf, path); buf[count] = '\0'; diff --git a/usr/src/lib/sun_sas/common/devtree_device_disco.c b/usr/src/lib/sun_sas/common/devtree_device_disco.c index 53254766ac..452a2bf70a 100644 --- a/usr/src/lib/sun_sas/common/devtree_device_disco.c +++ b/usr/src/lib/sun_sas/common/devtree_device_disco.c @@ -23,6 +23,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Joyent, Inc. */ #include <sun_sas.h> @@ -84,8 +85,8 @@ get_minor(char *devpath, char *minor) static void free_attached_port(struct sun_sas_port *port_ptr) { - struct sun_sas_port *tgt_port, *last_tgt_port; - struct ScsiEntryList *scsi_info = NULL, *last_scsi_info = NULL; + struct sun_sas_port *tgt_port, *last_tgt_port; + struct ScsiEntryList *scsi_info = NULL, *last_scsi_info = NULL; tgt_port = port_ptr->first_attached_port; while (tgt_port != NULL) { @@ -228,6 +229,7 @@ get_attached_devices_info(di_node_t node, struct sun_sas_port *port_ptr) char *devpath, link[MAXNAMELEN]; char fullpath[MAXPATHLEN+1]; char minorname[MAXNAMELEN+1]; + SMHBA_PORTATTRIBUTES *portattrs; struct ScsiEntryList *mapping_ptr; HBA_WWN SASAddress, AttachedSASAddress; struct sun_sas_port *disco_port_ptr; @@ -488,11 +490,11 @@ get_attached_devices_info(di_node_t node, struct sun_sas_port *port_ptr) } /* SMP device was handled already */ - if (disco_port_ptr->port_attributes.OSDeviceName[0] == '\0') { - /* indentation change due to ctysle check on sizeof. */ - size = sizeof (disco_port_ptr->port_attributes.OSDeviceName); - (void) strlcpy(disco_port_ptr->port_attributes. - OSDeviceName, fullpath, size); + portattrs = &disco_port_ptr->port_attributes; + if (portattrs->OSDeviceName[0] == '\0') { + size = sizeof (portattrs->OSDeviceName); + (void) strlcpy(portattrs->OSDeviceName, + fullpath, size); } /* add new discovered port into the list */ @@ -651,6 +653,7 @@ get_attached_paths_info(di_path_t path, struct sun_sas_port *port_ptr) char *pathdevpath = NULL; char fullpath[MAXPATHLEN+1]; char minorname[MAXNAMELEN+1]; + SMHBA_PORTATTRIBUTES *portattrs; struct ScsiEntryList *mapping_ptr; HBA_WWN SASAddress, AttachedSASAddress; struct sun_sas_port *disco_port_ptr; @@ -678,7 +681,7 @@ get_attached_paths_info(di_path_t path, struct sun_sas_port *port_ptr) port_state = HBA_PORTSTATE_OFFLINE; } - if (clientnode = di_path_client_node(path)) { + if ((clientnode = di_path_client_node(path)) != DI_NODE_NIL) { if (di_retired(clientnode)) { log(LOG_DEBUG, ROUTINE, "client node of path (%s) is retired. Skipping.", @@ -904,12 +907,12 @@ get_attached_paths_info(di_path_t path, struct sun_sas_port *port_ptr) SASPort->PortProtocol = HBA_SASPORTPROTOCOL_SSP; } - if (disco_port_ptr->port_attributes.OSDeviceName[0] == '\0') { - /* indentation change due to ctysle check on sizeof. */ - size = sizeof (disco_port_ptr->port_attributes.OSDeviceName); + portattrs = &disco_port_ptr->port_attributes; + if (portattrs->OSDeviceName[0] == '\0') { + size = sizeof (portattrs->OSDeviceName); if (pathdevpath != NULL) { - (void) strlcpy(disco_port_ptr->port_attributes. - OSDeviceName, pathdevpath, size); + (void) strlcpy(portattrs->OSDeviceName, + pathdevpath, size); } } diff --git a/usr/src/lib/sun_sas/common/devtree_hba_disco.c b/usr/src/lib/sun_sas/common/devtree_hba_disco.c index 2ba9ef6e57..bfd584008b 100644 --- a/usr/src/lib/sun_sas/common/devtree_hba_disco.c +++ b/usr/src/lib/sun_sas/common/devtree_hba_disco.c @@ -22,6 +22,9 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> #include <sys/modctl.h> @@ -595,9 +598,9 @@ devtree_get_one_hba(di_node_t hbaNode) static int lookup_smhba_sas_hba(di_node_t node, void *arg) { - const char ROUTINE[] = "lookup_smhba_sas_hba"; - int *propData, rval; - walkarg_t *wa = (walkarg_t *)arg; + const char ROUTINE[] = "lookup_smhba_sas_hba"; + int *propData, rval; + walkarg_t *wa = (walkarg_t *)arg; /* Skip stub(instance -1) nodes */ if (IS_STUB_NODE(node)) { diff --git a/usr/src/lib/sun_sas/common/event.c b/usr/src/lib/sun_sas/common/event.c index a4030d5d1b..f565b9bd92 100644 --- a/usr/src/lib/sun_sas/common/event.c +++ b/usr/src/lib/sun_sas/common/event.c @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ #include <sun_sas.h> #include <libsysevent.h> @@ -133,10 +136,10 @@ syseventHandler(sysevent_t *ev) { const char ROUTINE[] = "syseventHandler"; - nvlist_t *attrList = NULL; + nvlist_t *attrList = NULL; char *eventStr, *portAddrStr, *charptr; int update; - uint64_t addr; + uint64_t addr; uint8_t phyId, linkRate; HBA_WWN portAddr; @@ -226,8 +229,8 @@ syseventHandler(sysevent_t *ev) /* Registers events to the sysevent framework */ HBA_STATUS -registerSysevent() { - +registerSysevent(void) +{ const char ROUTINE[] = "registerSysevent"; const char *hba_subclass_list[] = { ESC_SAS_PHY_EVENT diff --git a/usr/src/lib/sun_sas/common/sun_sas.c b/usr/src/lib/sun_sas/common/sun_sas.c index 0494238137..5dee35d5b2 100644 --- a/usr/src/lib/sun_sas/common/sun_sas.c +++ b/usr/src/lib/sun_sas/common/sun_sas.c @@ -23,7 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - +/* + * Copyright 2019 Joyent, Inc. + */ #include <sys/byteorder.h> #include <sun_sas.h> @@ -156,7 +158,7 @@ RetrieveOpenHandle(HBA_HANDLE handle) struct sun_sas_hba * RetrieveHandle(int index) { - struct sun_sas_hba *hba_ptr = NULL; + struct sun_sas_hba *hba_ptr = NULL; for (hba_ptr = global_hba_head; hba_ptr != NULL; hba_ptr = hba_ptr->next) { @@ -176,8 +178,8 @@ RetrieveHandle(int index) struct sun_sas_hba * ExtractHandle(int index) { - struct sun_sas_hba *last = NULL; - struct sun_sas_hba *hba_ptr = NULL; + struct sun_sas_hba *last = NULL; + struct sun_sas_hba *hba_ptr = NULL; for (hba_ptr = global_hba_head; hba_ptr != NULL; @@ -344,7 +346,7 @@ getFirstAdapterPortWWN(HBA_HANDLE handle) if (hba_ptr->first_port == NULL) { /* This is probably an internal failure of the library */ - if (hba_ptr->device_path) { + if (hba_ptr->device_path[0] != '\0') { log(LOG_DEBUG, ROUTINE, "Internal failure: Adapter %s contains no " "port data", hba_ptr->device_path); diff --git a/usr/src/man/man1/crontab.1 b/usr/src/man/man1/crontab.1 index 5a83c44530..c954036653 100644 --- a/usr/src/man/man1/crontab.1 +++ b/usr/src/man/man1/crontab.1 @@ -45,12 +45,12 @@ .\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved +.\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association. .\" -.TH CRONTAB 1 "Mar 6, 2017" +.TH CRONTAB 1 "Oct 22, 2019" .SH NAME crontab \- user crontab file .SH SYNOPSIS -.LP .nf \fB/usr/bin/crontab\fR [\fIfilename\fR] .fi @@ -111,7 +111,6 @@ crontab \- user crontab file .fi .SH DESCRIPTION -.LP The \fBcrontab\fR utility manages a user's access with \fBcron\fR (see \fBcron\fR(1M)) by copying, creating, listing, and removing \fBcrontab\fR files. If invoked without options, \fBcrontab\fR copies the specified file, or @@ -133,7 +132,6 @@ of interest to system-defined users such as \fBroot\fR. Except where otherwise explicitly indicated, all variants of the \fBcrontab\fR command act only on the editable crontab files found in \fB/var/spool/cron/crontabs\fR. .SS "\fBcrontab\fR Access Control" -.LP Users: Access to \fBcrontab\fR is allowed: .RS +4 .TP @@ -188,7 +186,6 @@ The rules for \fBallow\fR and \fBdeny\fR apply to \fBroot\fR only if the .LP The \fBallow\fR/\fBdeny\fR files consist of one user name per line. .SS "\fBcrontab\fR Entry Format" -.LP A \fBcrontab\fR file consists of lines of six fields each. The fields are separated by spaces or tabs. The first five are integer patterns that specify the following: @@ -208,10 +205,16 @@ day of the week (0\(mi6 with 0=Sunday). .LP Each of these patterns can be either an asterisk (meaning all legal values) or a list of elements separated by commas. An element is either a number or two -numbers separated by a minus sign (meaning an inclusive range). Time specified -here is interpreted in the currently active timezone. At the top of the crontab -file this is the timezone which is set system-wide in /etc/default/init. A user -can add a line such as: +numbers separated by a hyphen (meaning an inclusive range). +.LP +A range or asterisk can optionally be followed by a step value as +\fI/<number>\fR. For example, \fI2\(mi59/3\fR can be used in the minutes field +to specify every three minutes starting at 2 past the hour, or \fI*/2\fR in +the hours field means every two hours. +.LP +Time specified here is interpreted in the currently active timezone. At the top +of the crontab file this is the timezone which is set system-wide in +/etc/default/init. A user can add a line such as: .sp .in +2 .nf @@ -278,7 +281,6 @@ environment variables are set to match those that are in effect in the If you do not redirect the standard output and standard error of your commands, any generated output or errors are mailed to you. .SS "\fBcrontab\fR Environment Variables" -.LP The following variables are supported: .sp .ne 2 @@ -350,7 +352,6 @@ The lines that are not setting these environment variables are the same as crontab entries that conform to the UNIX standard and are described elsewhere in this man page. .SS "Setting \fBcron\fR Jobs Across Timezones" -.LP The default timezone of the \fBcron\fR daemon sets the system-wide timezone for \fBcron\fR entries. This, in turn, is by set by default system-wide using \fB/etc/default/init\fR. @@ -360,7 +361,6 @@ If some form of \fBdaylight savings\fR or \fBsummer/winter time\fR is in effect, then jobs scheduled during the switchover period could be executed once, twice, or not at all. .SH OPTIONS -.LP The following options are supported: .sp .ne 2 @@ -429,7 +429,6 @@ user. .RE .SH EXAMPLES -.LP \fBExample 1 \fRCleaning up Core Files .sp .LP @@ -490,7 +489,33 @@ example: would run a command only on Mondays. .LP -\fBExample 4 \fRUsing Environment Variables +\fBExample 4 \fRUsing step values: +.sp +.LP +This example runs a job every hour during the night and every 3 hours during +working hours. + +.sp +.in +2 +.nf +\fB0 8-18/3,19-7 * * *\fR +.fi +.in -2 +.sp + +.LP +and to run a job every 2 minutes, use: + +.sp +.in +2 +.nf +\fB*/2 * * * *\fR +.fi +.in -2 +.sp + +.LP +\fBExample 5 \fRUsing Environment Variables .sp .LP The following entries take advantage of \fBcrontab\fR support for certain @@ -521,7 +546,6 @@ Korn shell. The file concludes with \fBTZ\fR, \fBHOME\fR, and \fBSHELL\fR entries that return those variable to their default values. .SH ENVIRONMENT VARIABLES -.LP See \fBenviron\fR(5) for descriptions of the following environment variables that affect the execution of \fBcrontab\fR: \fBLANG\fR, \fBLC_ALL\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. @@ -578,7 +602,6 @@ default editor is \fB/usr/xpg6/bin/vi\fR. .RE .SH EXIT STATUS -.LP The following exit values are returned: .sp .ne 2 @@ -662,7 +685,6 @@ spool area for \fBcrontab\fR .RE .SH ATTRIBUTES -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .SS "\fB/usr/bin/crontab\fR" @@ -698,12 +720,10 @@ Interface Stability Standard .TE .SH SEE ALSO -.LP \fBatq\fR(1), \fBatrm\fR(1), \fBauths\fR(1), \fBed\fR(1), \fBsh\fR(1), \fBvi\fR(1), \fBcron\fR(1M), \fBsu\fR(1M), \fBauth_attr\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5) .SH NOTES -.LP If you inadvertently enter the \fBcrontab\fR command with no arguments, do not attempt to get out with Control-d. This removes all entries in your \fBcrontab\fR file. Instead, exit with Control-c. diff --git a/usr/src/man/man3m/Makefile b/usr/src/man/man3m/Makefile index e1eae9138d..ccc8660142 100644 --- a/usr/src/man/man3m/Makefile +++ b/usr/src/man/man3m/Makefile @@ -124,20 +124,411 @@ MANFILES = acos.3m \ trunc.3m \ y0.3m -MANLINKS= fesetenv.3m \ +MANLINKS = acosf.3m \ + acoshf.3m \ + acoshl.3m \ + acosl.3m \ + asinf.3m \ + asinhf.3m \ + asinhl.3m \ + asinl.3m \ + atan2f.3m \ + atan2l.3m \ + atanf.3m \ + atanhf.3m \ + atanhl.3m \ + atanl.3m \ + cabsf.3m \ + cabsl.3m \ + cacosf.3m \ + cacoshf.3m \ + cacoshl.3m \ + cacosl.3m \ + cargf.3m \ + cargl.3m \ + casinf.3m \ + casinhf.3m \ + casinhl.3m \ + casinl.3m \ + catanf.3m \ + catanhf.3m \ + catanhl.3m \ + catanl.3m \ + cbrtf.3m \ + cbrtl.3m \ + ccosf.3m \ + ccoshf.3m \ + ccoshl.3m \ + ccosl.3m \ + ceilf.3m \ + ceill.3m \ + cexpf.3m \ + cexpl.3m \ + cimagf.3m \ + cimagl.3m \ + clogf.3m \ + clogl.3m \ + conjf.3m \ + conjl.3m \ + copysignf.3m \ + copysignl.3m \ + cosf.3m \ + coshf.3m \ + coshl.3m \ + cosl.3m \ + cpowf.3m \ + cpowl.3m \ + cprojf.3m \ + cprojl.3m \ + crealf.3m \ + creall.3m \ + csinf.3m \ + csinhf.3m \ + csinhl.3m \ + csinl.3m \ + csqrtf.3m \ + csqrtl.3m \ + ctanf.3m \ + ctanhf.3m \ + ctanhl.3m \ + ctanl.3m \ + erfcf.3m \ + erfcl.3m \ + erff.3m \ + erfl.3m \ + exp2f.3m \ + exp2l.3m \ + expf.3m \ + expl.3m \ + expm1f.3m \ + expm1l.3m \ + fabsf.3m \ + fabsl.3m \ + fdimf.3m \ + fdiml.3m \ + fegetprec.3m \ + fesetenv.3m \ fesetexceptflag.3m \ fesetround.3m \ + fex_get_handling.3m \ + fex_get_log.3m \ + fex_get_log_depth.3m \ + fex_getexcepthandler.3m \ + fex_log_entry.3m \ + fex_set_log_depth.3m \ + fex_setexcepthandler.3m \ + floorf.3m \ + floorl.3m \ + fmaf.3m \ + fmal.3m \ + fmaxf.3m \ + fmaxl.3m \ + fminf.3m \ + fminl.3m \ + fmodf.3m \ + fmodl.3m \ + frexpf.3m \ + frexpl.3m \ + gamma.3m \ + gamma_r.3m \ + gammaf.3m \ + gammaf_r.3m \ + gammal.3m \ + gammal_r.3m \ + hypotf.3m \ + hypotl.3m \ + ilogbf.3m \ + ilogbl.3m \ + j0f.3m \ + j0l.3m \ + j1.3m \ + j1f.3m \ + j1l.3m \ + jn.3m \ + jnf.3m \ + jnl.3m \ + ldexpf.3m \ + ldexpl.3m \ + lgamma_r.3m \ + lgammaf.3m \ + lgammaf_r.3m \ + lgammal.3m \ + lgammal_r.3m \ + llrintf.3m \ + llrintl.3m \ + llroundf.3m \ + llroundl.3m \ + log10f.3m \ + log10l.3m \ + log1pf.3m \ + log1pl.3m \ + log2f.3m \ + log2l.3m \ + logbf.3m \ + logbl.3m \ + logf.3m \ + logl.3m \ + lrintf.3m \ + lrintl.3m \ + lroundf.3m \ + lroundl.3m \ + modff.3m \ + modfl.3m \ nanf.3m \ - nanl.3m + nanl.3m \ + nearbyintf.3m \ + nearbyintl.3m \ + nextafterf.3m \ + nextafterl.3m \ + nexttoward.3m \ + nexttowardf.3m \ + nexttowardl.3m \ + powf.3m \ + powl.3m \ + remainderf.3m \ + remainderl.3m \ + remquof.3m \ + remquol.3m \ + rintf.3m \ + rintl.3m \ + roundf.3m \ + roundl.3m \ + scalbf.3m \ + scalbl.3m \ + scalblnf.3m \ + scalblnl.3m \ + scalbn.3m \ + scalbnf.3m \ + scalbnl.3m \ + significandf.3m \ + significandl.3m \ + sincosf.3m \ + sincosl.3m \ + sinf.3m \ + sinhf.3m \ + sinhl.3m \ + sinl.3m \ + sqrtf.3m \ + sqrtl.3m \ + tanf.3m \ + tanhf.3m \ + tanhl.3m \ + tanl.3m \ + tgammaf.3m \ + tgammal.3m \ + truncf.3m \ + truncl.3m \ + y0f.3m \ + y0l.3m \ + y1.3m \ + y1f.3m \ + y1l.3m \ + yn.3m \ + ynf.3m \ + ynl.3m +acosf.3m := LINKSRC = acos.3m +acoshf.3m := LINKSRC = acosh.3m +acoshl.3m := LINKSRC = acosh.3m +acosl.3m := LINKSRC = acos.3m +asinf.3m := LINKSRC = asin.3m +asinhf.3m := LINKSRC = asinh.3m +asinhl.3m := LINKSRC = asinh.3m +asinl.3m := LINKSRC = asin.3m +atan2f.3m := LINKSRC = atan2.3m +atan2l.3m := LINKSRC = atan2.3m +atanf.3m := LINKSRC = atan.3m +atanhf.3m := LINKSRC = atanh.3m +atanhl.3m := LINKSRC = atanh.3m +atanl.3m := LINKSRC = atan.3m +cabsf.3m := LINKSRC = cabs.3m +cabsl.3m := LINKSRC = cabs.3m +cacosf.3m := LINKSRC = cacos.3m +cacoshf.3m := LINKSRC = cacosh.3m +cacoshl.3m := LINKSRC = cacosh.3m +cacosl.3m := LINKSRC = cacos.3m +cargf.3m := LINKSRC = carg.3m +cargl.3m := LINKSRC = carg.3m +casinf.3m := LINKSRC = casin.3m +casinhf.3m := LINKSRC = casinh.3m +casinhl.3m := LINKSRC = casinh.3m +casinl.3m := LINKSRC = casin.3m +catanf.3m := LINKSRC = catan.3m +catanhf.3m := LINKSRC = catanh.3m +catanhl.3m := LINKSRC = catanh.3m +catanl.3m := LINKSRC = catan.3m +cbrtf.3m := LINKSRC = cbrt.3m +cbrtl.3m := LINKSRC = cbrt.3m +ccosf.3m := LINKSRC = ccos.3m +ccoshf.3m := LINKSRC = ccosh.3m +ccoshl.3m := LINKSRC = ccosh.3m +ccosl.3m := LINKSRC = ccos.3m +ceilf.3m := LINKSRC = ceil.3m +ceill.3m := LINKSRC = ceil.3m +cexpf.3m := LINKSRC = cexp.3m +cexpl.3m := LINKSRC = cexp.3m +cimagf.3m := LINKSRC = cimag.3m +cimagl.3m := LINKSRC = cimag.3m +clogf.3m := LINKSRC = clog.3m +clogl.3m := LINKSRC = clog.3m +conjf.3m := LINKSRC = conj.3m +conjl.3m := LINKSRC = conj.3m +copysignf.3m := LINKSRC = copysign.3m +copysignl.3m := LINKSRC = copysign.3m +cosf.3m := LINKSRC = cos.3m +coshf.3m := LINKSRC = cosh.3m +coshl.3m := LINKSRC = cosh.3m +cosl.3m := LINKSRC = cos.3m +cpowf.3m := LINKSRC = cpow.3m +cpowl.3m := LINKSRC = cpow.3m +cprojf.3m := LINKSRC = cproj.3m +cprojl.3m := LINKSRC = cproj.3m +crealf.3m := LINKSRC = creal.3m +creall.3m := LINKSRC = creal.3m +csinf.3m := LINKSRC = csin.3m +csinhf.3m := LINKSRC = csinh.3m +csinhl.3m := LINKSRC = csinh.3m +csinl.3m := LINKSRC = csin.3m +csqrtf.3m := LINKSRC = csqrt.3m +csqrtl.3m := LINKSRC = csqrt.3m +ctanf.3m := LINKSRC = ctan.3m +ctanhf.3m := LINKSRC = ctanh.3m +ctanhl.3m := LINKSRC = ctanh.3m +ctanl.3m := LINKSRC = ctan.3m +erfcf.3m := LINKSRC = erfc.3m +erfcl.3m := LINKSRC = erfc.3m +erff.3m := LINKSRC = erf.3m +erfl.3m := LINKSRC = erf.3m +exp2f.3m := LINKSRC = exp2.3m +exp2l.3m := LINKSRC = exp2.3m +expf.3m := LINKSRC = exp.3m +expl.3m := LINKSRC = exp.3m +expm1f.3m := LINKSRC = expm1.3m +expm1l.3m := LINKSRC = expm1.3m +fabsf.3m := LINKSRC = fabs.3m +fabsl.3m := LINKSRC = fabs.3m +fdimf.3m := LINKSRC = fdim.3m +fdiml.3m := LINKSRC = fdim.3m +fegetprec.3m := LINKSRC = fesetprec.3m fesetenv.3m := LINKSRC = fegetenv.3m - fesetexceptflag.3m := LINKSRC = fegetexceptflag.3m - fesetround.3m := LINKSRC = fegetround.3m - +fex_get_handling.3m := LINKSRC = fex_set_handling.3m +fex_get_log.3m := LINKSRC = fex_set_log.3m +fex_get_log_depth.3m := LINKSRC = fex_set_log.3m +fex_getexcepthandler.3m := LINKSRC = fex_set_handling.3m +fex_log_entry.3m := LINKSRC = fex_set_log.3m +fex_set_log_depth.3m := LINKSRC = fex_set_log.3m +fex_setexcepthandler.3m := LINKSRC = fex_set_handling.3m +floorf.3m := LINKSRC = floor.3m +floorl.3m := LINKSRC = floor.3m +fmaf.3m := LINKSRC = fma.3m +fmal.3m := LINKSRC = fma.3m +fmaxf.3m := LINKSRC = fmax.3m +fmaxl.3m := LINKSRC = fmax.3m +fminf.3m := LINKSRC = fmin.3m +fminl.3m := LINKSRC = fmin.3m +fmodf.3m := LINKSRC = fmod.3m +fmodl.3m := LINKSRC = fmod.3m +frexpf.3m := LINKSRC = frexp.3m +frexpl.3m := LINKSRC = frexp.3m +gamma.3m := LINKSRC = lgamma.3m +gamma_r.3m := LINKSRC = lgamma.3m +gammaf.3m := LINKSRC = lgamma.3m +gammaf_r.3m := LINKSRC = lgamma.3m +gammal.3m := LINKSRC = lgamma.3m +gammal_r.3m := LINKSRC = lgamma.3m +hypotf.3m := LINKSRC = hypot.3m +hypotl.3m := LINKSRC = hypot.3m +ilogbf.3m := LINKSRC = ilogb.3m +ilogbl.3m := LINKSRC = ilogb.3m +j0f.3m := LINKSRC = j0.3m +j0l.3m := LINKSRC = j0.3m +j1.3m := LINKSRC = j0.3m +j1f.3m := LINKSRC = j0.3m +j1l.3m := LINKSRC = j0.3m +jn.3m := LINKSRC = j0.3m +jnf.3m := LINKSRC = j0.3m +jnl.3m := LINKSRC = j0.3m +ldexpf.3m := LINKSRC = ldexp.3m +ldexpl.3m := LINKSRC = ldexp.3m +lgamma_r.3m := LINKSRC = lgamma.3m +lgammaf.3m := LINKSRC = lgamma.3m +lgammaf_r.3m := LINKSRC = lgamma.3m +lgammal.3m := LINKSRC = lgamma.3m +lgammal_r.3m := LINKSRC = lgamma.3m +llrintf.3m := LINKSRC = llrint.3m +llrintl.3m := LINKSRC = llrint.3m +llroundf.3m := LINKSRC = llround.3m +llroundl.3m := LINKSRC = llround.3m +log10f.3m := LINKSRC = log10.3m +log10l.3m := LINKSRC = log10.3m +log1pf.3m := LINKSRC = log1p.3m +log1pl.3m := LINKSRC = log1p.3m +log2f.3m := LINKSRC = log2.3m +log2l.3m := LINKSRC = log2.3m +logbf.3m := LINKSRC = logb.3m +logbl.3m := LINKSRC = logb.3m +logf.3m := LINKSRC = log.3m +logl.3m := LINKSRC = log.3m +lrintf.3m := LINKSRC = lrint.3m +lrintl.3m := LINKSRC = lrint.3m +lroundf.3m := LINKSRC = lround.3m +lroundl.3m := LINKSRC = lround.3m +modff.3m := LINKSRC = modf.3m +modfl.3m := LINKSRC = modf.3m nanf.3m := LINKSRC = nan.3m nanl.3m := LINKSRC = nan.3m +nearbyintf.3m := LINKSRC = nearbyint.3m +nearbyintl.3m := LINKSRC = nearbyint.3m +nextafterf.3m := LINKSRC = nextafter.3m +nextafterl.3m := LINKSRC = nextafter.3m +nexttoward.3m := LINKSRC = nextafter.3m +nexttowardf.3m := LINKSRC = nextafter.3m +nexttowardl.3m := LINKSRC = nextafter.3m +powf.3m := LINKSRC = pow.3m +powl.3m := LINKSRC = pow.3m +remainderf.3m := LINKSRC = remainder.3m +remainderl.3m := LINKSRC = remainder.3m +remquof.3m := LINKSRC = remquo.3m +remquol.3m := LINKSRC = remquo.3m +rintf.3m := LINKSRC = rint.3m +rintl.3m := LINKSRC = rint.3m +roundf.3m := LINKSRC = round.3m +roundl.3m := LINKSRC = round.3m +scalbf.3m := LINKSRC = scalb.3m +scalbl.3m := LINKSRC = scalb.3m +scalblnf.3m := LINKSRC = scalbln.3m +scalblnl.3m := LINKSRC = scalbln.3m +scalbn.3m := LINKSRC = scalbln.3m +scalbnf.3m := LINKSRC = scalbln.3m +scalbnl.3m := LINKSRC = scalbln.3m +significandf.3m := LINKSRC = significand.3m +significandl.3m := LINKSRC = significand.3m +sincosf.3m := LINKSRC = sincos.3m +sincosl.3m := LINKSRC = sincos.3m +sinf.3m := LINKSRC = sin.3m +sinhf.3m := LINKSRC = sinh.3m +sinhl.3m := LINKSRC = sinh.3m +sinl.3m := LINKSRC = sin.3m +sqrtf.3m := LINKSRC = sqrt.3m +sqrtl.3m := LINKSRC = sqrt.3m +tanf.3m := LINKSRC = tan.3m +tanhf.3m := LINKSRC = tanh.3m +tanhl.3m := LINKSRC = tanh.3m +tanl.3m := LINKSRC = tan.3m +tgammaf.3m := LINKSRC = tgamma.3m +tgammal.3m := LINKSRC = tgamma.3m +truncf.3m := LINKSRC = trunc.3m +truncl.3m := LINKSRC = trunc.3m +y0f.3m := LINKSRC = y0.3m +y0l.3m := LINKSRC = y0.3m +y1.3m := LINKSRC = y0.3m +y1f.3m := LINKSRC = y0.3m +y1l.3m := LINKSRC = y0.3m +yn.3m := LINKSRC = y0.3m +ynf.3m := LINKSRC = y0.3m +ynl.3m := LINKSRC = y0.3m .KEEP_STATE: diff --git a/usr/src/pkg/manifests/system-library-math.man3m.inc b/usr/src/pkg/manifests/system-library-math.man3m.inc index 243966e4f6..ef4cc3b9c1 100644 --- a/usr/src/pkg/manifests/system-library-math.man3m.inc +++ b/usr/src/pkg/manifests/system-library-math.man3m.inc @@ -119,8 +119,205 @@ file path=usr/share/man/man3m/tanh.3m file path=usr/share/man/man3m/tgamma.3m file path=usr/share/man/man3m/trunc.3m file path=usr/share/man/man3m/y0.3m +link path=usr/share/man/man3m/acosf.3m target=acos.3m +link path=usr/share/man/man3m/acoshf.3m target=acosh.3m +link path=usr/share/man/man3m/acoshl.3m target=acosh.3m +link path=usr/share/man/man3m/acosl.3m target=acos.3m +link path=usr/share/man/man3m/asinf.3m target=asin.3m +link path=usr/share/man/man3m/asinhf.3m target=asinh.3m +link path=usr/share/man/man3m/asinhl.3m target=asinh.3m +link path=usr/share/man/man3m/asinl.3m target=asin.3m +link path=usr/share/man/man3m/atan2f.3m target=atan2.3m +link path=usr/share/man/man3m/atan2l.3m target=atan2.3m +link path=usr/share/man/man3m/atanf.3m target=atan.3m +link path=usr/share/man/man3m/atanhf.3m target=atanh.3m +link path=usr/share/man/man3m/atanhl.3m target=atanh.3m +link path=usr/share/man/man3m/atanl.3m target=atan.3m +link path=usr/share/man/man3m/cabsf.3m target=cabs.3m +link path=usr/share/man/man3m/cabsl.3m target=cabs.3m +link path=usr/share/man/man3m/cacosf.3m target=cacos.3m +link path=usr/share/man/man3m/cacoshf.3m target=cacosh.3m +link path=usr/share/man/man3m/cacoshl.3m target=cacosh.3m +link path=usr/share/man/man3m/cacosl.3m target=cacos.3m +link path=usr/share/man/man3m/cargf.3m target=carg.3m +link path=usr/share/man/man3m/cargl.3m target=carg.3m +link path=usr/share/man/man3m/casinf.3m target=casin.3m +link path=usr/share/man/man3m/casinhf.3m target=casinh.3m +link path=usr/share/man/man3m/casinhl.3m target=casinh.3m +link path=usr/share/man/man3m/casinl.3m target=casin.3m +link path=usr/share/man/man3m/catanf.3m target=catan.3m +link path=usr/share/man/man3m/catanhf.3m target=catanh.3m +link path=usr/share/man/man3m/catanhl.3m target=catanh.3m +link path=usr/share/man/man3m/catanl.3m target=catan.3m +link path=usr/share/man/man3m/cbrtf.3m target=cbrt.3m +link path=usr/share/man/man3m/cbrtl.3m target=cbrt.3m +link path=usr/share/man/man3m/ccosf.3m target=ccos.3m +link path=usr/share/man/man3m/ccoshf.3m target=ccosh.3m +link path=usr/share/man/man3m/ccoshl.3m target=ccosh.3m +link path=usr/share/man/man3m/ccosl.3m target=ccos.3m +link path=usr/share/man/man3m/ceilf.3m target=ceil.3m +link path=usr/share/man/man3m/ceill.3m target=ceil.3m +link path=usr/share/man/man3m/cexpf.3m target=cexp.3m +link path=usr/share/man/man3m/cexpl.3m target=cexp.3m +link path=usr/share/man/man3m/cimagf.3m target=cimag.3m +link path=usr/share/man/man3m/cimagl.3m target=cimag.3m +link path=usr/share/man/man3m/clogf.3m target=clog.3m +link path=usr/share/man/man3m/clogl.3m target=clog.3m +link path=usr/share/man/man3m/conjf.3m target=conj.3m +link path=usr/share/man/man3m/conjl.3m target=conj.3m +link path=usr/share/man/man3m/copysignf.3m target=copysign.3m +link path=usr/share/man/man3m/copysignl.3m target=copysign.3m +link path=usr/share/man/man3m/cosf.3m target=cos.3m +link path=usr/share/man/man3m/coshf.3m target=cosh.3m +link path=usr/share/man/man3m/coshl.3m target=cosh.3m +link path=usr/share/man/man3m/cosl.3m target=cos.3m +link path=usr/share/man/man3m/cpowf.3m target=cpow.3m +link path=usr/share/man/man3m/cpowl.3m target=cpow.3m +link path=usr/share/man/man3m/cprojf.3m target=cproj.3m +link path=usr/share/man/man3m/cprojl.3m target=cproj.3m +link path=usr/share/man/man3m/crealf.3m target=creal.3m +link path=usr/share/man/man3m/creall.3m target=creal.3m +link path=usr/share/man/man3m/csinf.3m target=csin.3m +link path=usr/share/man/man3m/csinhf.3m target=csinh.3m +link path=usr/share/man/man3m/csinhl.3m target=csinh.3m +link path=usr/share/man/man3m/csinl.3m target=csin.3m +link path=usr/share/man/man3m/csqrtf.3m target=csqrt.3m +link path=usr/share/man/man3m/csqrtl.3m target=csqrt.3m +link path=usr/share/man/man3m/ctanf.3m target=ctan.3m +link path=usr/share/man/man3m/ctanhf.3m target=ctanh.3m +link path=usr/share/man/man3m/ctanhl.3m target=ctanh.3m +link path=usr/share/man/man3m/ctanl.3m target=ctan.3m +link path=usr/share/man/man3m/erfcf.3m target=erfc.3m +link path=usr/share/man/man3m/erfcl.3m target=erfc.3m +link path=usr/share/man/man3m/erff.3m target=erf.3m +link path=usr/share/man/man3m/erfl.3m target=erf.3m +link path=usr/share/man/man3m/exp2f.3m target=exp2.3m +link path=usr/share/man/man3m/exp2l.3m target=exp2.3m +link path=usr/share/man/man3m/expf.3m target=exp.3m +link path=usr/share/man/man3m/expl.3m target=exp.3m +link path=usr/share/man/man3m/expm1f.3m target=expm1.3m +link path=usr/share/man/man3m/expm1l.3m target=expm1.3m +link path=usr/share/man/man3m/fabsf.3m target=fabs.3m +link path=usr/share/man/man3m/fabsl.3m target=fabs.3m +link path=usr/share/man/man3m/fdimf.3m target=fdim.3m +link path=usr/share/man/man3m/fdiml.3m target=fdim.3m +link path=usr/share/man/man3m/fegetprec.3m target=fesetprec.3m link path=usr/share/man/man3m/fesetenv.3m target=fegetenv.3m link path=usr/share/man/man3m/fesetexceptflag.3m target=fegetexceptflag.3m link path=usr/share/man/man3m/fesetround.3m target=fegetround.3m +link path=usr/share/man/man3m/fex_get_handling.3m target=fex_set_handling.3m +link path=usr/share/man/man3m/fex_get_log.3m target=fex_set_log.3m +link path=usr/share/man/man3m/fex_get_log_depth.3m target=fex_set_log.3m +link path=usr/share/man/man3m/fex_getexcepthandler.3m target=fex_set_handling.3m +link path=usr/share/man/man3m/fex_log_entry.3m target=fex_set_log.3m +link path=usr/share/man/man3m/fex_set_log_depth.3m target=fex_set_log.3m +link path=usr/share/man/man3m/fex_setexcepthandler.3m target=fex_set_handling.3m +link path=usr/share/man/man3m/floorf.3m target=floor.3m +link path=usr/share/man/man3m/floorl.3m target=floor.3m +link path=usr/share/man/man3m/fmaf.3m target=fma.3m +link path=usr/share/man/man3m/fmal.3m target=fma.3m +link path=usr/share/man/man3m/fmaxf.3m target=fmax.3m +link path=usr/share/man/man3m/fmaxl.3m target=fmax.3m +link path=usr/share/man/man3m/fminf.3m target=fmin.3m +link path=usr/share/man/man3m/fminl.3m target=fmin.3m +link path=usr/share/man/man3m/fmodf.3m target=fmod.3m +link path=usr/share/man/man3m/fmodl.3m target=fmod.3m +link path=usr/share/man/man3m/frexpf.3m target=frexp.3m +link path=usr/share/man/man3m/frexpl.3m target=frexp.3m +link path=usr/share/man/man3m/gamma.3m target=lgamma.3m +link path=usr/share/man/man3m/gamma_r.3m target=lgamma.3m +link path=usr/share/man/man3m/gammaf.3m target=lgamma.3m +link path=usr/share/man/man3m/gammaf_r.3m target=lgamma.3m +link path=usr/share/man/man3m/gammal.3m target=lgamma.3m +link path=usr/share/man/man3m/gammal_r.3m target=lgamma.3m +link path=usr/share/man/man3m/hypotf.3m target=hypot.3m +link path=usr/share/man/man3m/hypotl.3m target=hypot.3m +link path=usr/share/man/man3m/ilogbf.3m target=ilogb.3m +link path=usr/share/man/man3m/ilogbl.3m target=ilogb.3m +link path=usr/share/man/man3m/j0f.3m target=j0.3m +link path=usr/share/man/man3m/j0l.3m target=j0.3m +link path=usr/share/man/man3m/j1.3m target=j0.3m +link path=usr/share/man/man3m/j1f.3m target=j0.3m +link path=usr/share/man/man3m/j1l.3m target=j0.3m +link path=usr/share/man/man3m/jn.3m target=j0.3m +link path=usr/share/man/man3m/jnf.3m target=j0.3m +link path=usr/share/man/man3m/jnl.3m target=j0.3m +link path=usr/share/man/man3m/ldexpf.3m target=ldexp.3m +link path=usr/share/man/man3m/ldexpl.3m target=ldexp.3m +link path=usr/share/man/man3m/lgamma_r.3m target=lgamma.3m +link path=usr/share/man/man3m/lgammaf.3m target=lgamma.3m +link path=usr/share/man/man3m/lgammaf_r.3m target=lgamma.3m +link path=usr/share/man/man3m/lgammal.3m target=lgamma.3m +link path=usr/share/man/man3m/lgammal_r.3m target=lgamma.3m +link path=usr/share/man/man3m/llrintf.3m target=llrint.3m +link path=usr/share/man/man3m/llrintl.3m target=llrint.3m +link path=usr/share/man/man3m/llroundf.3m target=llround.3m +link path=usr/share/man/man3m/llroundl.3m target=llround.3m +link path=usr/share/man/man3m/log10f.3m target=log10.3m +link path=usr/share/man/man3m/log10l.3m target=log10.3m +link path=usr/share/man/man3m/log1pf.3m target=log1p.3m +link path=usr/share/man/man3m/log1pl.3m target=log1p.3m +link path=usr/share/man/man3m/log2f.3m target=log2.3m +link path=usr/share/man/man3m/log2l.3m target=log2.3m +link path=usr/share/man/man3m/logbf.3m target=logb.3m +link path=usr/share/man/man3m/logbl.3m target=logb.3m +link path=usr/share/man/man3m/logf.3m target=log.3m +link path=usr/share/man/man3m/logl.3m target=log.3m +link path=usr/share/man/man3m/lrintf.3m target=lrint.3m +link path=usr/share/man/man3m/lrintl.3m target=lrint.3m +link path=usr/share/man/man3m/lroundf.3m target=lround.3m +link path=usr/share/man/man3m/lroundl.3m target=lround.3m +link path=usr/share/man/man3m/modff.3m target=modf.3m +link path=usr/share/man/man3m/modfl.3m target=modf.3m link path=usr/share/man/man3m/nanf.3m target=nan.3m link path=usr/share/man/man3m/nanl.3m target=nan.3m +link path=usr/share/man/man3m/nearbyintf.3m target=nearbyint.3m +link path=usr/share/man/man3m/nearbyintl.3m target=nearbyint.3m +link path=usr/share/man/man3m/nextafterf.3m target=nextafter.3m +link path=usr/share/man/man3m/nextafterl.3m target=nextafter.3m +link path=usr/share/man/man3m/nexttoward.3m target=nextafter.3m +link path=usr/share/man/man3m/nexttowardf.3m target=nextafter.3m +link path=usr/share/man/man3m/nexttowardl.3m target=nextafter.3m +link path=usr/share/man/man3m/powf.3m target=pow.3m +link path=usr/share/man/man3m/powl.3m target=pow.3m +link path=usr/share/man/man3m/remainderf.3m target=remainder.3m +link path=usr/share/man/man3m/remainderl.3m target=remainder.3m +link path=usr/share/man/man3m/remquof.3m target=remquo.3m +link path=usr/share/man/man3m/remquol.3m target=remquo.3m +link path=usr/share/man/man3m/rintf.3m target=rint.3m +link path=usr/share/man/man3m/rintl.3m target=rint.3m +link path=usr/share/man/man3m/roundf.3m target=round.3m +link path=usr/share/man/man3m/roundl.3m target=round.3m +link path=usr/share/man/man3m/scalbf.3m target=scalb.3m +link path=usr/share/man/man3m/scalbl.3m target=scalb.3m +link path=usr/share/man/man3m/scalblnf.3m target=scalbln.3m +link path=usr/share/man/man3m/scalblnl.3m target=scalbln.3m +link path=usr/share/man/man3m/scalbn.3m target=scalbln.3m +link path=usr/share/man/man3m/scalbnf.3m target=scalbln.3m +link path=usr/share/man/man3m/scalbnl.3m target=scalbln.3m +link path=usr/share/man/man3m/significandf.3m target=significand.3m +link path=usr/share/man/man3m/significandl.3m target=significand.3m +link path=usr/share/man/man3m/sincosf.3m target=sincos.3m +link path=usr/share/man/man3m/sincosl.3m target=sincos.3m +link path=usr/share/man/man3m/sinf.3m target=sin.3m +link path=usr/share/man/man3m/sinhf.3m target=sinh.3m +link path=usr/share/man/man3m/sinhl.3m target=sinh.3m +link path=usr/share/man/man3m/sinl.3m target=sin.3m +link path=usr/share/man/man3m/sqrtf.3m target=sqrt.3m +link path=usr/share/man/man3m/sqrtl.3m target=sqrt.3m +link path=usr/share/man/man3m/tanf.3m target=tan.3m +link path=usr/share/man/man3m/tanhf.3m target=tanh.3m +link path=usr/share/man/man3m/tanhl.3m target=tanh.3m +link path=usr/share/man/man3m/tanl.3m target=tan.3m +link path=usr/share/man/man3m/tgammaf.3m target=tgamma.3m +link path=usr/share/man/man3m/tgammal.3m target=tgamma.3m +link path=usr/share/man/man3m/truncf.3m target=trunc.3m +link path=usr/share/man/man3m/truncl.3m target=trunc.3m +link path=usr/share/man/man3m/y0f.3m target=y0.3m +link path=usr/share/man/man3m/y0l.3m target=y0.3m +link path=usr/share/man/man3m/y1.3m target=y0.3m +link path=usr/share/man/man3m/y1f.3m target=y0.3m +link path=usr/share/man/man3m/y1l.3m target=y0.3m +link path=usr/share/man/man3m/yn.3m target=y0.3m +link path=usr/share/man/man3m/ynf.3m target=y0.3m +link path=usr/share/man/man3m/ynl.3m target=y0.3m diff --git a/usr/src/test/os-tests/runfiles/default.run b/usr/src/test/os-tests/runfiles/default.run index 4709dcef35..9489c2faf6 100644 --- a/usr/src/test/os-tests/runfiles/default.run +++ b/usr/src/test/os-tests/runfiles/default.run @@ -70,7 +70,7 @@ tests = ['conn', 'dgram', 'drop_priv', 'nosignal', 'sockpair'] [/opt/os-tests/tests/pf_key] user = root timeout = 180 -tests = ['acquire-compare', 'acquire-spray'] +tests = ['acquire-compare', 'kmc-update'] [/opt/os-tests/tests/OS-6097.32] [/opt/os-tests/tests/OS-6097.64] diff --git a/usr/src/test/os-tests/tests/pf_key/acquire-spray.sh b/usr/src/test/os-tests/tests/pf_key/acquire-spray.sh index d15c8617a6..cae879b4ec 100644 --- a/usr/src/test/os-tests/tests/pf_key/acquire-spray.sh +++ b/usr/src/test/os-tests/tests/pf_key/acquire-spray.sh @@ -12,7 +12,15 @@ # # -# Copyright (c) 2017 Joyent, Inc. +# Copyright 2019 Joyent, Inc. +# + +# +# This test sprays many concurrent ACQUIRE messages and checks the +# monitor. +# +# Note that it's not run by default, as the monitor is best-efforts and +# therefore not reliable under this kind of load. # if [ `id -u` -ne 0 ]; then @@ -25,12 +33,8 @@ if [[ `zonename` != "global" ]]; then exit 254 fi -# This test sprays many concurrent ACQUIRE messages. The idea originally -# was to view lock contention on the global netstack's IPsec algorithm lock. -# It is also useful for having multiple ACQUIRE records. - PREFIX=10.21.12.0/24 -MONITOR_LOG=/var/run/ipseckey-monitor.$$ +MONITOR_LOG=/var/tmp/ipseckey-monitor.$$ # The program that sends an extended REGISTER to enable extended ACQUIREs. EACQ_PROG=/opt/os-tests/tests/pf_key/eacq-enabler @@ -38,16 +42,6 @@ EACQ_PROG=/opt/os-tests/tests/pf_key/eacq-enabler $EACQ_PROG & eapid=$! -# Find the ipsec_alg_lock to monitor with lockstat (below). -GLOBAL_NETSTACK=`echo ::netstack | mdb -k | grep -w 0 | awk '{print $1}'` -GLOBAL_IPSEC=`echo $GLOBAL_NETSTACK::print netstack_t | mdb -k | grep -w nu_ipsec | awk '{print $3}'` -IPSEC_ALG_LOCK=`echo $GLOBAL_IPSEC::print -a ipsec_stack_t ipsec_alg_lock | mdb -k | head -1 | awk '{print $1}'` - -#echo "WARNING -- this test flushes out IPsec policy..." -#echo "GLOBAL_NETSTACK = $GLOBAL_NETSTACK" -#echo "GLOBAL_IPSEC = $GLOBAL_IPSEC" -#echo "IPSEC_ALG_LOCK = $IPSEC_ALG_LOCK" - # Tunnels will be preserved by using -f instead of -F. ipsecconf -qf @@ -56,6 +50,8 @@ echo "{ raddr $PREFIX } ipsec { encr_algs aes encr_auth_algs sha512 }" | \ ipsecconf -qa - # ipsecconf -ln +echo "Starting monitor, logging to $MONITOR_LOG" + # Get monitoring PF_KEY for at least regular ACQUIREs. ipseckey -n monitor > $MONITOR_LOG & IPSECKEY_PID=$! @@ -64,6 +60,11 @@ IPSECKEY_PID=$! # records internally. ipseckey flush +# wait for the monitor +sleep 5 + +echo "Starting pings" + # Launch 254 pings to different addresses (each requiring an ACQUIRE). i=1 while [ $i -le 254 ]; do @@ -74,9 +75,18 @@ done # Unleash the pings in 10 seconds, Smithers. ( sleep 10 ; prun `pgrep ping` ) & -# Get the lockstats going now. -echo "Running: lockstat -A -l 0x$IPSEC_ALG_LOCK,8 sleep 30" -lockstat -A -l 0x$IPSEC_ALG_LOCK,8 sleep 30 +echo "Waiting for pings to finish" + +# wait for the pings; not so charming +while :; do + pids="$(pgrep ping)" + [[ -n "$pids" ]] || break + pwait $pids +done + +# wait for the monitor +sleep 10 + kill $IPSECKEY_PID kill $eapid # Use SMF to restore anything that may have been there. "restart" on @@ -86,14 +96,15 @@ svcadm restart ipsec/policy # See if we have decent results. -numacq=`grep ACQUIRE $MONITOR_LOG | wc -l | awk '{print $1}` -#rm -f $MONITOR_LOG -# Pardon the hardcoding again. -if [[ $numacq != 508 ]]; then - echo "Got $numacq ACQUIREs instead of 508" - exit 1 -else - echo "Saw expected $numacq ACQUIREs." -fi +i=1 +while [ $i -le 254 ]; do + c=$(grep -c "^DST: AF_INET: port 0, 10\.21\.12\.$i\." $MONITOR_LOG) + if [[ "$c" -ne 2 ]]; then + echo "One or more log entries missing for 10.21.12.$i" >&2 + exit 1 + fi + i=$(($i + 1)) +done +rm -f $MONITOR_LOG exit 0 diff --git a/usr/src/test/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh b/usr/src/test/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh index a216f1c5ff..d4d7dc9e63 100755 --- a/usr/src/test/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh +++ b/usr/src/test/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh @@ -58,7 +58,8 @@ log_assert "'zfs recv' must properly handle encryption properties" typeset keyfile=/$TESTPOOL/pkey typeset sendfile=/$TESTPOOL/sendfile -typeset snap=$TESTPOOL/ds@snap +typeset snap=$TESTPOOL/ds@snap1 +typeset snap2=$TESTPOOL/ds@snap2 typeset esnap=$TESTPOOL/crypt@snap1 typeset esnap2=$TESTPOOL/crypt@snap2 @@ -78,6 +79,7 @@ log_must cp /$TESTPOOL/ds/$TESTFILE0 /$TESTPOOL/crypt/$TESTFILE0 typeset cksum=$(md5sum /$TESTPOOL/ds/$TESTFILE0 | awk '{ print $1 }') log_must zfs snap -r $snap +log_must zfs snap -r $snap2 log_must zfs snap -r $esnap log_must zfs snap -r $esnap2 @@ -179,11 +181,25 @@ recv_cksum=$(md5sum /$ds/$TESTFILE0 | awk '{ print $1 }') log_must test "$recv_cksum" == "$cksum" log_must zfs destroy -r $ds +# Test that we can override an unencrypted, incremental, properties stream's +# encryption settings, receiving it as an unencrypted child. +log_note "Must be able to receive incremental stream with props to encrypted" +ds=$TESTPOOL/crypt/recv +log_must eval "zfs send -p $snap > $sendfile" +log_must eval "zfs recv -x encryption $ds < $sendfile" +log_must test "$(get_prop 'encryptionroot' $ds)" == "$TESTPOOL/crypt" +log_must test "$(get_prop 'encryption' $ds)" == "aes-256-ccm" +log_must test "$(get_prop 'keyformat' $ds)" == "passphrase" +log_must test "$(get_prop 'mounted' $ds)" == "yes" +recv_cksum=$(md5digest /$ds/$TESTFILE0) +log_must test "$recv_cksum" == "$cksum" +log_must zfs destroy -r $ds + # Test that we can override an unencrypted recursive stream's encryption # settings, receiving all datasets as encrypted children. log_note "Must be able to receive recursive stream to encrypted child" ds=$TESTPOOL/crypt/recv -log_must eval "zfs send -R $snap > $sendfile" +log_must eval "zfs send -R $snap2 > $sendfile" log_must eval "zfs recv -x encryption $ds < $sendfile" log_must test "$(get_prop 'encryptionroot' $ds)" == "$TESTPOOL/crypt" log_must test "$(get_prop 'encryption' $ds)" == "aes-256-ccm" diff --git a/usr/src/tools/smatch/Makefile b/usr/src/tools/smatch/Makefile index 37cc2fdf51..5c7bdba170 100644 --- a/usr/src/tools/smatch/Makefile +++ b/usr/src/tools/smatch/Makefile @@ -8,19 +8,19 @@ # 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. # # # The src/ sub-directory is un-modified copy of -# https://github.com/illumos/smatch/tree/0.5.1-il-5 +# https://github.com/illumos/smatch/tree/0.5.1-il-6 # # This Makefile installs just enough for us to be able to run smatch # locally. # PROG = smatch -SPARSE_VERSION = 0.5.1-il-5 +SPARSE_VERSION = 0.5.1-il-6 include ../Makefile.tools diff --git a/usr/src/tools/smatch/src/Makefile b/usr/src/tools/smatch/src/Makefile index 388f5900a1..43e67cd759 100644 --- a/usr/src/tools/smatch/src/Makefile +++ b/usr/src/tools/smatch/src/Makefile @@ -1,4 +1,4 @@ -VERSION=0.5.1-il-5 +VERSION=0.5.1-il-6 # Generating file version.h if current version has changed SPARSE_VERSION:=$(shell git describe 2>/dev/null || echo '$(VERSION)') diff --git a/usr/src/tools/smatch/src/smatch_mem_tracker.c b/usr/src/tools/smatch/src/smatch_mem_tracker.c index c10ee90587..4f659a722e 100644 --- a/usr/src/tools/smatch/src/smatch_mem_tracker.c +++ b/usr/src/tools/smatch/src/smatch_mem_tracker.c @@ -16,27 +16,32 @@ */ #include "smatch.h" +#include <fcntl.h> #include <unistd.h> +#include <sys/procfs.h> static int my_id; +static int my_fd = -2; static unsigned long max_size; unsigned long get_mem_kb(void) { - FILE *file; - char buf[1024]; - unsigned long size; + prpsinfo_t pbuf; - file = fopen("/proc/self/statm", "r"); - if (!file) - return 0; - fread(buf, 1, sizeof(buf), file); - fclose(file); + if (my_fd == -2) { + /* Do not repeatedly attempt this if it fails. */ + my_fd = open("/proc/self/psinfo", O_RDONLY); + } + if (my_fd == -1) { + return (0); + } + + if (pread(my_fd, &pbuf, sizeof (pbuf), 0) != sizeof (pbuf)) { + return (0); + } - size = strtoul(buf, NULL, 10); - size = size * sysconf(_SC_PAGESIZE) / 1024; - return size; + return (pbuf.pr_rssize); } static void match_end_func(struct symbol *sym) diff --git a/usr/src/uts/common/c2/audit_event.c b/usr/src/uts/common/c2/audit_event.c index 1cb523121f..4d97735fac 100644 --- a/usr/src/uts/common/c2/audit_event.c +++ b/usr/src/uts/common/c2/audit_event.c @@ -3039,8 +3039,21 @@ aui_auditsys(au_event_t e) case A_SETCLASS: e = AUE_AUDITON_SETCLASS; break; + case A_GETPINFO: + case A_GETPINFO_ADDR: + e = AUE_AUDITON_GETPINFO; + break; + case A_SETPMASK: + e = AUE_AUDITON_SETPMASK; + break; + case A_GETKAUDIT: + e = AUE_AUDITON_GETKAUDIT; + break; + case A_SETKAUDIT: + e = AUE_AUDITON_SETKAUDIT; + break; default: - e = AUE_NULL; + e = AUE_AUDITON_OTHER; break; } break; @@ -3061,6 +3074,7 @@ aus_auditsys(struct t_audit_data *tad) uintptr_t a1, a2; STRUCT_DECL(auditinfo, ainfo); STRUCT_DECL(auditinfo_addr, ainfo_addr); + STRUCT_DECL(auditpinfo, apinfo); au_evclass_map_t event; au_mask_t mask; int auditstate, policy; @@ -3238,6 +3252,53 @@ aus_auditsys(struct t_audit_data *tad) au_uwrite(au_to_arg32( 3, "setclass:ec_class", (uint32_t)event.ec_class)); break; + case AUE_AUDITON_SETPMASK: + STRUCT_INIT(apinfo, get_udatamodel()); + if (copyin((caddr_t)uap->a2, STRUCT_BUF(apinfo), + STRUCT_SIZE(apinfo))) { + return; + } + au_uwrite(au_to_arg32(3, "setpmask:pid", + (uint32_t)STRUCT_FGET(apinfo, ap_pid))); + au_uwrite(au_to_arg32(3, "setpmask:as_success", + (uint32_t)STRUCT_FGET(apinfo, ap_mask.as_success))); + au_uwrite(au_to_arg32(3, "setpmask:as_failure", + (uint32_t)STRUCT_FGET(apinfo, ap_mask.as_failure))); + break; + case AUE_AUDITON_SETKAUDIT: + STRUCT_INIT(ainfo_addr, get_udatamodel()); + if (copyin((caddr_t)a1, STRUCT_BUF(ainfo_addr), + STRUCT_SIZE(ainfo_addr))) { + return; + } + au_uwrite(au_to_arg32((char)1, "auid", + (uint32_t)STRUCT_FGET(ainfo_addr, ai_auid))); +#ifdef _LP64 + au_uwrite(au_to_arg64((char)1, "port", + (uint64_t)STRUCT_FGET(ainfo_addr, ai_termid.at_port))); +#else + au_uwrite(au_to_arg32((char)1, "port", + (uint32_t)STRUCT_FGET(ainfo_addr, ai_termid.at_port))); +#endif + au_uwrite(au_to_arg32((char)1, "type", + (uint32_t)STRUCT_FGET(ainfo_addr, ai_termid.at_type))); + if ((uint32_t)STRUCT_FGET(ainfo_addr, ai_termid.at_type) == + AU_IPv4) { + au_uwrite(au_to_in_addr( + (struct in_addr *)STRUCT_FGETP(ainfo_addr, + ai_termid.at_addr))); + } else { + au_uwrite(au_to_in_addr_ex( + (int32_t *)STRUCT_FGETP(ainfo_addr, + ai_termid.at_addr))); + } + au_uwrite(au_to_arg32((char)1, "as_success", + (uint32_t)STRUCT_FGET(ainfo_addr, ai_mask.as_success))); + au_uwrite(au_to_arg32((char)1, "as_failure", + (uint32_t)STRUCT_FGET(ainfo_addr, ai_mask.as_failure))); + au_uwrite(au_to_arg32((char)1, "asid", + (uint32_t)STRUCT_FGET(ainfo_addr, ai_asid))); + break; case AUE_GETAUID: case AUE_GETAUDIT: case AUE_GETAUDIT_ADDR: @@ -3252,6 +3313,9 @@ aus_auditsys(struct t_audit_data *tad) case AUE_AUDITON_SETSTAT: case AUE_AUDITON_GETCOND: case AUE_AUDITON_GETCLASS: + case AUE_AUDITON_GETPINFO: + case AUE_AUDITON_GETKAUDIT: + case AUE_AUDITON_OTHER: break; default: break; diff --git a/usr/src/uts/common/c2/audit_kevents.h b/usr/src/uts/common/c2/audit_kevents.h index ae6ee7351d..9cd650c858 100644 --- a/usr/src/uts/common/c2/audit_kevents.h +++ b/usr/src/uts/common/c2/audit_kevents.h @@ -349,10 +349,15 @@ extern "C" { #define AUE_AUDITON_GETAMASK 310 /* =aa */ #define AUE_AUDITON_SETAMASK 311 /* =as */ #define AUE_PSECFLAGS 312 /* =pm psecflags */ -#define AUE_SACL 313 /* =sa SACL auditing */ +#define AUE_SACL 313 /* =sa SACL auditing (reserved) */ +#define AUE_AUDITON_GETPINFO 314 /* =aa */ +#define AUE_AUDITON_SETPMASK 315 /* =as */ +#define AUE_AUDITON_GETKAUDIT 316 /* =aa */ +#define AUE_AUDITON_SETKAUDIT 317 /* =as */ +#define AUE_AUDITON_OTHER 318 /* =aa */ /* NOTE: update MAX_KEVENTS below if events are added. */ -#define MAX_KEVENTS 313 +#define MAX_KEVENTS 318 #ifdef __cplusplus } diff --git a/usr/src/uts/intel/Makefile.intel b/usr/src/uts/intel/Makefile.intel index 32f5ff1bad..b24530aa36 100644 --- a/usr/src/uts/intel/Makefile.intel +++ b/usr/src/uts/intel/Makefile.intel @@ -158,6 +158,7 @@ CFLAGS += -xstrconst STACKPROTECT_ = -_gcc4=-fstack-protector STACKPROTECT_ += -_gcc7=-fstack-protector-strong STACKPROTECT_ += -_gcc8=-fstack-protector-strong +STACKPROTECT_ += -_gcc9=-fstack-protector-strong STACKPROTECT_strong = $(STACKPROTECT_) STACKPROTECT_none = -_gcc=-fstack-protector-none |