mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-30 12:25:10 +01:00
Compare commits
45
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4493d04f4b | ||
|
|
ce2d23d4c3 | ||
|
|
9fe10651e9 | ||
|
|
a4a9338dd4 | ||
|
|
4da9c5a728 | ||
|
|
9855dd2376 | ||
|
|
45fb2fc413 | ||
|
|
e70d2e5cf3 | ||
|
|
b9a977a824 | ||
|
|
07f89c430f | ||
|
|
aea55657ff | ||
|
|
a57453d33d | ||
|
|
7b277c6d0b | ||
|
|
808d570e8e | ||
|
|
1a58de3adb | ||
|
|
2bee0d1627 | ||
|
|
e8ada9d870 | ||
|
|
4b41f17f29 | ||
|
|
e599c24cfe | ||
|
|
3944c1881d | ||
|
|
b99f9165eb | ||
|
|
94b445c94e | ||
|
|
8852850499 | ||
|
|
5f45e57447 | ||
|
|
a0fc0837d1 | ||
|
|
12eba1321c | ||
|
|
78c53355f1 | ||
|
|
48d032343c | ||
|
|
bb7319892f | ||
|
|
4b407891dd | ||
|
|
bfa6f99e91 | ||
|
|
25edfb6bd8 | ||
|
|
4a6712d364 | ||
|
|
519e2d55ae | ||
|
|
8fd84e1078 | ||
|
|
236a66e498 | ||
|
|
0911de95ac | ||
|
|
512f08014f | ||
|
|
6e8aac78a5 | ||
|
|
911c6efdde | ||
|
|
706a1f4eab | ||
|
|
7704299ea1 | ||
|
|
257229dc3c | ||
|
|
3fa483c3a3 | ||
|
|
f787c80d66 |
No files matched your search
@@ -4,7 +4,7 @@
|
||||
The compilation of software known as FreeBSD is distributed under the
|
||||
following terms:
|
||||
|
||||
Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved.
|
||||
Copyright (c) 1992-2013 The FreeBSD Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
||||
@@ -117,13 +117,7 @@ MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
|
||||
BINMAKE= \
|
||||
`if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
|
||||
-m ${.CURDIR}/share/mk
|
||||
|
||||
.if defined(.PARSEDIR)
|
||||
# don't pass -J to fmake
|
||||
_MAKE= PATH=${PATH} MAKEFLAGS="${MAKEFLAGS:N-J:N1*,1*}" ${BINMAKE} -f Makefile.inc1
|
||||
.else
|
||||
_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1
|
||||
.endif
|
||||
|
||||
#
|
||||
# Make sure we have an up-to-date make(1). Only world and buildworld
|
||||
@@ -181,7 +175,7 @@ ${TGTS}:
|
||||
.MAIN: all
|
||||
|
||||
STARTTIME!= LC_ALL=C date
|
||||
CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s; echo
|
||||
CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s
|
||||
.if !empty(CHECK_TIME)
|
||||
.error check your date/time: ${STARTTIME}
|
||||
.endif
|
||||
@@ -306,7 +300,7 @@ MAKEFAIL=tee -a ${FAILFILE}
|
||||
MAKEFAIL=cat
|
||||
.endif
|
||||
|
||||
universe: universe_prologue upgrade_checks
|
||||
universe: universe_prologue
|
||||
universe_prologue:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> make universe started on ${STARTTIME}"
|
||||
@@ -316,7 +310,7 @@ universe_prologue:
|
||||
.endif
|
||||
.for target in ${TARGETS}
|
||||
universe: universe_${target}
|
||||
.ORDER: universe_prologue upgrade_checks universe_${target}_prologue universe_${target} universe_epilogue
|
||||
.ORDER: universe_prologue universe_${target} universe_epilogue
|
||||
universe_${target}:
|
||||
@echo ">> ${target} started on `LC_ALL=C date`"
|
||||
.if !defined(MAKE_JUST_KERNELS)
|
||||
@@ -372,11 +366,3 @@ universe_epilogue:
|
||||
fi
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(.PARSEDIR)
|
||||
.if make(universe)
|
||||
# we do not want a failure of one branch abort all.
|
||||
MAKE_JOB_ERROR_TOKEN= no
|
||||
.export MAKE_JOB_ERROR_TOKEN
|
||||
.endif
|
||||
.endif
|
||||
+4
-11
@@ -92,7 +92,7 @@ CLEANDIR= cleandir
|
||||
.endif
|
||||
|
||||
CVS?= cvs
|
||||
CVSFLAGS?= -r RELENG_8 -P -d -I!
|
||||
CVSFLAGS?= -r RELENG_8_4 -P -d -I!
|
||||
SVN?= svn
|
||||
SVNFLAGS?= -r HEAD
|
||||
SUP?= /usr/bin/csup
|
||||
@@ -779,7 +779,7 @@ buildkernel:
|
||||
cd ${KRNLOBJDIR}/${_kernel}; \
|
||||
PATH=${BPATH}:${PATH} \
|
||||
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
|
||||
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
|
||||
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \
|
||||
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
|
||||
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
|
||||
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
|
||||
@@ -787,7 +787,7 @@ buildkernel:
|
||||
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
|
||||
PATH=${BPATH}:${PATH} \
|
||||
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
|
||||
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF ${target}
|
||||
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target}
|
||||
.endfor
|
||||
.endif
|
||||
.if !defined(NO_KERNELDEPEND)
|
||||
@@ -953,9 +953,7 @@ _lex= usr.bin/lex
|
||||
.endif
|
||||
|
||||
.if ${BOOTSTRAPPING} >= 1000013
|
||||
_lex= usr.bin/lex
|
||||
_yacc= lib/liby \
|
||||
usr.bin/yacc
|
||||
_yacc= usr.bin/yacc
|
||||
.endif
|
||||
|
||||
.if ${BOOTSTRAPPING} < 800013
|
||||
@@ -1141,8 +1139,6 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} \
|
||||
lib/libopie lib/libpam ${_lib_libthr} \
|
||||
lib/libradius lib/libsbuf lib/libtacplus \
|
||||
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
|
||||
${_cddl_lib_libavl} \
|
||||
${_cddl_lib_libzfs_core} \
|
||||
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
|
||||
${_secure_lib_libcrypto} ${_secure_lib_libssh} \
|
||||
${_secure_lib_libssl}
|
||||
@@ -1158,10 +1154,7 @@ lib/libopie__L lib/libtacplus__L: lib/libmd__L
|
||||
.if ${MK_CDDL} != "no"
|
||||
_cddl_lib_libumem= cddl/lib/libumem
|
||||
_cddl_lib_libnvpair= cddl/lib/libnvpair
|
||||
_cddl_lib_libavl= cddl/lib/libavl
|
||||
_cddl_lib_libzfs_core= cddl/lib/libzfs_core
|
||||
_cddl_lib= cddl/lib
|
||||
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
|
||||
.endif
|
||||
|
||||
.if ${MK_CRYPT} != "no"
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
|
||||
#
|
||||
|
||||
# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed
|
||||
OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz
|
||||
OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz
|
||||
# 20130701: vfs_mount.9 removed
|
||||
OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz
|
||||
# 20110915: rename congestion control manpages
|
||||
OLD_FILES+=usr/share/man/man4/cc.4.gz
|
||||
OLD_FILES+=usr/share/man/man9/cc.9.gz
|
||||
@@ -1975,202 +1970,6 @@ OLD_FILES+=lib/geom/geom_concat.so.1
|
||||
OLD_FILES+=lib/geom/geom_label.so.1
|
||||
OLD_FILES+=lib/geom/geom_nop.so.1
|
||||
OLD_FILES+=lib/geom/geom_stripe.so.1
|
||||
# 20040728: GCC 3.4.2
|
||||
OLD_DIRS+=usr/include/c++/3.3
|
||||
OLD_FILES+=usr/include/c++/3.3/FlexLexer.h
|
||||
OLD_FILES+=usr/include/c++/3.3/algorithm
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/algo.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/algobase.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/alloc.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/backward_warning.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/bvector.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/complex.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/defalloc.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/deque.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/fstream.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/function.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/hash_map.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/hash_set.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/hashtable.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/heap.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/iomanip.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/iostream.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/istream.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/iterator.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/list.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/map.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/multimap.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/multiset.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/new.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/ostream.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/pair.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/queue.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/rope.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/set.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/slist.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/stack.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/stream.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/streambuf.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/strstream
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/strstream.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/tempbuf.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/tree.h
|
||||
OLD_FILES+=usr/include/c++/3.3/backward/vector.h
|
||||
OLD_DIRS+=usr/include/c++/3.3/backward
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/atomicity.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/basic_file.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/basic_ios.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/basic_ios.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/basic_string.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/basic_string.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/boost_concept_check.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/c++config.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/c++io.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/c++locale.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/c++locale_internal.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/char_traits.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/cmath.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/codecvt.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/codecvt_specializations.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/concept_check.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/cpp_type_traits.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/ctype_base.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/ctype_inline.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/ctype_noninline.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/deque.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/fpos.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/fstream.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/functexcept.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/generic_shadow.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/gslice.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/gslice_array.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/gthr-default.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/gthr-posix.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/gthr-single.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/gthr.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/indirect_array.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/ios_base.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/istream.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/list.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/locale_classes.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/locale_facets.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/locale_facets.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/localefwd.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/mask_array.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/messages_members.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/os_defines.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/ostream.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/pthread_allocimpl.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/slice.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/slice_array.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/sstream.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_algo.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_algobase.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_alloc.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_bvector.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_construct.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_deque.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_function.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_heap.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_iterator.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_iterator_base_funcs.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_iterator_base_types.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_list.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_map.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_multimap.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_multiset.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_numeric.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_pair.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_pthread_alloc.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_queue.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_raw_storage_iter.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_relops.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_set.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_stack.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_tempbuf.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_threads.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_tree.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_uninitialized.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stl_vector.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stream_iterator.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/streambuf.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/streambuf_iterator.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/stringfwd.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/time_members.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/type_traits.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/valarray_array.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/valarray_array.tcc
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/valarray_meta.h
|
||||
OLD_FILES+=usr/include/c++/3.3/bits/vector.tcc
|
||||
OLD_DIRS+=usr/include/c++/3.3/bits
|
||||
OLD_FILES+=usr/include/c++/3.3/bitset
|
||||
OLD_FILES+=usr/include/c++/3.3/cassert
|
||||
OLD_FILES+=usr/include/c++/3.3/cctype
|
||||
OLD_FILES+=usr/include/c++/3.3/cerrno
|
||||
OLD_FILES+=usr/include/c++/3.3/cfloat
|
||||
OLD_FILES+=usr/include/c++/3.3/ciso646
|
||||
OLD_FILES+=usr/include/c++/3.3/climits
|
||||
OLD_FILES+=usr/include/c++/3.3/clocale
|
||||
OLD_FILES+=usr/include/c++/3.3/cmath
|
||||
OLD_FILES+=usr/include/c++/3.3/complex
|
||||
OLD_FILES+=usr/include/c++/3.3/csetjmp
|
||||
OLD_FILES+=usr/include/c++/3.3/csignal
|
||||
OLD_FILES+=usr/include/c++/3.3/cstdarg
|
||||
OLD_FILES+=usr/include/c++/3.3/cstddef
|
||||
OLD_FILES+=usr/include/c++/3.3/cstdio
|
||||
OLD_FILES+=usr/include/c++/3.3/cstdlib
|
||||
OLD_FILES+=usr/include/c++/3.3/cstring
|
||||
OLD_FILES+=usr/include/c++/3.3/ctime
|
||||
OLD_FILES+=usr/include/c++/3.3/cwchar
|
||||
OLD_FILES+=usr/include/c++/3.3/cwctype
|
||||
OLD_FILES+=usr/include/c++/3.3/cxxabi.h
|
||||
OLD_FILES+=usr/include/c++/3.3/deque
|
||||
OLD_FILES+=usr/include/c++/3.3/exception
|
||||
OLD_FILES+=usr/include/c++/3.3/exception_defines.h
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/algorithm
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/enc_filebuf.h
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/functional
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/hash_map
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/hash_set
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/iterator
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/memory
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/numeric
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/rb_tree
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/rope
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/ropeimpl.h
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/slist
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/stdio_filebuf.h
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/stl_hash_fun.h
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/stl_hashtable.h
|
||||
OLD_FILES+=usr/include/c++/3.3/ext/stl_rope.h
|
||||
OLD_DIRS+=usr/include/c++/3.3/ext
|
||||
OLD_FILES+=usr/include/c++/3.3/fstream
|
||||
OLD_FILES+=usr/include/c++/3.3/functional
|
||||
OLD_FILES+=usr/include/c++/3.3/iomanip
|
||||
OLD_FILES+=usr/include/c++/3.3/ios
|
||||
OLD_FILES+=usr/include/c++/3.3/iosfwd
|
||||
OLD_FILES+=usr/include/c++/3.3/iostream
|
||||
OLD_FILES+=usr/include/c++/3.3/istream
|
||||
OLD_FILES+=usr/include/c++/3.3/iterator
|
||||
OLD_FILES+=usr/include/c++/3.3/limits
|
||||
OLD_FILES+=usr/include/c++/3.3/list
|
||||
OLD_FILES+=usr/include/c++/3.3/locale
|
||||
OLD_FILES+=usr/include/c++/3.3/map
|
||||
OLD_FILES+=usr/include/c++/3.3/memory
|
||||
OLD_FILES+=usr/include/c++/3.3/new
|
||||
OLD_FILES+=usr/include/c++/3.3/numeric
|
||||
OLD_FILES+=usr/include/c++/3.3/ostream
|
||||
OLD_FILES+=usr/include/c++/3.3/queue
|
||||
OLD_FILES+=usr/include/c++/3.3/set
|
||||
OLD_FILES+=usr/include/c++/3.3/sstream
|
||||
OLD_FILES+=usr/include/c++/3.3/stack
|
||||
OLD_FILES+=usr/include/c++/3.3/stdexcept
|
||||
OLD_FILES+=usr/include/c++/3.3/streambuf
|
||||
OLD_FILES+=usr/include/c++/3.3/string
|
||||
OLD_FILES+=usr/include/c++/3.3/typeinfo
|
||||
OLD_FILES+=usr/include/c++/3.3/utility
|
||||
OLD_FILES+=usr/include/c++/3.3/valarray
|
||||
OLD_FILES+=usr/include/c++/3.3/vector
|
||||
# 20040713: fla(4) removed.
|
||||
OLD_FILES+=usr/share/man/man4/fla.4.gz
|
||||
# 200407XX
|
||||
|
||||
@@ -15,72 +15,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW ON IA64 OR SUN4V:
|
||||
debugging tools present in HEAD were left in place because
|
||||
sun4v support still needs work to become production ready.
|
||||
|
||||
20150624:
|
||||
An additional fix for the issue described in the 20150615 sendmail
|
||||
entry below has been been committed in revision 284790.
|
||||
|
||||
20150615:
|
||||
The latest version of openssl rejects TLS handshakes with DH
|
||||
parameters below 768 bits. sendmail releases prior to 8.15.2
|
||||
(not yet released), defaulted to a 512 bit DH parameter setting
|
||||
for client connections. To improve interoperability, the
|
||||
sendmail default for client connections has been raised to
|
||||
1024 bits.
|
||||
|
||||
20140216:
|
||||
The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has
|
||||
been deprecated and will not be part of FreeBSD 11.0 and later
|
||||
releases. If you use this driver, please consider switching to
|
||||
the nfe(4) driver instead.
|
||||
|
||||
20131216:
|
||||
The behavior of gss_pseudo_random() for the krb5 mechanism
|
||||
has changed, for applications requesting a longer random string
|
||||
than produced by the underlying enctype's pseudo-random() function.
|
||||
In particular, the random string produced from a session key of
|
||||
enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will
|
||||
be different at the 17th octet and later, after this change.
|
||||
The counter used in the PRF+ construction is now encoded as a
|
||||
big-endian integer in accordance with RFC 4402.
|
||||
__FreeBSD_version is bumped to 804501.
|
||||
|
||||
20130823:
|
||||
Behavior of devfs rules path matching has been changed.
|
||||
Pattern is now always matched against fully qualified devfs
|
||||
path and slash characters must be explicitly matched by
|
||||
slashes in pattern (FNM_PATHNAME). Rulesets involving devfs
|
||||
subdirectories must be reviewed.
|
||||
|
||||
20130705:
|
||||
hastctl(8)'s `status' command output changed to terse one-liner format.
|
||||
Scripts using this should switch to `list' command or be rewritten.
|
||||
|
||||
20130624:
|
||||
Added ZFS TRIM support which is enabled by default. To disable
|
||||
ZFS TRIM support set vfs.zfs.trim.enabled=0 in loader.conf.
|
||||
|
||||
Creating new ZFS pools and adding new devices to existing pools
|
||||
first performs a full device level TRIM, which can take a significant
|
||||
amount of time. Set the sysctl vfs.zfs.vdev.trim_on_init to 0 to
|
||||
disable this behaviour.
|
||||
|
||||
ZFS TRIM requires the underlying device support BIO_DELETE which
|
||||
is currently provided by methods such as ATA TRIM and SCSI UNMAP
|
||||
via CAM, which are typically supported by SSD's.
|
||||
|
||||
Stats for ZFS TRIM can be monitored by looking at the sysctl's
|
||||
under kstat.zfs.misc.zio_trim.
|
||||
|
||||
20130607:
|
||||
8.4-RELEASE.
|
||||
|
||||
20130524:
|
||||
`list' command has been added to hastctl(8). For now, it is full
|
||||
equivalent of `status' command.
|
||||
WARNING: in the near future the output of hastctl's status command
|
||||
will change to more terse format. If you use `hastctl status'
|
||||
for parsing in your scripts, switch to `hastctl list'.
|
||||
|
||||
20130429:
|
||||
Fix a bug that allows NFS clients to issue READDIR on files.
|
||||
|
||||
|
||||
@@ -54,6 +54,4 @@ _rmail= rmail
|
||||
_csh= csh
|
||||
.endif
|
||||
|
||||
SUBDIR_PARALLEL=
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
+3
-3
@@ -134,7 +134,7 @@ will run with effective gid set to the gid of the file owner.
|
||||
See
|
||||
.Xr chmod 2
|
||||
and
|
||||
.Xr sticky 7 .
|
||||
.Xr sticky 8 .
|
||||
.It Li 0400
|
||||
Allow read by owner.
|
||||
.It Li 0200
|
||||
@@ -325,10 +325,10 @@ option is non-standard and its use in scripts is not recommended.
|
||||
.Xr umask 2 ,
|
||||
.Xr fts 3 ,
|
||||
.Xr setmode 3 ,
|
||||
.Xr sticky 7 ,
|
||||
.Xr symlink 7 ,
|
||||
.Xr chown 8 ,
|
||||
.Xr mount 8
|
||||
.Xr mount 8 ,
|
||||
.Xr sticky 8
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
|
||||
+1
-1
@@ -351,7 +351,7 @@ dd_in(void)
|
||||
* than noerror, notrunc or sync are specified, the block
|
||||
* is output without buffering as it is read.
|
||||
*/
|
||||
if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) {
|
||||
if (ddflags & C_BS) {
|
||||
out.dbcnt = in.dbcnt;
|
||||
dd_out(1);
|
||||
in.dbcnt = 0;
|
||||
|
||||
+2
-2
@@ -243,7 +243,7 @@ expand_des_key(char *obuf, char *kbuf)
|
||||
/*
|
||||
* now translate it, bombing on any illegal hex digit
|
||||
*/
|
||||
for (i = 0; i < 16 && kbuf[i]; i++)
|
||||
for (i = 0; kbuf[i] && i < 16; i++)
|
||||
if ((nbuf[i] = hex_to_binary((int) kbuf[i], 16)) == -1)
|
||||
des_error("bad hex digit in key");
|
||||
while (i < 16)
|
||||
@@ -263,7 +263,7 @@ expand_des_key(char *obuf, char *kbuf)
|
||||
/*
|
||||
* now translate it, bombing on any illegal binary digit
|
||||
*/
|
||||
for (i = 0; i < 16 && kbuf[i]; i++)
|
||||
for (i = 0; kbuf[i] && i < 16; i++)
|
||||
if ((nbuf[i] = hex_to_binary((int) kbuf[i], 2)) == -1)
|
||||
des_error("bad binary digit in key");
|
||||
while (i < 64)
|
||||
|
||||
+4
-4
@@ -459,7 +459,7 @@ but not execute or search permission.
|
||||
(See
|
||||
.Xr chmod 1
|
||||
or
|
||||
.Xr sticky 7 . )
|
||||
.Xr sticky 8 . )
|
||||
.It Sy t
|
||||
The sticky bit is set (mode
|
||||
.Li 1000 ) ,
|
||||
@@ -467,7 +467,7 @@ and is searchable or executable.
|
||||
(See
|
||||
.Xr chmod 1
|
||||
or
|
||||
.Xr sticky 7 . )
|
||||
.Xr sticky 8 . )
|
||||
.El
|
||||
.El
|
||||
.Pp
|
||||
@@ -683,9 +683,9 @@ specification.
|
||||
.Xr strmode 3 ,
|
||||
.Xr termcap 5 ,
|
||||
.Xr maclabel 7 ,
|
||||
.Xr sticky 7 ,
|
||||
.Xr symlink 7 ,
|
||||
.Xr getfmac 8
|
||||
.Xr getfmac 8 ,
|
||||
.Xr sticky 8
|
||||
.Sh STANDARDS
|
||||
With the exception of options
|
||||
.Fl I , g , n
|
||||
|
||||
+2
-2
@@ -135,7 +135,7 @@ main(int argc, char *argv[])
|
||||
* Returns 1 if a directory has been created,
|
||||
* 2 if it already existed, and 0 on failure.
|
||||
*/
|
||||
static int
|
||||
int
|
||||
build(char *path, mode_t omode)
|
||||
{
|
||||
struct stat sb;
|
||||
@@ -208,7 +208,7 @@ build(char *path, mode_t omode)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
usage(void)
|
||||
{
|
||||
|
||||
|
||||
+17
-17
@@ -62,15 +62,15 @@ int rflag, Iflag;
|
||||
uid_t uid;
|
||||
volatile sig_atomic_t info;
|
||||
|
||||
static int check(const char *, const char *, struct stat *);
|
||||
static int check2(char **);
|
||||
static void checkdot(char **);
|
||||
static void checkslash(char **);
|
||||
static void rm_file(char **);
|
||||
static int rm_overwrite(const char *, struct stat *);
|
||||
static void rm_tree(char **);
|
||||
int check(char *, char *, struct stat *);
|
||||
int check2(char **);
|
||||
void checkdot(char **);
|
||||
void checkslash(char **);
|
||||
void rm_file(char **);
|
||||
int rm_overwrite(char *, struct stat *);
|
||||
void rm_tree(char **);
|
||||
static void siginfo(int __unused);
|
||||
static void usage(void);
|
||||
void usage(void);
|
||||
|
||||
/*
|
||||
* rm --
|
||||
@@ -169,7 +169,7 @@ main(int argc, char *argv[])
|
||||
exit (eval);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
rm_tree(char **argv)
|
||||
{
|
||||
FTS *fts;
|
||||
@@ -412,7 +412,7 @@ rm_file(char **argv)
|
||||
* kernel support.
|
||||
*/
|
||||
int
|
||||
rm_overwrite(const char *file, struct stat *sbp)
|
||||
rm_overwrite(char *file, struct stat *sbp)
|
||||
{
|
||||
struct stat sb, sb2;
|
||||
struct statfs fsb;
|
||||
@@ -478,8 +478,8 @@ err: eval = 1;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
check(const char *path, const char *name, struct stat *sp)
|
||||
int
|
||||
check(char *path, char *name, struct stat *sp)
|
||||
{
|
||||
int ch, first;
|
||||
char modep[15], *flagsp;
|
||||
@@ -490,7 +490,7 @@ check(const char *path, const char *name, struct stat *sp)
|
||||
else {
|
||||
/*
|
||||
* If it's not a symbolic link and it's unwritable and we're
|
||||
* talking to a terminal, ask. Symbolic links are excluded
|
||||
* talking to a terminal, ask. Symbolic links are excluded
|
||||
* because their permissions are meaningless. Check stdin_ok
|
||||
* first because we may not have stat'ed the file.
|
||||
*/
|
||||
@@ -523,7 +523,7 @@ check(const char *path, const char *name, struct stat *sp)
|
||||
}
|
||||
|
||||
#define ISSLASH(a) ((a)[0] == '/' && (a)[1] == '\0')
|
||||
static void
|
||||
void
|
||||
checkslash(char **argv)
|
||||
{
|
||||
char **t, **u;
|
||||
@@ -543,7 +543,7 @@ checkslash(char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
check2(char **argv)
|
||||
{
|
||||
struct stat st;
|
||||
@@ -594,7 +594,7 @@ check2(char **argv)
|
||||
}
|
||||
|
||||
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
|
||||
static void
|
||||
void
|
||||
checkdot(char **argv)
|
||||
{
|
||||
char *p, **save, **t;
|
||||
@@ -618,7 +618,7 @@ checkdot(char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
usage(void)
|
||||
{
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::kern_ioctl:entry
|
||||
fbt::ioctl:entry
|
||||
{
|
||||
printf("Entering the ioctl function\n");
|
||||
}
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
{
|
||||
printf("Returning from ioctl function\n");
|
||||
exit(0);
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
{
|
||||
printf("The function return value is stored in %u\n", arg1);
|
||||
exit(0);
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::kern_ioctl:entry
|
||||
fbt::ioctl:entry
|
||||
{
|
||||
printf("Entering the ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
{
|
||||
printf("Returning from ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
|
||||
@@ -41,12 +41,12 @@ BEGIN
|
||||
self->traceme = 1;
|
||||
}
|
||||
|
||||
fbt::kern_ioctl:entry
|
||||
fbt::ioctl:entry
|
||||
{
|
||||
printf("Entering the function\n");
|
||||
}
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
{
|
||||
printf("The offset = %u\n", arg0);
|
||||
exit(0);
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::kern_ioctl:entry
|
||||
fbt::ioctl:entry
|
||||
{
|
||||
printf("Entering the ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
{
|
||||
printf("Returning from ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
/arg1 == 0/
|
||||
{
|
||||
printf("%s %x returned 0", probefunc, arg0);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::kern_ioctl:entry
|
||||
fbt::ioctl:entry
|
||||
{
|
||||
self->traceme = 1;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ fbt:::entry
|
||||
printf("called %s\n", probefunc);
|
||||
}
|
||||
|
||||
fbt::kern_ioctl:return
|
||||
fbt::ioctl:return
|
||||
/self->traceme/
|
||||
{
|
||||
self->traceme = 0;
|
||||
|
||||
@@ -14,12 +14,11 @@
|
||||
.\"
|
||||
.\" Copyright 2012, Richard Lowe.
|
||||
.\" Copyright (c) 2012, Marcelo Araujo <[email protected]>.
|
||||
.\" Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
.\" All Rights Reserved.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 31, 2013
|
||||
.Dd May 10, 2012
|
||||
.Dt ZDB 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -30,35 +29,27 @@
|
||||
.Op Fl CumdibcsDvhLXFPA
|
||||
.Op Fl e Op Fl p Ar path...
|
||||
.Op Fl t Ar txg
|
||||
.Op Fl U Ar cache
|
||||
.Op Fl M Ar inflight I/Os
|
||||
.Ar poolname
|
||||
.Op Ar object ...
|
||||
.Nm
|
||||
.Op Fl divPA
|
||||
.Op Fl e Op Fl p Ar path...
|
||||
.Op Fl U Ar cache
|
||||
.Ar dataset
|
||||
.Op Ar object ...
|
||||
.Nm
|
||||
.Fl m Op Fl LXFPA
|
||||
.Op Fl t Ar txg
|
||||
.Op Fl e Op Fl p Ar path...
|
||||
.Op Fl U Ar cache
|
||||
.Ar poolname
|
||||
.Nm
|
||||
.Fl R Op Fl A
|
||||
.Op Fl e Op Fl p Ar path...
|
||||
.Op Fl U Ar cache
|
||||
.Ar poolname
|
||||
.Ar poolname
|
||||
.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
|
||||
.Nm
|
||||
.Fl S
|
||||
.Op Fl AP
|
||||
.Op Fl e Op Fl p Ar path...
|
||||
.Op Fl U Ar cache
|
||||
.Ar poolname
|
||||
.Ar poolname
|
||||
.Nm
|
||||
.Fl l
|
||||
@@ -214,11 +205,6 @@ flag specifies the path under which devices are to be searched.
|
||||
.It Fl F
|
||||
Attempt to make an unreadable pool readable by trying progressively older
|
||||
transactions.
|
||||
.It Fl M Ar inflight I/Os
|
||||
Limit the number of outstanding checksum I/Os to the specified value.
|
||||
The default value is 200. This option affects the performance of the
|
||||
.Fl c
|
||||
option.
|
||||
.It Fl P
|
||||
Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
|
||||
than 1M.
|
||||
@@ -232,7 +218,9 @@ options for a means to see the available uberblocks and their associated
|
||||
transaction numbers.
|
||||
.It Fl U Ar cachefile
|
||||
Use a cache file other than
|
||||
.Pa /boot/zfs/zpool.cache .
|
||||
.Pa /etc/zfs/zpool.cache .
|
||||
This option is only valid with
|
||||
.Fl C
|
||||
.It Fl v
|
||||
Enable verbosity.
|
||||
Specify multiple times for increased verbosity.
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -23,10 +23,6 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Print intent log header and statistics.
|
||||
*/
|
||||
@@ -51,7 +47,7 @@ print_log_bp(const blkptr_t *bp, const char *prefix)
|
||||
{
|
||||
char blkbuf[BP_SPRINTF_LEN];
|
||||
|
||||
snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
|
||||
sprintf_blkptr(blkbuf, bp);
|
||||
(void) printf("%s%s\n", prefix, blkbuf);
|
||||
}
|
||||
|
||||
@@ -136,7 +132,6 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
|
||||
|
||||
if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
|
||||
(void) printf("%shas blkptr, %s\n", prefix,
|
||||
!BP_IS_HOLE(bp) &&
|
||||
bp->blk_birth >= spa_first_txg(zilog->zl_spa) ?
|
||||
"will claim" : "won't claim");
|
||||
print_log_bp(bp, prefix);
|
||||
@@ -144,6 +139,8 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
|
||||
if (BP_IS_HOLE(bp)) {
|
||||
(void) printf("\t\t\tLSIZE 0x%llx\n",
|
||||
(u_longlong_t)BP_GET_LSIZE(bp));
|
||||
}
|
||||
if (bp->blk_birth == 0) {
|
||||
bzero(buf, sizeof (buf));
|
||||
(void) printf("%s<hole>\n", prefix);
|
||||
return;
|
||||
@@ -316,8 +313,7 @@ print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
|
||||
|
||||
if (verbose >= 5) {
|
||||
(void) strcpy(blkbuf, ", ");
|
||||
snprintf_blkptr(blkbuf + strlen(blkbuf),
|
||||
sizeof (blkbuf) - strlen(blkbuf), bp);
|
||||
sprintf_blkptr(blkbuf + strlen(blkbuf), bp);
|
||||
} else {
|
||||
blkbuf[0] = '\0';
|
||||
}
|
||||
@@ -365,7 +361,7 @@ dump_intent_log(zilog_t *zilog)
|
||||
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
||||
int i;
|
||||
|
||||
if (BP_IS_HOLE(&zh->zh_log) || verbose < 1)
|
||||
if (zh->zh_log.blk_birth == 0 || verbose < 1)
|
||||
return;
|
||||
|
||||
(void) printf("\n ZIL header: claim_txg %llu, "
|
||||
|
||||
@@ -18,18 +18,16 @@
|
||||
.\" information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
.\"
|
||||
.\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
|
||||
.\" Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
||||
.\" Copyright (c) 2011, Pawel Jakub Dawidek <[email protected]>
|
||||
.\" Copyright (c) 2012, Glen Barber <[email protected]>
|
||||
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
|
||||
.\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved.
|
||||
.\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
||||
.\" Copyright (c) 2013, Steven Hartland <[email protected]>
|
||||
.\" Copyright (c) 2014, Xin LI <[email protected]>
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 2, 2014
|
||||
.Dd February 10, 2013
|
||||
.Dt ZFS 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -57,21 +55,15 @@
|
||||
.Cm destroy
|
||||
.Op Fl dnpRrv
|
||||
.Sm off
|
||||
.Ar filesystem Ns | Ns volume
|
||||
.Ns @snap
|
||||
.Op % Ns Ar snap
|
||||
.Op , Ns Ar snap Op % Ns Ar snap
|
||||
.Ar snapshot
|
||||
.Op % Ns Ar snapname
|
||||
.Op , Ns ...
|
||||
.Sm on
|
||||
.Nm
|
||||
.Cm destroy
|
||||
.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
|
||||
.Nm
|
||||
.Cm snapshot Ns | Ns Cm snap
|
||||
.Cm snapshot
|
||||
.Op Fl r
|
||||
.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
|
||||
.Ar filesystem@snapname Ns | Ns Ar volume@snapname
|
||||
.Ar filesystem@snapname Ns | Ns Ar volume@snapname Ns ...
|
||||
.Nm
|
||||
.Cm rollback
|
||||
.Op Fl rRf
|
||||
@@ -107,7 +99,7 @@
|
||||
.Nm
|
||||
.Cm list
|
||||
.Op Fl r Ns | Ns Fl d Ar depth
|
||||
.Op Fl Hp
|
||||
.Op Fl H
|
||||
.Op Fl o Ar property Ns Oo , Ns property Ns Oc Ns ...
|
||||
.Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ...
|
||||
.Oo Fl s Ar property Oc Ns ...
|
||||
@@ -163,7 +155,7 @@
|
||||
.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
|
||||
.Fl a | Ar filesystem
|
||||
.Nm
|
||||
.Cm unmount Ns | Ns Cm umount
|
||||
.Cm unmount
|
||||
.Op Fl f
|
||||
.Fl a | Ar filesystem Ns | Ns Ar mountpoint
|
||||
.Nm
|
||||
@@ -173,24 +165,16 @@
|
||||
.Cm unshare
|
||||
.Fl a | Ar filesystem Ns | Ns Ar mountpoint
|
||||
.Nm
|
||||
.Cm bookmark
|
||||
.Ar snapshot
|
||||
.Ar bookmark
|
||||
.Nm
|
||||
.Cm send
|
||||
.Op Fl DnPpRv
|
||||
.Op Fl i Ar snapshot | Fl I Ar snapshot
|
||||
.Ar snapshot
|
||||
.Nm
|
||||
.Cm send
|
||||
.Op Fl i Ar snapshot Ns | Ns bookmark
|
||||
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
|
||||
.Nm
|
||||
.Cm receive Ns | Ns Cm recv
|
||||
.Cm receive
|
||||
.Op Fl vnFu
|
||||
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
|
||||
.Nm
|
||||
.Cm receive Ns | Ns Cm recv
|
||||
.Cm receive
|
||||
.Op Fl vnFu
|
||||
.Op Fl d | e
|
||||
.Ar filesystem
|
||||
@@ -535,39 +519,6 @@ if the snapshot has been marked for deferred destroy by using the
|
||||
.Qq Nm Cm destroy -d
|
||||
command. Otherwise, the property is
|
||||
.Cm off .
|
||||
.It Sy logicalreferenced
|
||||
The amount of space that is
|
||||
.Qq logically
|
||||
accessible by this dataset.
|
||||
See the
|
||||
.Sy referenced
|
||||
property.
|
||||
The logical space ignores the effect of the
|
||||
.Sy compression
|
||||
and
|
||||
.Sy copies
|
||||
properties, giving a quantity closer to the amount of data that applications
|
||||
see.
|
||||
However, it does include space consumed by metadata.
|
||||
.Pp
|
||||
This property can also be referred to by its shortened column name,
|
||||
.Sy lrefer .
|
||||
.It Sy logicalused
|
||||
The amount of space that is
|
||||
.Qq logically
|
||||
consumed by this dataset and all its descendents.
|
||||
See the
|
||||
.Sy used
|
||||
property.
|
||||
The logical space ignores the effect of the
|
||||
.Sy compression
|
||||
and
|
||||
.Sy copies
|
||||
properties, giving a quantity closer to the amount of data that applications
|
||||
see.
|
||||
.Pp
|
||||
This property can also be referred to by its shortened column name,
|
||||
.Sy lused .
|
||||
.It Sy mounted
|
||||
For file systems, indicates whether the file system is currently mounted. This
|
||||
property can be either
|
||||
@@ -899,21 +850,14 @@ command or unmounted by the
|
||||
command.
|
||||
.Pp
|
||||
This property is not inherited.
|
||||
.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity
|
||||
.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256
|
||||
Controls the checksum used to verify data integrity. The default value is
|
||||
.Cm on ,
|
||||
which automatically selects an appropriate algorithm (currently,
|
||||
.Cm fletcher4 ,
|
||||
but this may change in future releases). The value
|
||||
.Cm off
|
||||
disables integrity checking on user data.
|
||||
The value
|
||||
.Cm noparity
|
||||
not only
|
||||
disables integrity but also disables maintaining parity for user data. This
|
||||
setting is used internally by a dump device residing on a RAID-Z pool and should
|
||||
not be used by any other dataset.
|
||||
Disabling checksums is
|
||||
disables integrity checking on user data. Disabling checksums is
|
||||
.Em NOT
|
||||
a recommended practice.
|
||||
.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4
|
||||
@@ -1214,7 +1158,7 @@ When the
|
||||
.Sy sharenfs
|
||||
property is changed for a dataset, the
|
||||
.Xr mountd 8
|
||||
daemon is reloaded.
|
||||
dameon is reloaded.
|
||||
.It Sy logbias Ns = Ns Cm latency | throughput
|
||||
Provide a hint to
|
||||
.Tn ZFS
|
||||
@@ -1631,11 +1575,7 @@ multiple snapshots.
|
||||
Destroy (or mark for deferred deletion) all snapshots with this name in
|
||||
descendent file systems.
|
||||
.It Fl R
|
||||
Recursively destroy all clones of these snapshots, including the clones,
|
||||
snapshots, and children.
|
||||
If this flag is specified, the
|
||||
.Op fl d
|
||||
flag will have no effect.
|
||||
Recursively destroy all dependents.
|
||||
.It Fl n
|
||||
Do a dry-run ("No-op") deletion. No data will be deleted. This is useful in
|
||||
conjunction with the
|
||||
@@ -1659,29 +1599,21 @@ options, as they can destroy large portions of a pool and cause unexpected
|
||||
behavior for mounted file systems in use.
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm destroy
|
||||
.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
|
||||
.Xc
|
||||
.Pp
|
||||
The given bookmark is destroyed.
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm snapshot Ns | Ns Cm snap
|
||||
.Cm snapshot
|
||||
.Op Fl r
|
||||
.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
|
||||
.Ar filesystem@snapname Ns | Ns volume@snapname
|
||||
.Ar filesystem@snapname Ns | Ns volume@snapname Ns ...
|
||||
.Xc
|
||||
.Pp
|
||||
Creates snapshots with the given names. All previous modifications by
|
||||
successful system calls to the file system are part of the snapshots.
|
||||
Snapshots are taken atomically, so that all snapshots correspond to the same
|
||||
moment in time. See the
|
||||
Creates a snapshot with the given name. All previous modifications by
|
||||
successful system calls to the file system are part of the snapshot. See the
|
||||
.Qq Sx Snapshots
|
||||
section for details.
|
||||
.Bl -tag -width indent
|
||||
.It Fl r
|
||||
Recursively create snapshots of all descendent datasets
|
||||
Recursively create snapshots of all descendent datasets. Snapshots are taken
|
||||
atomically, so that all recursive snapshots correspond to the same moment in
|
||||
time.
|
||||
.It Fl o Ar property Ns = Ns Ar value
|
||||
Sets the specified property; see
|
||||
.Qq Nm Cm create
|
||||
@@ -1698,24 +1630,14 @@ Roll back the given dataset to a previous snapshot. When a dataset is rolled
|
||||
back, all data that has changed since the snapshot is discarded, and the
|
||||
dataset reverts to the state at the time of the snapshot. By default, the
|
||||
command refuses to roll back to a snapshot other than the most recent one. In
|
||||
order to do so, all intermediate snapshots and bookmarks must be destroyed
|
||||
by specifying the
|
||||
order to do so, all intermediate snapshots must be destroyed by specifying the
|
||||
.Fl r
|
||||
option.
|
||||
.Pp
|
||||
The
|
||||
.Fl rR
|
||||
options do not recursively destroy the child snapshots of a
|
||||
recursive snapshot.
|
||||
Only direct snapshots of the specified filesystem
|
||||
are destroyed by either of these options.
|
||||
To completely roll back a
|
||||
recursive snapshot, you must rollback the individual child snapshots.
|
||||
.Bl -tag -width indent
|
||||
.It Fl r
|
||||
Destroy any snapshots and bookmarks more recent than the one specified.
|
||||
Recursively destroy any snapshots more recent than the one specified.
|
||||
.It Fl R
|
||||
Destroy any more recent snapshots and bookmarks, as well as any clones of those
|
||||
Recursively destroy any more recent snapshots, as well as any clones of those
|
||||
snapshots.
|
||||
.It Fl f
|
||||
Used with the
|
||||
@@ -1829,7 +1751,7 @@ only dataset that can be renamed recursively.
|
||||
.Nm
|
||||
.Cm list
|
||||
.Op Fl r Ns | Ns Fl d Ar depth
|
||||
.Op Fl Hp
|
||||
.Op Fl H
|
||||
.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
|
||||
.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
|
||||
.Oo Fl s Ar property Oc Ns ...
|
||||
@@ -1860,8 +1782,6 @@ will display only the dataset and its direct children.
|
||||
.It Fl H
|
||||
Used for scripting mode. Do not print headers and separate fields by a single
|
||||
tab instead of arbitrary white space.
|
||||
.It Fl p
|
||||
Display numbers in parsable (exact) values.
|
||||
.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
|
||||
A comma-separated list of properties to display. The property must be:
|
||||
.Bl -bullet -offset 2n
|
||||
@@ -1890,7 +1810,7 @@ syntax.
|
||||
A comma-separated list of types to display, where
|
||||
.Ar type
|
||||
is one of
|
||||
.Sy filesystem , snapshot , snap , volume , bookmark , No or Sy all .
|
||||
.Sy filesystem , snapshot , volume , No or Sy all .
|
||||
For example, specifying
|
||||
.Fl t Cm snapshot
|
||||
displays only snapshots.
|
||||
@@ -1987,7 +1907,7 @@ sections.
|
||||
The special value
|
||||
.Cm all
|
||||
can be used to display all properties that apply to the given dataset's type
|
||||
(filesystem, volume, snapshot, or bookmark).
|
||||
(filesystem, volume, or snapshot).
|
||||
.Bl -tag -width indent
|
||||
.It Fl r
|
||||
Recursively display properties for any children.
|
||||
@@ -2002,7 +1922,7 @@ Display output in a form more easily parsed by scripts. Any headers are
|
||||
omitted, and fields are explicitly separated by a single tab instead of an
|
||||
arbitrary amount of space.
|
||||
.It Fl p
|
||||
Display numbers in parsable (exact) values.
|
||||
Display numbers in parseable (exact) values.
|
||||
.It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ...
|
||||
A comma-separated list of columns to display. Supported values are
|
||||
.Sy name,property,value,received,source .
|
||||
@@ -2219,7 +2139,7 @@ Mount the specified filesystem.
|
||||
.El
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm unmount Ns | Ns Cm umount
|
||||
.Cm unmount
|
||||
.Op Fl f
|
||||
.Fl a | Ar filesystem Ns | Ns Ar mountpoint
|
||||
.Xc
|
||||
@@ -2305,26 +2225,6 @@ file system shared on the system.
|
||||
.El
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm bookmark
|
||||
.Ar snapshot
|
||||
.Ar bookmark
|
||||
.Xc
|
||||
.Pp
|
||||
Creates a bookmark of the given snapshot.
|
||||
Bookmarks mark the point in time
|
||||
when the snapshot was created, and can be used as the incremental source for
|
||||
a
|
||||
.Qq Nm Cm send
|
||||
command.
|
||||
.Pp
|
||||
This feature must be enabled to be used.
|
||||
See
|
||||
.Xr zpool-features 7
|
||||
for details on ZFS feature flags and the
|
||||
.Sy bookmark
|
||||
feature.
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm send
|
||||
.Op Fl DnPpRv
|
||||
.Op Fl i Ar snapshot | Fl I Ar snapshot
|
||||
@@ -2343,15 +2243,17 @@ a file or to a different system (for example, using
|
||||
By default, a full stream is generated.
|
||||
.Bl -tag -width indent
|
||||
.It Fl i Ar snapshot
|
||||
Generate an incremental stream from the first
|
||||
.Ar snapshot Pq the incremental source
|
||||
to the second
|
||||
.Ar snapshot Pq the incremental target .
|
||||
The incremental source can be specified as the last component of the
|
||||
snapshot name
|
||||
.Pq the Em @ No character and following
|
||||
and
|
||||
it is assumed to be from the same file system as the incremental target.
|
||||
Generate an incremental stream from the
|
||||
.Fl i Ar snapshot
|
||||
to the last
|
||||
.Ar snapshot .
|
||||
The incremental source (the
|
||||
.Fl i Ar snapshot )
|
||||
can be specified as the last component of the snapshot name (for example, the
|
||||
part after the
|
||||
.Sy @ ) ,
|
||||
and it is assumed to be from the same file system as the last
|
||||
.Ar snapshot .
|
||||
.Pp
|
||||
If the destination is a clone, the source may be the origin snapshot, which
|
||||
must be fully specified (for example,
|
||||
@@ -2359,16 +2261,15 @@ must be fully specified (for example,
|
||||
not just
|
||||
.Cm @origin ) .
|
||||
.It Fl I Ar snapshot
|
||||
Generate a stream package that sends all intermediary snapshots from the first
|
||||
.Ar snapshot
|
||||
to the second
|
||||
Generate a stream package that sends all intermediary snapshots from the
|
||||
.Fl I Ar snapshot
|
||||
to the last
|
||||
.Ar snapshot .
|
||||
For example,
|
||||
.Ic -I @a fs@d
|
||||
is similar to
|
||||
.Ic -i @a fs@b; -i @b fs@c; -i @c fs@d .
|
||||
The incremental
|
||||
source may be specified as with the
|
||||
The incremental source snapshot may be specified as with the
|
||||
.Fl i
|
||||
option.
|
||||
.It Fl R
|
||||
@@ -2421,42 +2322,13 @@ on future versions of
|
||||
.Tn ZFS .
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm send
|
||||
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
|
||||
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
|
||||
.Xc
|
||||
.Pp
|
||||
Generate a send stream, which may be of a filesystem, and may be
|
||||
incremental from a bookmark.
|
||||
If the destination is a filesystem or volume,
|
||||
the pool must be read-only, or the filesystem must not be mounted.
|
||||
When the
|
||||
stream generated from a filesystem or volume is received, the default snapshot
|
||||
name will be
|
||||
.Pq --head-- .
|
||||
.Bl -tag -width indent
|
||||
.It Fl i Ar snapshot Ns | Ns bookmark
|
||||
Generate an incremental send stream.
|
||||
The incremental source must be an earlier
|
||||
snapshot in the destination's history.
|
||||
It will commonly be an earlier
|
||||
snapshot in the destination's filesystem, in which case it can be
|
||||
specified as the last component of the name
|
||||
.Pq the Em # No or Em @ No character and following .
|
||||
.Pp
|
||||
If the incremental target is a clone, the incremental source can
|
||||
be the origin snapshot, or an earlier snapshot in the origin's filesystem,
|
||||
or the origin's origin, etc.
|
||||
.El
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm receive Ns | Ns Cm recv
|
||||
.Cm receive
|
||||
.Op Fl vnFu
|
||||
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
|
||||
.Xc
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm receive Ns | Ns Cm recv
|
||||
.Cm receive
|
||||
.Op Fl vnFu
|
||||
.Op Fl d | e
|
||||
.Ar filesystem
|
||||
@@ -2892,7 +2764,7 @@ option of
|
||||
.It \&P Ta event port (not supported on Fx )
|
||||
.El
|
||||
.It Fl H
|
||||
Give more parsable tab-separated output, without header lines and without
|
||||
Give more parseable tab-separated output, without header lines and without
|
||||
arrows.
|
||||
.It Fl t
|
||||
Display the path's inode change time as the first column of output.
|
||||
|
||||
@@ -18,13 +18,10 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||
* All rights reserved.
|
||||
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <libintl.h>
|
||||
@@ -73,7 +70,7 @@ uu_avl_pool_t *avl_pool;
|
||||
* Include snaps if they were requested or if this a zfs list where types
|
||||
* were not specified and the "listsnapshots" property is set on this pool.
|
||||
*/
|
||||
static boolean_t
|
||||
static int
|
||||
zfs_include_snapshots(zfs_handle_t *zhp, callback_data_t *cb)
|
||||
{
|
||||
zpool_handle_t *zph;
|
||||
@@ -93,9 +90,8 @@ static int
|
||||
zfs_callback(zfs_handle_t *zhp, void *data)
|
||||
{
|
||||
callback_data_t *cb = data;
|
||||
boolean_t dontclose = B_FALSE;
|
||||
boolean_t include_snaps = zfs_include_snapshots(zhp, cb);
|
||||
boolean_t include_bmarks = (cb->cb_types & ZFS_TYPE_BOOKMARK);
|
||||
int dontclose = 0;
|
||||
int include_snaps = zfs_include_snapshots(zhp, cb);
|
||||
|
||||
if ((zfs_get_type(zhp) & cb->cb_types) ||
|
||||
((zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) && include_snaps)) {
|
||||
@@ -113,15 +109,14 @@ zfs_callback(zfs_handle_t *zhp, void *data)
|
||||
cb->cb_props_table);
|
||||
|
||||
if (zfs_expand_proplist(zhp, cb->cb_proplist,
|
||||
(cb->cb_flags & ZFS_ITER_RECVD_PROPS),
|
||||
(cb->cb_flags & ZFS_ITER_LITERAL_PROPS))
|
||||
(cb->cb_flags & ZFS_ITER_RECVD_PROPS))
|
||||
!= 0) {
|
||||
free(node);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
uu_avl_insert(cb->cb_avl, node, idx);
|
||||
dontclose = B_TRUE;
|
||||
dontclose = 1;
|
||||
} else {
|
||||
free(node);
|
||||
}
|
||||
@@ -136,14 +131,11 @@ zfs_callback(zfs_handle_t *zhp, void *data)
|
||||
cb->cb_depth++;
|
||||
if (zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM)
|
||||
(void) zfs_iter_filesystems(zhp, zfs_callback, data);
|
||||
if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
|
||||
ZFS_TYPE_BOOKMARK)) == 0) && include_snaps)
|
||||
if ((zfs_get_type(zhp) != ZFS_TYPE_SNAPSHOT) && include_snaps) {
|
||||
(void) zfs_iter_snapshots(zhp,
|
||||
(cb->cb_flags & ZFS_ITER_SIMPLE) != 0, zfs_callback,
|
||||
data);
|
||||
if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
|
||||
ZFS_TYPE_BOOKMARK)) == 0) && include_bmarks)
|
||||
(void) zfs_iter_bookmarks(zhp, zfs_callback, data);
|
||||
}
|
||||
cb->cb_depth--;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,9 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef ZFS_ITER_H
|
||||
@@ -46,7 +44,6 @@ typedef struct zfs_sort_column {
|
||||
#define ZFS_ITER_DEPTH_LIMIT (1 << 3)
|
||||
#define ZFS_ITER_RECVD_PROPS (1 << 4)
|
||||
#define ZFS_ITER_SIMPLE (1 << 5)
|
||||
#define ZFS_ITER_LITERAL_PROPS (1 << 6)
|
||||
|
||||
int zfs_for_each(int, char **, int options, zfs_type_t,
|
||||
zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -20,8 +20,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -47,7 +46,6 @@
|
||||
#include <sys/zio_checksum.h>
|
||||
#include <sys/zio_compress.h>
|
||||
#include <sys/zfeature.h>
|
||||
#include <sys/dmu_tx.h>
|
||||
#undef ZFS_MAXNAMELEN
|
||||
#undef verify
|
||||
#include <libzfs.h>
|
||||
@@ -85,15 +83,10 @@ usage(void)
|
||||
|
||||
|
||||
static void
|
||||
fatal(spa_t *spa, void *tag, const char *fmt, ...)
|
||||
fatal(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (spa != NULL) {
|
||||
spa_close(spa, tag);
|
||||
(void) spa_export(g_pool, NULL, B_TRUE, B_FALSE);
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
(void) fprintf(stderr, "%s: ", cmdname);
|
||||
(void) vfprintf(stderr, fmt, ap);
|
||||
@@ -159,19 +152,18 @@ import_pool(const char *target, boolean_t readonly)
|
||||
g_importargs.poolname = g_pool;
|
||||
pools = zpool_search_import(g_zfs, &g_importargs);
|
||||
|
||||
if (nvlist_empty(pools)) {
|
||||
if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) {
|
||||
if (!g_importargs.can_be_active) {
|
||||
g_importargs.can_be_active = B_TRUE;
|
||||
if (zpool_search_import(g_zfs, &g_importargs) != NULL ||
|
||||
spa_open(target, &spa, FTAG) == 0) {
|
||||
fatal(spa, FTAG, "cannot import '%s': pool is "
|
||||
"active; run " "\"zpool export %s\" "
|
||||
"first\n", g_pool, g_pool);
|
||||
fatal("cannot import '%s': pool is active; run "
|
||||
"\"zpool export %s\" first\n",
|
||||
g_pool, g_pool);
|
||||
}
|
||||
}
|
||||
|
||||
fatal(NULL, FTAG, "cannot import '%s': no such pool "
|
||||
"available\n", g_pool);
|
||||
fatal("cannot import '%s': no such pool available\n", g_pool);
|
||||
}
|
||||
|
||||
elem = nvlist_next_nvpair(pools, NULL);
|
||||
@@ -192,8 +184,7 @@ import_pool(const char *target, boolean_t readonly)
|
||||
error = 0;
|
||||
|
||||
if (error)
|
||||
fatal(NULL, FTAG, "can't import '%s': %s", name,
|
||||
strerror(error));
|
||||
fatal("can't import '%s': %s", name, strerror(error));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -208,11 +199,10 @@ zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa)
|
||||
zfeature_checks_disable = B_FALSE;
|
||||
|
||||
if (err != 0)
|
||||
fatal(*spa, FTAG, "cannot open '%s': %s", target,
|
||||
strerror(err));
|
||||
fatal("cannot open '%s': %s", target, strerror(err));
|
||||
if (spa_version(*spa) < SPA_VERSION_FEATURES) {
|
||||
fatal(*spa, FTAG, "'%s' has version %d, features not enabled",
|
||||
target, (int)spa_version(*spa));
|
||||
fatal("'%s' has version %d, features not enabled", target,
|
||||
(int)spa_version(*spa));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,25 +267,18 @@ zhack_do_feature_stat(int argc, char **argv)
|
||||
dump_obj(os, spa->spa_feat_for_read_obj, "for_read");
|
||||
dump_obj(os, spa->spa_feat_for_write_obj, "for_write");
|
||||
dump_obj(os, spa->spa_feat_desc_obj, "descriptions");
|
||||
if (spa_feature_is_active(spa, SPA_FEATURE_ENABLED_TXG)) {
|
||||
dump_obj(os, spa->spa_feat_enabled_txg_obj, "enabled_txg");
|
||||
}
|
||||
dump_mos(spa);
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_feature_enable_sync(void *arg, dmu_tx_t *tx)
|
||||
feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||
{
|
||||
spa_t *spa = dmu_tx_pool(tx)->dp_spa;
|
||||
zfeature_info_t *feature = arg;
|
||||
spa_t *spa = arg1;
|
||||
zfeature_info_t *feature = arg2;
|
||||
|
||||
feature_enable_sync(spa, feature, tx);
|
||||
|
||||
spa_history_log_internal(spa, "zhack enable feature", tx,
|
||||
"name=%s can_readonly=%u",
|
||||
feature->fi_guid, feature->fi_can_readonly);
|
||||
spa_feature_enable(spa, feature, tx);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -306,7 +289,7 @@ zhack_do_feature_enable(int argc, char **argv)
|
||||
spa_t *spa;
|
||||
objset_t *mos;
|
||||
zfeature_info_t feature;
|
||||
spa_feature_t nodeps[] = { SPA_FEATURE_NONE };
|
||||
zfeature_info_t *nodeps[] = { NULL };
|
||||
|
||||
/*
|
||||
* Features are not added to the pool's label until their refcounts
|
||||
@@ -316,9 +299,7 @@ zhack_do_feature_enable(int argc, char **argv)
|
||||
feature.fi_uname = "zhack";
|
||||
feature.fi_mos = B_FALSE;
|
||||
feature.fi_can_readonly = B_FALSE;
|
||||
feature.fi_activate_on_enable = B_FALSE;
|
||||
feature.fi_depends = nodeps;
|
||||
feature.fi_feature = SPA_FEATURE_NONE;
|
||||
|
||||
optind = 1;
|
||||
while ((c = getopt(argc, argv, "rmd:")) != -1) {
|
||||
@@ -350,19 +331,18 @@ zhack_do_feature_enable(int argc, char **argv)
|
||||
feature.fi_guid = argv[1];
|
||||
|
||||
if (!zfeature_is_valid_guid(feature.fi_guid))
|
||||
fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid);
|
||||
fatal("invalid feature guid: %s", feature.fi_guid);
|
||||
|
||||
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||
mos = spa->spa_meta_objset;
|
||||
|
||||
if (zfeature_is_supported(feature.fi_guid))
|
||||
fatal(spa, FTAG, "'%s' is a real feature, will not enable");
|
||||
if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
|
||||
fatal("'%s' is a real feature, will not enable");
|
||||
if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
|
||||
fatal(spa, FTAG, "feature already enabled: %s",
|
||||
feature.fi_guid);
|
||||
fatal("feature already enabled: %s", feature.fi_guid);
|
||||
|
||||
VERIFY0(dsl_sync_task(spa_name(spa), NULL,
|
||||
zhack_feature_enable_sync, &feature, 5));
|
||||
VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
|
||||
feature_enable_sync, spa, &feature, 5));
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
|
||||
@@ -370,29 +350,21 @@ zhack_do_feature_enable(int argc, char **argv)
|
||||
}
|
||||
|
||||
static void
|
||||
feature_incr_sync(void *arg, dmu_tx_t *tx)
|
||||
feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||
{
|
||||
spa_t *spa = dmu_tx_pool(tx)->dp_spa;
|
||||
zfeature_info_t *feature = arg;
|
||||
uint64_t refcount;
|
||||
spa_t *spa = arg1;
|
||||
zfeature_info_t *feature = arg2;
|
||||
|
||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||
feature_sync(spa, feature, refcount + 1, tx);
|
||||
spa_history_log_internal(spa, "zhack feature incr", tx,
|
||||
"name=%s", feature->fi_guid);
|
||||
spa_feature_incr(spa, feature, tx);
|
||||
}
|
||||
|
||||
static void
|
||||
feature_decr_sync(void *arg, dmu_tx_t *tx)
|
||||
feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||
{
|
||||
spa_t *spa = dmu_tx_pool(tx)->dp_spa;
|
||||
zfeature_info_t *feature = arg;
|
||||
uint64_t refcount;
|
||||
spa_t *spa = arg1;
|
||||
zfeature_info_t *feature = arg2;
|
||||
|
||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||
feature_sync(spa, feature, refcount - 1, tx);
|
||||
spa_history_log_internal(spa, "zhack feature decr", tx,
|
||||
"name=%s", feature->fi_guid);
|
||||
spa_feature_decr(spa, feature, tx);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -404,7 +376,7 @@ zhack_do_feature_ref(int argc, char **argv)
|
||||
spa_t *spa;
|
||||
objset_t *mos;
|
||||
zfeature_info_t feature;
|
||||
spa_feature_t nodeps[] = { SPA_FEATURE_NONE };
|
||||
zfeature_info_t *nodeps[] = { NULL };
|
||||
|
||||
/*
|
||||
* fi_desc does not matter here because it was written to disk
|
||||
@@ -416,7 +388,6 @@ zhack_do_feature_ref(int argc, char **argv)
|
||||
feature.fi_mos = B_FALSE;
|
||||
feature.fi_desc = NULL;
|
||||
feature.fi_depends = nodeps;
|
||||
feature.fi_feature = SPA_FEATURE_NONE;
|
||||
|
||||
optind = 1;
|
||||
while ((c = getopt(argc, argv, "md")) != -1) {
|
||||
@@ -443,15 +414,13 @@ zhack_do_feature_ref(int argc, char **argv)
|
||||
feature.fi_guid = argv[1];
|
||||
|
||||
if (!zfeature_is_valid_guid(feature.fi_guid))
|
||||
fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid);
|
||||
fatal("invalid feature guid: %s", feature.fi_guid);
|
||||
|
||||
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||
mos = spa->spa_meta_objset;
|
||||
|
||||
if (zfeature_is_supported(feature.fi_guid)) {
|
||||
fatal(spa, FTAG,
|
||||
"'%s' is a real feature, will not change refcount");
|
||||
}
|
||||
if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
|
||||
fatal("'%s' is a real feature, will not change refcount");
|
||||
|
||||
if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,
|
||||
feature.fi_guid)) {
|
||||
@@ -460,20 +429,14 @@ zhack_do_feature_ref(int argc, char **argv)
|
||||
feature.fi_guid)) {
|
||||
feature.fi_can_readonly = B_TRUE;
|
||||
} else {
|
||||
fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid);
|
||||
fatal("feature is not enabled: %s", feature.fi_guid);
|
||||
}
|
||||
|
||||
if (decr) {
|
||||
uint64_t count;
|
||||
if (feature_get_refcount_from_disk(spa, &feature,
|
||||
&count) == 0 && count != 0) {
|
||||
fatal(spa, FTAG, "feature refcount already 0: %s",
|
||||
feature.fi_guid);
|
||||
}
|
||||
}
|
||||
if (decr && !spa_feature_is_active(spa, &feature))
|
||||
fatal("feature refcount already 0: %s", feature.fi_guid);
|
||||
|
||||
VERIFY0(dsl_sync_task(spa_name(spa), NULL,
|
||||
decr ? feature_decr_sync : feature_incr_sync, &feature, 5));
|
||||
VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
|
||||
decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5));
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
}
|
||||
@@ -558,8 +521,8 @@ main(int argc, char **argv)
|
||||
usage();
|
||||
}
|
||||
|
||||
if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) {
|
||||
fatal(NULL, FTAG, "pool export failed; "
|
||||
if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) {
|
||||
fatal("pool export failed; "
|
||||
"changes may not be committed to disk\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,6 @@
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include <libzfs.h>
|
||||
#include <libzfs_compat.h>
|
||||
|
||||
#undef verify /* both libzfs.h and zfs_context.h want to define this */
|
||||
|
||||
|
||||
@@ -19,11 +19,10 @@
|
||||
.\"
|
||||
.\" Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
|
||||
.\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 2, 2014
|
||||
.Dd February 8, 2013
|
||||
.Dt ZPOOL-FEATURES 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -222,163 +221,14 @@ command. Please note that doing so will
|
||||
immediately activate the
|
||||
.Sy lz4_compress
|
||||
feature on the underlying
|
||||
pool
|
||||
.Pq even before any data is written ,
|
||||
and the feature will not be
|
||||
deactivated.
|
||||
Since this feature is not read-only compatible, this
|
||||
operation will render the pool unimportable on systems without support
|
||||
for the
|
||||
pool (even before any data is written). Since this feature is not
|
||||
read-only compatible, this operation will render the pool unimportable
|
||||
on systems without support for the
|
||||
.Sy lz4_compress
|
||||
feature.
|
||||
Booting off of
|
||||
feature. At the
|
||||
moment, this operation cannot be reversed. Booting off of
|
||||
.Sy lz4
|
||||
-compressed root pools is supported.
|
||||
.It Sy multi_vdev_crash_dump
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump"
|
||||
.It GUID Ta com.joyent:multi_vdev_crash_dump
|
||||
.It READ\-ONLY COMPATIBLE Ta no
|
||||
.It DEPENDENCIES Ta none
|
||||
.El
|
||||
.Pp
|
||||
This feature allows a dump device to be configured with a pool comprised
|
||||
of multiple vdevs.
|
||||
Those vdevs may be arranged in any mirrored or raidz
|
||||
configuration.
|
||||
.\" TODO: this is not yet supported on FreeBSD.
|
||||
.\" .Pp
|
||||
.\" When the
|
||||
.\" .Sy multi_vdev_crash_dump
|
||||
.\" feature is set to
|
||||
.\" .Sy enabled ,
|
||||
.\" the administrator can use the
|
||||
.\" .Xr dumpon 8
|
||||
.\" command to configure a
|
||||
.\" dump device on a pool comprised of multiple vdevs.
|
||||
.It Sy spacemap_histogram
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram"
|
||||
.It GUID Ta com.delphix:spacemap_histogram
|
||||
.It READ\-ONLY COMPATIBLE Ta yes
|
||||
.It DEPENDENCIES Ta none
|
||||
.El
|
||||
.Pp
|
||||
This features allows ZFS to maintain more information about how free space
|
||||
is organized within the pool. If this feature is
|
||||
.Sy enabled ,
|
||||
ZFS will
|
||||
set this feature to
|
||||
.Sy active
|
||||
when a new space map object is created or
|
||||
an existing space map is upgraded to the new format.
|
||||
Once the feature is
|
||||
.Sy active ,
|
||||
it will remain in that state until the pool is destroyed.
|
||||
.It Sy extensible_dataset
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:extensible_dataset"
|
||||
.It GUID Ta com.delphix:extensible_dataset
|
||||
.It READ\-ONLY COMPATIBLE Ta no
|
||||
.It DEPENDENCIES Ta none
|
||||
.El
|
||||
.Pp
|
||||
This feature allows more flexible use of internal ZFS data structures,
|
||||
and exists for other features to depend on.
|
||||
.Pp
|
||||
This feature will be
|
||||
.Sy active
|
||||
when the first dependent feature uses it,
|
||||
and will be returned to the
|
||||
.Sy enabled
|
||||
state when all datasets that use
|
||||
this feature are destroyed.
|
||||
.It Sy bookmarks
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:bookmarks"
|
||||
.It GUID Ta com.delphix:bookmarks
|
||||
.It READ\-ONLY COMPATIBLE Ta yes
|
||||
.It DEPENDENCIES Ta extensible_dataset
|
||||
.El
|
||||
.Pp
|
||||
This feature enables use of the
|
||||
.Nm zfs
|
||||
.Cm bookmark
|
||||
subcommand.
|
||||
.Pp
|
||||
This feature is
|
||||
.Sy active
|
||||
while any bookmarks exist in the pool.
|
||||
All bookmarks in the pool can be listed by running
|
||||
.Nm zfs
|
||||
.Cm list
|
||||
.Fl t No bookmark Fl r Ar poolname .
|
||||
.It Sy enabled_txg
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:enabled_txg"
|
||||
.It GUID Ta com.delphix:enabled_txg
|
||||
.It READ\-ONLY COMPATIBLE Ta yes
|
||||
.It DEPENDENCIES Ta none
|
||||
.El
|
||||
.Pp
|
||||
Once this feature is enabled ZFS records the transaction group number
|
||||
in which new features are enabled. This has no user-visible impact,
|
||||
but other features may depend on this feature.
|
||||
.Pp
|
||||
This feature becomes
|
||||
.Sy active
|
||||
as soon as it is enabled and will
|
||||
never return to being
|
||||
.Sy enabled .
|
||||
.It Sy hole_birth
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:hole_birth"
|
||||
.It GUID Ta com.delphix:hole_birth
|
||||
.It READ\-ONLY COMPATIBLE Ta no
|
||||
.It DEPENDENCIES Ta enabled_txg
|
||||
.El
|
||||
.Pp
|
||||
This feature improves performance of incremental sends
|
||||
.Pq Dq zfs send -i
|
||||
and receives for objects with many holes.
|
||||
The most common case of
|
||||
hole-filled objects is zvols.
|
||||
.Pp
|
||||
An incremental send stream from snapshot
|
||||
.Sy A
|
||||
to snapshot
|
||||
.Sy B
|
||||
contains information about every block that changed between
|
||||
.Sy A
|
||||
and
|
||||
.Sy B .
|
||||
Blocks which did not change between those snapshots can be
|
||||
identified and omitted from the stream using a piece of metadata called
|
||||
the 'block birth time', but birth times are not recorded for holes
|
||||
.Pq blocks filled only with zeroes .
|
||||
Since holes created after
|
||||
.Sy A
|
||||
cannot be
|
||||
distinguished from holes created before
|
||||
.Sy A ,
|
||||
information about every
|
||||
hole in the entire filesystem or zvol is included in the send stream.
|
||||
.Pp
|
||||
For workloads where holes are rare this is not a problem.
|
||||
However, when
|
||||
incrementally replicating filesystems or zvols with many holes
|
||||
.Pq for example a zvol formatted with another filesystem
|
||||
a lot of time will
|
||||
be spent sending and receiving unnecessary information about holes that
|
||||
already exist on the receiving side.
|
||||
.Pp
|
||||
Once the
|
||||
.Sy hole_birth
|
||||
feature has been enabled the block birth times
|
||||
of all new holes will be recorded.
|
||||
Incremental sends between snapshots
|
||||
created after this feature is enabled will use this new metadata to avoid
|
||||
sending information about holes that already exist on the receiving side.
|
||||
.Pp
|
||||
This feature becomes
|
||||
.Sy active
|
||||
as soon as it is enabled and will
|
||||
never return to being
|
||||
.Sy enabled .
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr zpool 8
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 31, 2013
|
||||
.Dd March 14, 2013
|
||||
.Dt ZPOOL 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -141,9 +141,6 @@
|
||||
.Cm remove
|
||||
.Ar pool device ...
|
||||
.Nm
|
||||
.Cm reopen
|
||||
.Ar pool
|
||||
.Nm
|
||||
.Cm replace
|
||||
.Op Fl f
|
||||
.Ar pool device
|
||||
@@ -1434,13 +1431,6 @@ command. Non-redundant and
|
||||
devices cannot be removed from a pool.
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm reopen
|
||||
.Ar pool
|
||||
.Xc
|
||||
.Pp
|
||||
Reopen all the vdevs associated with the pool.
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm replace
|
||||
.Op Fl f
|
||||
.Ar pool device
|
||||
@@ -1956,9 +1946,3 @@ The
|
||||
.Xr mdoc 7
|
||||
implementation of this manual page was initially written by
|
||||
.An Martin Matuska Aq [email protected] .
|
||||
.Sh CAVEATS
|
||||
The
|
||||
.Cm spare
|
||||
feature requires a utility to detect zpool degradation and initiate
|
||||
disk replacement within the zpool. FreeBSD does not provide such a
|
||||
utility at this time.
|
||||
@@ -22,7 +22,7 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
|
||||
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
*/
|
||||
@@ -192,9 +192,9 @@ static zpool_command_t command_table[] = {
|
||||
|
||||
#define NCOMMAND (sizeof (command_table) / sizeof (command_table[0]))
|
||||
|
||||
static zpool_command_t *current_command;
|
||||
zpool_command_t *current_command;
|
||||
static char history_str[HIS_MAX_RECORD_LEN];
|
||||
static boolean_t log_history = B_TRUE;
|
||||
|
||||
static uint_t timestamp_fmt = NODATE;
|
||||
|
||||
static const char *
|
||||
@@ -247,7 +247,7 @@ get_usage(zpool_help_t idx) {
|
||||
case HELP_REMOVE:
|
||||
return (gettext("\tremove <pool> <device> ...\n"));
|
||||
case HELP_REOPEN:
|
||||
return (gettext("\treopen <pool>\n"));
|
||||
return (""); /* Undocumented command */
|
||||
case HELP_SCRUB:
|
||||
return (gettext("\tscrub [-s] <pool> ...\n"));
|
||||
case HELP_STATUS:
|
||||
@@ -804,7 +804,6 @@ zpool_do_create(int argc, char **argv)
|
||||
goto errout;
|
||||
break;
|
||||
case 'm':
|
||||
/* Equivalent to -O mountpoint=optarg */
|
||||
mountpoint = optarg;
|
||||
break;
|
||||
case 'o':
|
||||
@@ -843,18 +842,8 @@ zpool_do_create(int argc, char **argv)
|
||||
*propval = '\0';
|
||||
propval++;
|
||||
|
||||
/*
|
||||
* Mountpoints are checked and then added later.
|
||||
* Uniquely among properties, they can be specified
|
||||
* more than once, to avoid conflict with -m.
|
||||
*/
|
||||
if (0 == strcmp(optarg,
|
||||
zfs_prop_to_name(ZFS_PROP_MOUNTPOINT))) {
|
||||
mountpoint = propval;
|
||||
} else if (add_prop_list(optarg, propval, &fsprops,
|
||||
B_FALSE)) {
|
||||
if (add_prop_list(optarg, propval, &fsprops, B_FALSE))
|
||||
goto errout;
|
||||
}
|
||||
break;
|
||||
case ':':
|
||||
(void) fprintf(stderr, gettext("missing argument for "
|
||||
@@ -981,18 +970,6 @@ zpool_do_create(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that the mountpoint's validity has been checked, ensure that
|
||||
* the property is set appropriately prior to creating the pool.
|
||||
*/
|
||||
if (mountpoint != NULL) {
|
||||
ret = add_prop_list(zfs_prop_to_name(ZFS_PROP_MOUNTPOINT),
|
||||
mountpoint, &fsprops, B_FALSE);
|
||||
if (ret != 0)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
ret = 1;
|
||||
if (dryrun) {
|
||||
/*
|
||||
* For a dry run invocation, print out a basic message and run
|
||||
@@ -1012,7 +989,7 @@ zpool_do_create(int argc, char **argv)
|
||||
* Hand off to libzfs.
|
||||
*/
|
||||
if (enable_all_pool_feat) {
|
||||
spa_feature_t i;
|
||||
int i;
|
||||
for (i = 0; i < SPA_FEATURES; i++) {
|
||||
char propname[MAXPATHLEN];
|
||||
zfeature_info_t *feat = &spa_feature_table[i];
|
||||
@@ -1027,19 +1004,21 @@ zpool_do_create(int argc, char **argv)
|
||||
if (nvlist_exists(props, propname))
|
||||
continue;
|
||||
|
||||
ret = add_prop_list(propname,
|
||||
ZFS_FEATURE_ENABLED, &props, B_TRUE);
|
||||
if (ret != 0)
|
||||
if (add_prop_list(propname, ZFS_FEATURE_ENABLED,
|
||||
&props, B_TRUE) != 0)
|
||||
goto errout;
|
||||
}
|
||||
}
|
||||
|
||||
ret = 1;
|
||||
if (zpool_create(g_zfs, poolname,
|
||||
nvroot, props, fsprops) == 0) {
|
||||
zfs_handle_t *pool = zfs_open(g_zfs, poolname,
|
||||
ZFS_TYPE_FILESYSTEM);
|
||||
if (pool != NULL) {
|
||||
if (mountpoint != NULL)
|
||||
verify(zfs_prop_set(pool,
|
||||
zfs_prop_to_name(
|
||||
ZFS_PROP_MOUNTPOINT),
|
||||
mountpoint) == 0);
|
||||
if (zfs_mount(pool, NULL, 0) == 0)
|
||||
ret = zfs_shareall(pool);
|
||||
zfs_close(pool);
|
||||
@@ -1123,10 +1102,7 @@ zpool_do_destroy(int argc, char **argv)
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* The history must be logged as part of the export */
|
||||
log_history = B_FALSE;
|
||||
|
||||
ret = (zpool_destroy(zhp, history_str) != 0);
|
||||
ret = (zpool_destroy(zhp) != 0);
|
||||
|
||||
zpool_close(zhp);
|
||||
|
||||
@@ -1190,13 +1166,10 @@ zpool_do_export(int argc, char **argv)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* The history must be logged as part of the export */
|
||||
log_history = B_FALSE;
|
||||
|
||||
if (hardforce) {
|
||||
if (zpool_export_force(zhp, history_str) != 0)
|
||||
if (zpool_export_force(zhp) != 0)
|
||||
ret = 1;
|
||||
} else if (zpool_export(zhp, force, history_str) != 0) {
|
||||
} else if (zpool_export(zhp, force) != 0) {
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
@@ -1304,13 +1277,12 @@ print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
||||
int namewidth, int depth, boolean_t isspare)
|
||||
{
|
||||
nvlist_t **child;
|
||||
uint_t c, vsc, children;
|
||||
uint_t c, children;
|
||||
pool_scan_stat_t *ps = NULL;
|
||||
vdev_stat_t *vs;
|
||||
char rbuf[6], wbuf[6], cbuf[6];
|
||||
char *vname;
|
||||
uint64_t notpresent;
|
||||
uint64_t ashift;
|
||||
spare_cbdata_t cb;
|
||||
const char *state;
|
||||
|
||||
@@ -1319,7 +1291,7 @@ print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
||||
children = 0;
|
||||
|
||||
verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
|
||||
(uint64_t **)&vs, &vsc) == 0);
|
||||
(uint64_t **)&vs, &c) == 0);
|
||||
|
||||
state = zpool_state_to_name(vs->vs_state, vs->vs_aux);
|
||||
if (isspare) {
|
||||
@@ -1373,10 +1345,6 @@ print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
||||
(void) printf(gettext("unsupported feature(s)"));
|
||||
break;
|
||||
|
||||
case VDEV_AUX_ASHIFT_TOO_BIG:
|
||||
(void) printf(gettext("unsupported minimum blocksize"));
|
||||
break;
|
||||
|
||||
case VDEV_AUX_SPARED:
|
||||
verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
|
||||
&cb.cb_guid) == 0);
|
||||
@@ -1419,12 +1387,6 @@ print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
||||
(void) printf(gettext("corrupted data"));
|
||||
break;
|
||||
}
|
||||
} else if (children == 0 && !isspare &&
|
||||
VDEV_STAT_VALID(vs_physical_ashift, vsc) &&
|
||||
vs->vs_configured_ashift < vs->vs_physical_ashift) {
|
||||
(void) printf(
|
||||
gettext(" block size: %dB configured, %dB native"),
|
||||
1 << vs->vs_configured_ashift, 1 << vs->vs_physical_ashift);
|
||||
}
|
||||
|
||||
(void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS,
|
||||
@@ -3720,37 +3682,22 @@ zpool_do_reguid(int argc, char **argv)
|
||||
* zpool reopen <pool>
|
||||
*
|
||||
* Reopen the pool so that the kernel can update the sizes of all vdevs.
|
||||
*
|
||||
* NOTE: This command is currently undocumented. If the command is ever
|
||||
* exposed then the appropriate usage() messages will need to be made.
|
||||
*/
|
||||
int
|
||||
zpool_do_reopen(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int ret = 0;
|
||||
zpool_handle_t *zhp;
|
||||
char *pool;
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt(argc, argv, "")) != -1) {
|
||||
switch (c) {
|
||||
case '?':
|
||||
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||
optopt);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
if (argc < 1) {
|
||||
(void) fprintf(stderr, gettext("missing pool name\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
(void) fprintf(stderr, gettext("too many arguments\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
if (argc != 1)
|
||||
return (2);
|
||||
|
||||
pool = argv[0];
|
||||
if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL)
|
||||
@@ -4303,15 +4250,6 @@ status_callback(zpool_handle_t *zhp, void *data)
|
||||
"'zpool clear'.\n"));
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_NON_NATIVE_ASHIFT:
|
||||
(void) printf(gettext("status: One or more devices are "
|
||||
"configured to use a non-native block size.\n"
|
||||
"\tExpect reduced performance.\n"));
|
||||
(void) printf(gettext("action: Replace affected devices with "
|
||||
"devices that support the\n\tconfigured block size, or "
|
||||
"migrate data to a properly configured\n\tpool.\n"));
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* The remaining errors can't actually be generated, yet.
|
||||
@@ -4634,14 +4572,6 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
|
||||
if (count > 0) {
|
||||
cbp->cb_first = B_FALSE;
|
||||
printnl = B_TRUE;
|
||||
/*
|
||||
* If they did "zpool upgrade -a", then we could
|
||||
* be doing ioctls to different pools. We need
|
||||
* to log this history once to each pool, and bypass
|
||||
* the normal history logging that happens in main().
|
||||
*/
|
||||
(void) zpool_log_history(g_zfs, history_str);
|
||||
log_history = B_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5003,8 +4933,8 @@ zpool_do_upgrade(int argc, char **argv)
|
||||
|
||||
typedef struct hist_cbdata {
|
||||
boolean_t first;
|
||||
boolean_t longfmt;
|
||||
boolean_t internal;
|
||||
int longfmt;
|
||||
int internal;
|
||||
} hist_cbdata_t;
|
||||
|
||||
/*
|
||||
@@ -5016,8 +4946,21 @@ get_history_one(zpool_handle_t *zhp, void *data)
|
||||
nvlist_t *nvhis;
|
||||
nvlist_t **records;
|
||||
uint_t numrecords;
|
||||
char *cmdstr;
|
||||
char *pathstr;
|
||||
uint64_t dst_time;
|
||||
time_t tsec;
|
||||
struct tm t;
|
||||
char tbuf[30];
|
||||
int ret, i;
|
||||
uint64_t who;
|
||||
struct passwd *pwd;
|
||||
char *hostname;
|
||||
char *zonename;
|
||||
char internalstr[MAXPATHLEN];
|
||||
hist_cbdata_t *cb = (hist_cbdata_t *)data;
|
||||
uint64_t txg;
|
||||
uint64_t ievent;
|
||||
|
||||
cb->first = B_FALSE;
|
||||
|
||||
@@ -5029,94 +4972,64 @@ get_history_one(zpool_handle_t *zhp, void *data)
|
||||
verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD,
|
||||
&records, &numrecords) == 0);
|
||||
for (i = 0; i < numrecords; i++) {
|
||||
nvlist_t *rec = records[i];
|
||||
char tbuf[30] = "";
|
||||
if (nvlist_lookup_uint64(records[i], ZPOOL_HIST_TIME,
|
||||
&dst_time) != 0)
|
||||
continue;
|
||||
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_TIME)) {
|
||||
time_t tsec;
|
||||
struct tm t;
|
||||
/* is it an internal event or a standard event? */
|
||||
if (nvlist_lookup_string(records[i], ZPOOL_HIST_CMD,
|
||||
&cmdstr) != 0) {
|
||||
if (cb->internal == 0)
|
||||
continue;
|
||||
|
||||
tsec = fnvlist_lookup_uint64(records[i],
|
||||
ZPOOL_HIST_TIME);
|
||||
(void) localtime_r(&tsec, &t);
|
||||
(void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
|
||||
}
|
||||
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_CMD)) {
|
||||
(void) printf("%s %s", tbuf,
|
||||
fnvlist_lookup_string(rec, ZPOOL_HIST_CMD));
|
||||
} else if (nvlist_exists(rec, ZPOOL_HIST_INT_EVENT)) {
|
||||
int ievent =
|
||||
fnvlist_lookup_uint64(rec, ZPOOL_HIST_INT_EVENT);
|
||||
if (!cb->internal)
|
||||
continue;
|
||||
if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) {
|
||||
(void) printf("%s unrecognized record:\n",
|
||||
tbuf);
|
||||
dump_nvlist(rec, 4);
|
||||
continue;
|
||||
}
|
||||
(void) printf("%s [internal %s txg:%lld] %s", tbuf,
|
||||
zfs_history_event_names[ievent],
|
||||
fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG),
|
||||
fnvlist_lookup_string(rec, ZPOOL_HIST_INT_STR));
|
||||
} else if (nvlist_exists(rec, ZPOOL_HIST_INT_NAME)) {
|
||||
if (!cb->internal)
|
||||
continue;
|
||||
(void) printf("%s [txg:%lld] %s", tbuf,
|
||||
fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG),
|
||||
fnvlist_lookup_string(rec, ZPOOL_HIST_INT_NAME));
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_DSNAME)) {
|
||||
(void) printf(" %s (%llu)",
|
||||
fnvlist_lookup_string(rec,
|
||||
ZPOOL_HIST_DSNAME),
|
||||
fnvlist_lookup_uint64(rec,
|
||||
ZPOOL_HIST_DSID));
|
||||
}
|
||||
(void) printf(" %s", fnvlist_lookup_string(rec,
|
||||
ZPOOL_HIST_INT_STR));
|
||||
} else if (nvlist_exists(rec, ZPOOL_HIST_IOCTL)) {
|
||||
if (!cb->internal)
|
||||
continue;
|
||||
(void) printf("%s ioctl %s\n", tbuf,
|
||||
fnvlist_lookup_string(rec, ZPOOL_HIST_IOCTL));
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_INPUT_NVL)) {
|
||||
(void) printf(" input:\n");
|
||||
dump_nvlist(fnvlist_lookup_nvlist(rec,
|
||||
ZPOOL_HIST_INPUT_NVL), 8);
|
||||
}
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_OUTPUT_NVL)) {
|
||||
(void) printf(" output:\n");
|
||||
dump_nvlist(fnvlist_lookup_nvlist(rec,
|
||||
ZPOOL_HIST_OUTPUT_NVL), 8);
|
||||
}
|
||||
} else {
|
||||
if (!cb->internal)
|
||||
continue;
|
||||
(void) printf("%s unrecognized record:\n", tbuf);
|
||||
dump_nvlist(rec, 4);
|
||||
if (nvlist_lookup_uint64(records[i],
|
||||
ZPOOL_HIST_INT_EVENT, &ievent) != 0)
|
||||
continue;
|
||||
verify(nvlist_lookup_uint64(records[i],
|
||||
ZPOOL_HIST_TXG, &txg) == 0);
|
||||
verify(nvlist_lookup_string(records[i],
|
||||
ZPOOL_HIST_INT_STR, &pathstr) == 0);
|
||||
if (ievent >= LOG_END)
|
||||
continue;
|
||||
(void) snprintf(internalstr,
|
||||
sizeof (internalstr),
|
||||
"[internal %s txg:%lld] %s",
|
||||
zfs_history_event_names[ievent], txg,
|
||||
pathstr);
|
||||
cmdstr = internalstr;
|
||||
}
|
||||
tsec = dst_time;
|
||||
(void) localtime_r(&tsec, &t);
|
||||
(void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
|
||||
(void) printf("%s %s", tbuf, cmdstr);
|
||||
|
||||
if (!cb->longfmt) {
|
||||
(void) printf("\n");
|
||||
continue;
|
||||
}
|
||||
(void) printf(" [");
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_WHO)) {
|
||||
uid_t who = fnvlist_lookup_uint64(rec, ZPOOL_HIST_WHO);
|
||||
struct passwd *pwd = getpwuid(who);
|
||||
(void) printf("user %d ", (int)who);
|
||||
if (pwd != NULL)
|
||||
(void) printf("(%s) ", pwd->pw_name);
|
||||
if (nvlist_lookup_uint64(records[i],
|
||||
ZPOOL_HIST_WHO, &who) == 0) {
|
||||
pwd = getpwuid((uid_t)who);
|
||||
if (pwd)
|
||||
(void) printf("user %s on",
|
||||
pwd->pw_name);
|
||||
else
|
||||
(void) printf("user %d on",
|
||||
(int)who);
|
||||
} else {
|
||||
(void) printf(gettext("no info]\n"));
|
||||
continue;
|
||||
}
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_HOST)) {
|
||||
(void) printf("on %s",
|
||||
fnvlist_lookup_string(rec, ZPOOL_HIST_HOST));
|
||||
if (nvlist_lookup_string(records[i],
|
||||
ZPOOL_HIST_HOST, &hostname) == 0) {
|
||||
(void) printf(" %s", hostname);
|
||||
}
|
||||
if (nvlist_exists(rec, ZPOOL_HIST_ZONE)) {
|
||||
(void) printf(":%s",
|
||||
fnvlist_lookup_string(rec, ZPOOL_HIST_ZONE));
|
||||
if (nvlist_lookup_string(records[i],
|
||||
ZPOOL_HIST_ZONE, &zonename) == 0) {
|
||||
(void) printf(":%s", zonename);
|
||||
}
|
||||
|
||||
(void) printf("]");
|
||||
(void) printf("\n");
|
||||
}
|
||||
@@ -5131,6 +5044,8 @@ get_history_one(zpool_handle_t *zhp, void *data)
|
||||
*
|
||||
* Displays the history of commands that modified pools.
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
zpool_do_history(int argc, char **argv)
|
||||
{
|
||||
@@ -5143,10 +5058,10 @@ zpool_do_history(int argc, char **argv)
|
||||
while ((c = getopt(argc, argv, "li")) != -1) {
|
||||
switch (c) {
|
||||
case 'l':
|
||||
cbdata.longfmt = B_TRUE;
|
||||
cbdata.longfmt = 1;
|
||||
break;
|
||||
case 'i':
|
||||
cbdata.internal = B_TRUE;
|
||||
cbdata.internal = 1;
|
||||
break;
|
||||
case '?':
|
||||
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||
@@ -5371,7 +5286,8 @@ main(int argc, char **argv)
|
||||
if (strcmp(cmdname, "-?") == 0)
|
||||
usage(B_TRUE);
|
||||
|
||||
zfs_save_arguments(argc, argv, history_str, sizeof (history_str));
|
||||
zpool_set_history_str("zpool", argc, argv, history_str);
|
||||
verify(zpool_stage_history(g_zfs, history_str) == 0);
|
||||
|
||||
/*
|
||||
* Run the appropriate command.
|
||||
@@ -5388,18 +5304,16 @@ main(int argc, char **argv)
|
||||
* 'freeze' is a vile debugging abomination, so we treat
|
||||
* it as such.
|
||||
*/
|
||||
zfs_cmd_t zc = { 0 };
|
||||
(void) strlcpy(zc.zc_name, argv[2], sizeof (zc.zc_name));
|
||||
return (!!zfs_ioctl(g_zfs, ZFS_IOC_POOL_FREEZE, &zc));
|
||||
char buf[16384];
|
||||
int fd = open(ZFS_DEV, O_RDWR);
|
||||
(void) strcpy((void *)buf, argv[2]);
|
||||
return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf));
|
||||
} else {
|
||||
(void) fprintf(stderr, gettext("unrecognized "
|
||||
"command '%s'\n"), cmdname);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
if (ret == 0 && log_history)
|
||||
(void) zpool_log_history(g_zfs, history_str);
|
||||
|
||||
libzfs_fini(g_zfs);
|
||||
|
||||
/*
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -105,12 +104,10 @@
|
||||
#include <sys/metaslab_impl.h>
|
||||
#include <sys/dsl_prop.h>
|
||||
#include <sys/dsl_dataset.h>
|
||||
#include <sys/dsl_destroy.h>
|
||||
#include <sys/dsl_scan.h>
|
||||
#include <sys/zio_checksum.h>
|
||||
#include <sys/refcount.h>
|
||||
#include <sys/zfeature.h>
|
||||
#include <sys/dsl_userhold.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio_ext.h>
|
||||
#include <stdlib.h>
|
||||
@@ -124,8 +121,8 @@
|
||||
#include <sys/fs/zfs.h>
|
||||
#include <libnvpair.h>
|
||||
|
||||
static int ztest_fd_data = -1;
|
||||
static int ztest_fd_rand = -1;
|
||||
#define ZTEST_FD_DATA 3
|
||||
#define ZTEST_FD_RAND 4
|
||||
|
||||
typedef struct ztest_shared_hdr {
|
||||
uint64_t zh_hdr_size;
|
||||
@@ -186,7 +183,6 @@ static const ztest_shared_opts_t ztest_opts_defaults = {
|
||||
|
||||
extern uint64_t metaslab_gang_bang;
|
||||
extern uint64_t metaslab_df_alloc_threshold;
|
||||
extern uint64_t zfs_deadman_synctime_ms;
|
||||
|
||||
static ztest_shared_opts_t *ztest_shared_opts;
|
||||
static ztest_shared_opts_t ztest_opts;
|
||||
@@ -366,12 +362,12 @@ ztest_info_t ztest_info[] = {
|
||||
{ ztest_fault_inject, 1, &zopt_sometimes },
|
||||
{ ztest_ddt_repair, 1, &zopt_sometimes },
|
||||
{ ztest_dmu_snapshot_hold, 1, &zopt_sometimes },
|
||||
{ ztest_reguid, 1, &zopt_rarely },
|
||||
{ ztest_reguid, 1, &zopt_sometimes },
|
||||
{ ztest_spa_rename, 1, &zopt_rarely },
|
||||
{ ztest_scrub, 1, &zopt_rarely },
|
||||
{ ztest_spa_upgrade, 1, &zopt_rarely },
|
||||
{ ztest_dsl_dataset_promote_busy, 1, &zopt_rarely },
|
||||
{ ztest_vdev_attach_detach, 1, &zopt_sometimes },
|
||||
{ ztest_vdev_attach_detach, 1, &zopt_rarely },
|
||||
{ ztest_vdev_LUN_growth, 1, &zopt_rarely },
|
||||
{ ztest_vdev_add_remove, 1,
|
||||
&ztest_opts.zo_vdevtime },
|
||||
@@ -717,17 +713,14 @@ process_options(int argc, char **argv)
|
||||
UINT64_MAX >> 2);
|
||||
|
||||
if (strlen(altdir) > 0) {
|
||||
char *cmd;
|
||||
char *realaltdir;
|
||||
char cmd[MAXNAMELEN];
|
||||
char realaltdir[MAXNAMELEN];
|
||||
char *bin;
|
||||
char *ztest;
|
||||
char *isa;
|
||||
int isalen;
|
||||
|
||||
cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
|
||||
realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
|
||||
|
||||
VERIFY(NULL != realpath(getexecname(), cmd));
|
||||
(void) realpath(getexecname(), cmd);
|
||||
if (0 != access(altdir, F_OK)) {
|
||||
ztest_dump_core = B_FALSE;
|
||||
fatal(B_TRUE, "invalid alternate ztest path: %s",
|
||||
@@ -758,9 +751,6 @@ process_options(int argc, char **argv)
|
||||
fatal(B_TRUE, "invalid alternate lib directory %s",
|
||||
zo->zo_alt_libpath);
|
||||
}
|
||||
|
||||
umem_free(cmd, MAXPATHLEN);
|
||||
umem_free(realaltdir, MAXPATHLEN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,16 +759,6 @@ ztest_kill(ztest_shared_t *zs)
|
||||
{
|
||||
zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa));
|
||||
zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa));
|
||||
|
||||
/*
|
||||
* Before we kill off ztest, make sure that the config is updated.
|
||||
* See comment above spa_config_sync().
|
||||
*/
|
||||
mutex_enter(&spa_namespace_lock);
|
||||
spa_config_sync(ztest_spa, B_FALSE, B_FALSE);
|
||||
mutex_exit(&spa_namespace_lock);
|
||||
|
||||
zfs_dbgmsg_print(FTAG);
|
||||
(void) kill(getpid(), SIGKILL);
|
||||
}
|
||||
|
||||
@@ -787,12 +767,10 @@ ztest_random(uint64_t range)
|
||||
{
|
||||
uint64_t r;
|
||||
|
||||
ASSERT3S(ztest_fd_rand, >=, 0);
|
||||
|
||||
if (range == 0)
|
||||
return (0);
|
||||
|
||||
if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r))
|
||||
if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r))
|
||||
fatal(1, "short read from /dev/urandom");
|
||||
|
||||
return (r % range);
|
||||
@@ -1022,8 +1000,9 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
|
||||
uint64_t curval;
|
||||
int error;
|
||||
|
||||
error = dsl_prop_set_int(osname, propname,
|
||||
(inherit ? ZPROP_SRC_NONE : ZPROP_SRC_LOCAL), value);
|
||||
error = dsl_prop_set(osname, propname,
|
||||
(inherit ? ZPROP_SRC_NONE : ZPROP_SRC_LOCAL),
|
||||
sizeof (value), 1, &value);
|
||||
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
@@ -1031,7 +1010,8 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
|
||||
}
|
||||
ASSERT0(error);
|
||||
|
||||
VERIFY0(dsl_prop_get_integer(osname, propname, &curval, setpoint));
|
||||
VERIFY3U(dsl_prop_get(osname, propname, sizeof (curval),
|
||||
1, &curval, setpoint), ==, 0);
|
||||
|
||||
if (ztest_opts.zo_verbose >= 6) {
|
||||
VERIFY(zfs_prop_index_to_string(prop, curval, &valname) == 0);
|
||||
@@ -2344,7 +2324,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1);
|
||||
VERIFY3U(ENOENT, ==,
|
||||
spa_create("ztest_bad_file", nvroot, NULL, NULL));
|
||||
spa_create("ztest_bad_file", nvroot, NULL, NULL, NULL));
|
||||
nvlist_free(nvroot);
|
||||
|
||||
/*
|
||||
@@ -2352,7 +2332,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 2, 1);
|
||||
VERIFY3U(ENOENT, ==,
|
||||
spa_create("ztest_bad_mirror", nvroot, NULL, NULL));
|
||||
spa_create("ztest_bad_mirror", nvroot, NULL, NULL, NULL));
|
||||
nvlist_free(nvroot);
|
||||
|
||||
/*
|
||||
@@ -2361,7 +2341,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
(void) rw_rdlock(&ztest_name_lock);
|
||||
nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1);
|
||||
VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL));
|
||||
VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL, NULL));
|
||||
nvlist_free(nvroot);
|
||||
VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG));
|
||||
VERIFY3U(EBUSY, ==, spa_destroy(zo->zo_pool));
|
||||
@@ -2419,7 +2399,7 @@ ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id)
|
||||
props = fnvlist_alloc();
|
||||
fnvlist_add_uint64(props,
|
||||
zpool_prop_to_name(ZPOOL_PROP_VERSION), version);
|
||||
VERIFY0(spa_create(name, nvroot, props, NULL));
|
||||
VERIFY0(spa_create(name, nvroot, props, NULL, NULL));
|
||||
fnvlist_free(nvroot);
|
||||
fnvlist_free(props);
|
||||
|
||||
@@ -2493,7 +2473,8 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
|
||||
int error;
|
||||
|
||||
VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
|
||||
leaves = MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
|
||||
leaves =
|
||||
MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
|
||||
|
||||
spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
|
||||
|
||||
@@ -2743,7 +2724,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
|
||||
uint64_t leaf, top;
|
||||
uint64_t ashift = ztest_get_ashift();
|
||||
uint64_t oldguid, pguid;
|
||||
uint64_t oldsize, newsize;
|
||||
size_t oldsize, newsize;
|
||||
char oldpath[MAXPATHLEN], newpath[MAXPATHLEN];
|
||||
int replacing;
|
||||
int oldvd_has_siblings = B_FALSE;
|
||||
@@ -2902,8 +2883,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
|
||||
if (error != expected_error && expected_error != EBUSY) {
|
||||
fatal(0, "attach (%s %llu, %s %llu, %d) "
|
||||
"returned %d, expected %d",
|
||||
oldpath, oldsize, newpath,
|
||||
newsize, replacing, error, expected_error);
|
||||
oldpath, (longlong_t)oldsize, newpath,
|
||||
(longlong_t)newsize, replacing, error, expected_error);
|
||||
}
|
||||
|
||||
VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
|
||||
@@ -3193,7 +3174,7 @@ ztest_objset_destroy_cb(const char *name, void *arg)
|
||||
/*
|
||||
* Verify that the dataset contains a directory object.
|
||||
*/
|
||||
VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_TRUE, FTAG, &os));
|
||||
VERIFY3U(0, ==, dmu_objset_hold(name, FTAG, &os));
|
||||
error = dmu_object_info(os, ZTEST_DIROBJ, &doi);
|
||||
if (error != ENOENT) {
|
||||
/* We could have crashed in the middle of destroying it */
|
||||
@@ -3201,16 +3182,12 @@ ztest_objset_destroy_cb(const char *name, void *arg)
|
||||
ASSERT3U(doi.doi_type, ==, DMU_OT_ZAP_OTHER);
|
||||
ASSERT3S(doi.doi_physical_blocks_512, >=, 0);
|
||||
}
|
||||
dmu_objset_disown(os, FTAG);
|
||||
dmu_objset_rele(os, FTAG);
|
||||
|
||||
/*
|
||||
* Destroy the dataset.
|
||||
*/
|
||||
if (strchr(name, '@') != NULL) {
|
||||
VERIFY0(dsl_destroy_snapshot(name, B_FALSE));
|
||||
} else {
|
||||
VERIFY0(dsl_destroy_head(name));
|
||||
}
|
||||
VERIFY3U(0, ==, dmu_objset_destroy(name, B_FALSE));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -3220,17 +3197,17 @@ ztest_snapshot_create(char *osname, uint64_t id)
|
||||
char snapname[MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
(void) snprintf(snapname, sizeof (snapname), "%llu", (u_longlong_t)id);
|
||||
(void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname,
|
||||
(u_longlong_t)id);
|
||||
|
||||
error = dmu_objset_snapshot_one(osname, snapname);
|
||||
error = dmu_objset_snapshot(osname, strchr(snapname, '@') + 1,
|
||||
NULL, NULL, B_FALSE, B_FALSE, -1);
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
return (B_FALSE);
|
||||
}
|
||||
if (error != 0 && error != EEXIST) {
|
||||
fatal(0, "ztest_snapshot_create(%s@%s) = %d", osname,
|
||||
snapname, error);
|
||||
}
|
||||
if (error != 0 && error != EEXIST)
|
||||
fatal(0, "ztest_snapshot_create(%s) = %d", snapname, error);
|
||||
return (B_TRUE);
|
||||
}
|
||||
|
||||
@@ -3243,7 +3220,7 @@ ztest_snapshot_destroy(char *osname, uint64_t id)
|
||||
(void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname,
|
||||
(u_longlong_t)id);
|
||||
|
||||
error = dsl_destroy_snapshot(snapname, B_FALSE);
|
||||
error = dmu_objset_destroy(snapname, B_FALSE);
|
||||
if (error != 0 && error != ENOENT)
|
||||
fatal(0, "ztest_snapshot_destroy(%s) = %d", snapname, error);
|
||||
return (B_TRUE);
|
||||
@@ -3289,8 +3266,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
|
||||
/*
|
||||
* Verify that the destroyed dataset is no longer in the namespace.
|
||||
*/
|
||||
VERIFY3U(ENOENT, ==, dmu_objset_own(name, DMU_OST_OTHER, B_TRUE,
|
||||
FTAG, &os));
|
||||
VERIFY3U(ENOENT, ==, dmu_objset_hold(name, FTAG, &os));
|
||||
|
||||
/*
|
||||
* Verify that we can create a new dataset.
|
||||
@@ -3305,7 +3281,8 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_objset_create(%s) = %d", name, error);
|
||||
}
|
||||
|
||||
VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os));
|
||||
VERIFY3U(0, ==,
|
||||
dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os));
|
||||
|
||||
ztest_zd_init(&zdtmp, NULL, os);
|
||||
|
||||
@@ -3381,21 +3358,21 @@ ztest_dsl_dataset_cleanup(char *osname, uint64_t id)
|
||||
(void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id);
|
||||
(void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id);
|
||||
|
||||
error = dsl_destroy_head(clone2name);
|
||||
error = dmu_objset_destroy(clone2name, B_FALSE);
|
||||
if (error && error != ENOENT)
|
||||
fatal(0, "dsl_destroy_head(%s) = %d", clone2name, error);
|
||||
error = dsl_destroy_snapshot(snap3name, B_FALSE);
|
||||
fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
|
||||
error = dmu_objset_destroy(snap3name, B_FALSE);
|
||||
if (error && error != ENOENT)
|
||||
fatal(0, "dsl_destroy_snapshot(%s) = %d", snap3name, error);
|
||||
error = dsl_destroy_snapshot(snap2name, B_FALSE);
|
||||
fatal(0, "dmu_objset_destroy(%s) = %d", snap3name, error);
|
||||
error = dmu_objset_destroy(snap2name, B_FALSE);
|
||||
if (error && error != ENOENT)
|
||||
fatal(0, "dsl_destroy_snapshot(%s) = %d", snap2name, error);
|
||||
error = dsl_destroy_head(clone1name);
|
||||
fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
|
||||
error = dmu_objset_destroy(clone1name, B_FALSE);
|
||||
if (error && error != ENOENT)
|
||||
fatal(0, "dsl_destroy_head(%s) = %d", clone1name, error);
|
||||
error = dsl_destroy_snapshot(snap1name, B_FALSE);
|
||||
fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
|
||||
error = dmu_objset_destroy(snap1name, B_FALSE);
|
||||
if (error && error != ENOENT)
|
||||
fatal(0, "dsl_destroy_snapshot(%s) = %d", snap1name, error);
|
||||
fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3404,7 +3381,8 @@ ztest_dsl_dataset_cleanup(char *osname, uint64_t id)
|
||||
void
|
||||
ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
{
|
||||
objset_t *os;
|
||||
objset_t *clone;
|
||||
dsl_dataset_t *ds;
|
||||
char snap1name[MAXNAMELEN];
|
||||
char clone1name[MAXNAMELEN];
|
||||
char snap2name[MAXNAMELEN];
|
||||
@@ -3423,7 +3401,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
(void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id);
|
||||
(void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id);
|
||||
|
||||
error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1);
|
||||
error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1,
|
||||
NULL, NULL, B_FALSE, B_FALSE, -1);
|
||||
if (error && error != EEXIST) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
@@ -3432,7 +3411,12 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_take_snapshot(%s) = %d", snap1name, error);
|
||||
}
|
||||
|
||||
error = dmu_objset_clone(clone1name, snap1name);
|
||||
error = dmu_objset_hold(snap1name, FTAG, &clone);
|
||||
if (error)
|
||||
fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
|
||||
|
||||
error = dmu_objset_clone(clone1name, dmu_objset_ds(clone), 0);
|
||||
dmu_objset_rele(clone, FTAG);
|
||||
if (error) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
@@ -3441,7 +3425,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
|
||||
}
|
||||
|
||||
error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1);
|
||||
error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
|
||||
NULL, NULL, B_FALSE, B_FALSE, -1);
|
||||
if (error && error != EEXIST) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
@@ -3450,7 +3435,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_open_snapshot(%s) = %d", snap2name, error);
|
||||
}
|
||||
|
||||
error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1);
|
||||
error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
|
||||
NULL, NULL, B_FALSE, B_FALSE, -1);
|
||||
if (error && error != EEXIST) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
@@ -3459,7 +3445,12 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
|
||||
}
|
||||
|
||||
error = dmu_objset_clone(clone2name, snap3name);
|
||||
error = dmu_objset_hold(snap3name, FTAG, &clone);
|
||||
if (error)
|
||||
fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
|
||||
|
||||
error = dmu_objset_clone(clone2name, dmu_objset_ds(clone), 0);
|
||||
dmu_objset_rele(clone, FTAG);
|
||||
if (error) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc(FTAG);
|
||||
@@ -3468,14 +3459,14 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
|
||||
}
|
||||
|
||||
error = dmu_objset_own(snap2name, DMU_OST_ANY, B_TRUE, FTAG, &os);
|
||||
error = dsl_dataset_own(snap2name, B_FALSE, FTAG, &ds);
|
||||
if (error)
|
||||
fatal(0, "dmu_objset_own(%s) = %d", snap2name, error);
|
||||
fatal(0, "dsl_dataset_own(%s) = %d", snap2name, error);
|
||||
error = dsl_dataset_promote(clone2name, NULL);
|
||||
if (error != EBUSY)
|
||||
fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
|
||||
error);
|
||||
dmu_objset_disown(os, FTAG);
|
||||
dsl_dataset_disown(ds, FTAG);
|
||||
|
||||
out:
|
||||
ztest_dsl_dataset_cleanup(osname, id);
|
||||
@@ -3617,9 +3608,6 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
||||
else
|
||||
dmu_tx_hold_write(tx, bigobj, bigoff, bigsize);
|
||||
|
||||
/* This accounts for setting the checksum/compression. */
|
||||
dmu_tx_hold_bonus(tx, bigobj);
|
||||
|
||||
txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
|
||||
if (txg == 0) {
|
||||
umem_free(packbuf, packsize);
|
||||
@@ -4290,7 +4278,7 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id)
|
||||
}
|
||||
|
||||
count = -1ULL;
|
||||
VERIFY0(zap_count(os, object, &count));
|
||||
VERIFY(zap_count(os, object, &count) == 0);
|
||||
ASSERT(count != -1ULL);
|
||||
|
||||
/*
|
||||
@@ -4524,7 +4512,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
tmp_cb = list_head(&zcl.zcl_callbacks);
|
||||
if (tmp_cb != NULL &&
|
||||
(txg - ZTEST_COMMIT_CALLBACK_THRESH) > tmp_cb->zcd_txg) {
|
||||
tmp_cb->zcd_txg > txg - ZTEST_COMMIT_CALLBACK_THRESH) {
|
||||
fatal(0, "Commit callback threshold exceeded, oldest txg: %"
|
||||
PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg);
|
||||
}
|
||||
@@ -4601,22 +4589,6 @@ ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
}
|
||||
|
||||
static int
|
||||
user_release_one(const char *snapname, const char *holdname)
|
||||
{
|
||||
nvlist_t *snaps, *holds;
|
||||
int error;
|
||||
|
||||
snaps = fnvlist_alloc();
|
||||
holds = fnvlist_alloc();
|
||||
fnvlist_add_boolean(holds, holdname);
|
||||
fnvlist_add_nvlist(snaps, snapname, holds);
|
||||
fnvlist_free(holds);
|
||||
error = dsl_dataset_user_release(snaps, NULL);
|
||||
fnvlist_free(snaps);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test snapshot hold/release and deferred destroy.
|
||||
*/
|
||||
@@ -4631,36 +4603,29 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
|
||||
char clonename[100];
|
||||
char tag[100];
|
||||
char osname[MAXNAMELEN];
|
||||
nvlist_t *holds;
|
||||
|
||||
(void) rw_rdlock(&ztest_name_lock);
|
||||
|
||||
dmu_objset_name(os, osname);
|
||||
|
||||
(void) snprintf(snapname, sizeof (snapname), "sh1_%llu", id);
|
||||
(void) snprintf(fullname, sizeof (fullname), "%s@%s", osname, snapname);
|
||||
(void) snprintf(clonename, sizeof (clonename),
|
||||
"%s/ch1_%llu", osname, id);
|
||||
(void) snprintf(tag, sizeof (tag), "tag_%llu", id);
|
||||
(void) snprintf(snapname, 100, "sh1_%llu", id);
|
||||
(void) snprintf(fullname, 100, "%s@%s", osname, snapname);
|
||||
(void) snprintf(clonename, 100, "%s/ch1_%llu", osname, id);
|
||||
(void) snprintf(tag, 100, "%tag_%llu", id);
|
||||
|
||||
/*
|
||||
* Clean up from any previous run.
|
||||
*/
|
||||
error = dsl_destroy_head(clonename);
|
||||
if (error != ENOENT)
|
||||
ASSERT0(error);
|
||||
error = user_release_one(fullname, tag);
|
||||
if (error != ESRCH && error != ENOENT)
|
||||
ASSERT0(error);
|
||||
error = dsl_destroy_snapshot(fullname, B_FALSE);
|
||||
if (error != ENOENT)
|
||||
ASSERT0(error);
|
||||
(void) dmu_objset_destroy(clonename, B_FALSE);
|
||||
(void) dsl_dataset_user_release(osname, snapname, tag, B_FALSE);
|
||||
(void) dmu_objset_destroy(fullname, B_FALSE);
|
||||
|
||||
/*
|
||||
* Create snapshot, clone it, mark snap for deferred destroy,
|
||||
* destroy clone, verify snap was also destroyed.
|
||||
*/
|
||||
error = dmu_objset_snapshot_one(osname, snapname);
|
||||
error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE,
|
||||
FALSE, -1);
|
||||
if (error) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc("dmu_objset_snapshot");
|
||||
@@ -4669,7 +4634,12 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error);
|
||||
}
|
||||
|
||||
error = dmu_objset_clone(clonename, fullname);
|
||||
error = dmu_objset_hold(fullname, FTAG, &origin);
|
||||
if (error)
|
||||
fatal(0, "dmu_objset_hold(%s) = %d", fullname, error);
|
||||
|
||||
error = dmu_objset_clone(clonename, dmu_objset_ds(origin), 0);
|
||||
dmu_objset_rele(origin, FTAG);
|
||||
if (error) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc("dmu_objset_clone");
|
||||
@@ -4678,15 +4648,15 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_objset_clone(%s) = %d", clonename, error);
|
||||
}
|
||||
|
||||
error = dsl_destroy_snapshot(fullname, B_TRUE);
|
||||
error = dmu_objset_destroy(fullname, B_TRUE);
|
||||
if (error) {
|
||||
fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
|
||||
fatal(0, "dmu_objset_destroy(%s, B_TRUE) = %d",
|
||||
fullname, error);
|
||||
}
|
||||
|
||||
error = dsl_destroy_head(clonename);
|
||||
error = dmu_objset_destroy(clonename, B_FALSE);
|
||||
if (error)
|
||||
fatal(0, "dsl_destroy_head(%s) = %d", clonename, error);
|
||||
fatal(0, "dmu_objset_destroy(%s) = %d", clonename, error);
|
||||
|
||||
error = dmu_objset_hold(fullname, FTAG, &origin);
|
||||
if (error != ENOENT)
|
||||
@@ -4697,7 +4667,8 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
|
||||
* destroy a held snapshot, mark for deferred destroy,
|
||||
* release hold, verify snapshot was destroyed.
|
||||
*/
|
||||
error = dmu_objset_snapshot_one(osname, snapname);
|
||||
error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE,
|
||||
FALSE, -1);
|
||||
if (error) {
|
||||
if (error == ENOSPC) {
|
||||
ztest_record_enospc("dmu_objset_snapshot");
|
||||
@@ -4706,31 +4677,28 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
|
||||
fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error);
|
||||
}
|
||||
|
||||
holds = fnvlist_alloc();
|
||||
fnvlist_add_string(holds, fullname, tag);
|
||||
error = dsl_dataset_user_hold(holds, 0, NULL);
|
||||
fnvlist_free(holds);
|
||||
|
||||
error = dsl_dataset_user_hold(osname, snapname, tag, B_FALSE,
|
||||
B_TRUE, -1);
|
||||
if (error)
|
||||
fatal(0, "dsl_dataset_user_hold(%s)", fullname, tag);
|
||||
|
||||
error = dsl_destroy_snapshot(fullname, B_FALSE);
|
||||
error = dmu_objset_destroy(fullname, B_FALSE);
|
||||
if (error != EBUSY) {
|
||||
fatal(0, "dsl_destroy_snapshot(%s, B_FALSE) = %d",
|
||||
fatal(0, "dmu_objset_destroy(%s, B_FALSE) = %d",
|
||||
fullname, error);
|
||||
}
|
||||
|
||||
error = dsl_destroy_snapshot(fullname, B_TRUE);
|
||||
error = dmu_objset_destroy(fullname, B_TRUE);
|
||||
if (error) {
|
||||
fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
|
||||
fatal(0, "dmu_objset_destroy(%s, B_TRUE) = %d",
|
||||
fullname, error);
|
||||
}
|
||||
|
||||
error = user_release_one(fullname, tag);
|
||||
error = dsl_dataset_user_release(osname, snapname, tag, B_FALSE);
|
||||
if (error)
|
||||
fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error);
|
||||
fatal(0, "dsl_dataset_user_release(%s)", fullname, tag);
|
||||
|
||||
VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT);
|
||||
VERIFY(dmu_objset_hold(fullname, FTAG, &origin) == ENOENT);
|
||||
|
||||
out:
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
@@ -4769,14 +4737,6 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
|
||||
ASSERT(leaves >= 1);
|
||||
|
||||
/*
|
||||
* Grab the name lock as reader. There are some operations
|
||||
* which don't like to have their vdevs changed while
|
||||
* they are in progress (i.e. spa_change_guid). Those
|
||||
* operations will have grabbed the name lock as writer.
|
||||
*/
|
||||
(void) rw_rdlock(&ztest_name_lock);
|
||||
|
||||
/*
|
||||
* We need SCL_STATE here because we're going to look at vd0->vdev_tsd.
|
||||
*/
|
||||
@@ -4806,14 +4766,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
if (vd0 != NULL && vd0->vdev_top->vdev_islog)
|
||||
islog = B_TRUE;
|
||||
|
||||
/*
|
||||
* If the top-level vdev needs to be resilvered
|
||||
* then we only allow faults on the device that is
|
||||
* resilvering.
|
||||
*/
|
||||
if (vd0 != NULL && maxfaults != 1 &&
|
||||
(!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) ||
|
||||
vd0->vdev_resilver_txg != 0)) {
|
||||
if (vd0 != NULL && maxfaults != 1) {
|
||||
/*
|
||||
* Make vd0 explicitly claim to be unreadable,
|
||||
* or unwriteable, or reach behind its back
|
||||
@@ -4844,7 +4797,6 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
|
||||
if (sav->sav_count == 0) {
|
||||
spa_config_exit(spa, SCL_STATE, FTAG);
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
return;
|
||||
}
|
||||
vd0 = sav->sav_vdevs[ztest_random(sav->sav_count)];
|
||||
@@ -4858,7 +4810,6 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
}
|
||||
|
||||
spa_config_exit(spa, SCL_STATE, FTAG);
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
|
||||
/*
|
||||
* If we can tolerate two or more faults, or we're dealing
|
||||
@@ -4885,18 +4836,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
if (islog)
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
} else {
|
||||
/*
|
||||
* Ideally we would like to be able to randomly
|
||||
* call vdev_[on|off]line without holding locks
|
||||
* to force unpredictable failures but the side
|
||||
* effects of vdev_[on|off]line prevent us from
|
||||
* doing so. We grab the ztest_vdev_lock here to
|
||||
* prevent a race between injection testing and
|
||||
* aux_vdev removal.
|
||||
*/
|
||||
VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
|
||||
(void) vdev_online(spa, guid0, 0, NULL);
|
||||
VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5001,12 +4941,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
for (int i = 0; i < copies; i++) {
|
||||
uint64_t offset = i * blocksize;
|
||||
int error = dmu_buf_hold(os, object, offset, FTAG, &db,
|
||||
DMU_READ_NO_PREFETCH);
|
||||
if (error != 0) {
|
||||
fatal(B_FALSE, "dmu_buf_hold(%p, %llu, %llu) = %u",
|
||||
os, (long long)object, (long long) offset, error);
|
||||
}
|
||||
VERIFY0(dmu_buf_hold(os, object, offset, FTAG, &db,
|
||||
DMU_READ_NO_PREFETCH));
|
||||
ASSERT(db->db_offset == offset);
|
||||
ASSERT(db->db_size == blocksize);
|
||||
ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) ||
|
||||
@@ -5217,7 +5153,6 @@ ztest_spa_import_export(char *oldname, char *newname)
|
||||
nvlist_t *config, *newconfig;
|
||||
uint64_t pool_guid;
|
||||
spa_t *spa;
|
||||
int error;
|
||||
|
||||
if (ztest_opts.zo_verbose >= 4) {
|
||||
(void) printf("import/export: old = %s, new = %s\n",
|
||||
@@ -5262,12 +5197,7 @@ ztest_spa_import_export(char *oldname, char *newname)
|
||||
/*
|
||||
* Import it under the new name.
|
||||
*/
|
||||
error = spa_import(newname, config, NULL, 0);
|
||||
if (error != 0) {
|
||||
dump_nvlist(config, 0);
|
||||
fatal(B_FALSE, "couldn't import pool %s as %s: error %u",
|
||||
oldname, newname, error);
|
||||
}
|
||||
VERIFY3U(0, ==, spa_import(newname, config, NULL, 0));
|
||||
|
||||
ztest_walk_pool_directory("pools after import");
|
||||
|
||||
@@ -5324,33 +5254,16 @@ static void *
|
||||
ztest_deadman_thread(void *arg)
|
||||
{
|
||||
ztest_shared_t *zs = arg;
|
||||
spa_t *spa = ztest_spa;
|
||||
hrtime_t delta, total = 0;
|
||||
int grace = 300;
|
||||
hrtime_t delta;
|
||||
|
||||
for (;;) {
|
||||
delta = zs->zs_thread_stop - zs->zs_thread_start +
|
||||
MSEC2NSEC(zfs_deadman_synctime_ms);
|
||||
delta = (zs->zs_thread_stop - zs->zs_thread_start) / NANOSEC + grace;
|
||||
|
||||
(void) poll(NULL, 0, (int)NSEC2MSEC(delta));
|
||||
(void) poll(NULL, 0, (int)(1000 * delta));
|
||||
|
||||
/*
|
||||
* If the pool is suspended then fail immediately. Otherwise,
|
||||
* check to see if the pool is making any progress. If
|
||||
* vdev_deadman() discovers that there hasn't been any recent
|
||||
* I/Os then it will end up aborting the tests.
|
||||
*/
|
||||
if (spa_suspended(spa) || spa->spa_root_vdev == NULL) {
|
||||
fatal(0, "aborting test after %llu seconds because "
|
||||
"pool has transitioned to a suspended state.",
|
||||
zfs_deadman_synctime_ms / 1000);
|
||||
return (NULL);
|
||||
}
|
||||
vdev_deadman(spa->spa_root_vdev);
|
||||
fatal(0, "failed to complete within %d seconds of deadline", grace);
|
||||
|
||||
total += zfs_deadman_synctime_ms/1000;
|
||||
(void) printf("ztest has been running for %lld seconds\n",
|
||||
total);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -5491,7 +5404,7 @@ ztest_dataset_open(int d)
|
||||
}
|
||||
ASSERT(error == 0 || error == EEXIST);
|
||||
|
||||
VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, zd, &os));
|
||||
VERIFY0(dmu_objset_hold(name, zd, &os));
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
|
||||
ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
|
||||
@@ -5532,7 +5445,7 @@ ztest_dataset_close(int d)
|
||||
ztest_ds_t *zd = &ztest_ds[d];
|
||||
|
||||
zil_close(zd->zd_zilog);
|
||||
dmu_objset_disown(zd->zd_os, zd);
|
||||
dmu_objset_rele(zd->zd_os, zd);
|
||||
|
||||
ztest_zd_fini(zd);
|
||||
}
|
||||
@@ -5576,14 +5489,13 @@ ztest_run(ztest_shared_t *zs)
|
||||
* Open our pool.
|
||||
*/
|
||||
kernel_init(FREAD | FWRITE);
|
||||
VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
|
||||
VERIFY(spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0);
|
||||
spa->spa_debug = B_TRUE;
|
||||
ztest_spa = spa;
|
||||
|
||||
VERIFY0(dmu_objset_own(ztest_opts.zo_pool,
|
||||
DMU_OST_ANY, B_TRUE, FTAG, &os));
|
||||
VERIFY3U(0, ==, dmu_objset_hold(ztest_opts.zo_pool, FTAG, &os));
|
||||
zs->zs_guid = dmu_objset_fsid_guid(os);
|
||||
dmu_objset_disown(os, FTAG);
|
||||
dmu_objset_rele(os, FTAG);
|
||||
|
||||
spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN;
|
||||
|
||||
@@ -5664,7 +5576,6 @@ ztest_run(ztest_shared_t *zs)
|
||||
|
||||
zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa));
|
||||
zs->zs_space = metaslab_class_get_space(spa_normal_class(spa));
|
||||
zfs_dbgmsg_print(FTAG);
|
||||
|
||||
umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t));
|
||||
|
||||
@@ -5861,7 +5772,8 @@ ztest_init(ztest_shared_t *zs)
|
||||
spa_feature_table[i].fi_uname);
|
||||
VERIFY3U(0, ==, nvlist_add_uint64(props, buf, 0));
|
||||
}
|
||||
VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, NULL));
|
||||
VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props,
|
||||
NULL, NULL));
|
||||
nvlist_free(nvroot);
|
||||
|
||||
VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
|
||||
@@ -5883,16 +5795,29 @@ ztest_init(ztest_shared_t *zs)
|
||||
}
|
||||
|
||||
static void
|
||||
setup_data_fd(void)
|
||||
setup_fds(void)
|
||||
{
|
||||
static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX";
|
||||
int fd;
|
||||
#ifdef illumos
|
||||
|
||||
ztest_fd_data = mkstemp(ztest_name_data);
|
||||
ASSERT3S(ztest_fd_data, >=, 0);
|
||||
(void) unlink(ztest_name_data);
|
||||
char *tmp = tempnam(NULL, NULL);
|
||||
fd = open(tmp, O_RDWR | O_CREAT, 0700);
|
||||
ASSERT3U(fd, ==, ZTEST_FD_DATA);
|
||||
(void) unlink(tmp);
|
||||
free(tmp);
|
||||
#else
|
||||
char tmp[MAXPATHLEN];
|
||||
|
||||
strlcpy(tmp, ztest_opts.zo_dir, MAXPATHLEN);
|
||||
strlcat(tmp, "/ztest.XXXXXX", MAXPATHLEN);
|
||||
fd = mkstemp(tmp);
|
||||
ASSERT3U(fd, ==, ZTEST_FD_DATA);
|
||||
#endif
|
||||
|
||||
fd = open("/dev/urandom", O_RDONLY);
|
||||
ASSERT3U(fd, ==, ZTEST_FD_RAND);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
shared_data_size(ztest_shared_hdr_t *hdr)
|
||||
{
|
||||
@@ -5913,11 +5838,15 @@ setup_hdr(void)
|
||||
int size;
|
||||
ztest_shared_hdr_t *hdr;
|
||||
|
||||
#ifndef illumos
|
||||
pwrite(ZTEST_FD_DATA, "", 1, 0);
|
||||
#endif
|
||||
|
||||
hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0);
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
|
||||
ASSERT(hdr != MAP_FAILED);
|
||||
|
||||
VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t)));
|
||||
VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t)));
|
||||
|
||||
hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t);
|
||||
hdr->zh_opts_size = sizeof (ztest_shared_opts_t);
|
||||
@@ -5928,7 +5857,7 @@ setup_hdr(void)
|
||||
hdr->zh_ds_count = ztest_opts.zo_datasets;
|
||||
|
||||
size = shared_data_size(hdr);
|
||||
VERIFY3U(0, ==, ftruncate(ztest_fd_data, size));
|
||||
VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size));
|
||||
|
||||
(void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
|
||||
}
|
||||
@@ -5941,14 +5870,14 @@ setup_data(void)
|
||||
uint8_t *buf;
|
||||
|
||||
hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
|
||||
PROT_READ, MAP_SHARED, ztest_fd_data, 0);
|
||||
PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0);
|
||||
ASSERT(hdr != MAP_FAILED);
|
||||
|
||||
size = shared_data_size(hdr);
|
||||
|
||||
(void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
|
||||
hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()),
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0);
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
|
||||
ASSERT(hdr != MAP_FAILED);
|
||||
buf = (uint8_t *)hdr;
|
||||
|
||||
@@ -5967,13 +5896,12 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
|
||||
{
|
||||
pid_t pid;
|
||||
int status;
|
||||
char *cmdbuf = NULL;
|
||||
char cmdbuf[MAXPATHLEN];
|
||||
|
||||
pid = fork();
|
||||
|
||||
if (cmd == NULL) {
|
||||
cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
|
||||
(void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN);
|
||||
(void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf));
|
||||
cmd = cmdbuf;
|
||||
}
|
||||
|
||||
@@ -5982,16 +5910,9 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
|
||||
|
||||
if (pid == 0) { /* child */
|
||||
char *emptyargv[2] = { cmd, NULL };
|
||||
char fd_data_str[12];
|
||||
|
||||
struct rlimit rl = { 1024, 1024 };
|
||||
(void) setrlimit(RLIMIT_NOFILE, &rl);
|
||||
|
||||
(void) close(ztest_fd_rand);
|
||||
VERIFY3U(11, >=,
|
||||
snprintf(fd_data_str, 12, "%d", ztest_fd_data));
|
||||
VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1));
|
||||
|
||||
(void) enable_extended_FILE_stdio(-1, -1);
|
||||
if (libpath != NULL)
|
||||
VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1));
|
||||
@@ -6004,11 +5925,6 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
|
||||
fatal(B_TRUE, "exec failed: %s", cmd);
|
||||
}
|
||||
|
||||
if (cmdbuf != NULL) {
|
||||
umem_free(cmdbuf, MAXPATHLEN);
|
||||
cmd = NULL;
|
||||
}
|
||||
|
||||
while (waitpid(pid, &status, 0) != pid)
|
||||
continue;
|
||||
if (statusp != NULL)
|
||||
@@ -6073,42 +5989,39 @@ main(int argc, char **argv)
|
||||
char timebuf[100];
|
||||
char numbuf[6];
|
||||
spa_t *spa;
|
||||
char *cmd;
|
||||
char cmd[MAXNAMELEN];
|
||||
boolean_t hasalt;
|
||||
char *fd_data_str = getenv("ZTEST_FD_DATA");
|
||||
|
||||
boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR));
|
||||
ASSERT(ischild || errno == EBADF);
|
||||
|
||||
(void) setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
|
||||
dprintf_setup(&argc, argv);
|
||||
zfs_deadman_synctime_ms = 300000;
|
||||
|
||||
ztest_fd_rand = open("/dev/urandom", O_RDONLY);
|
||||
ASSERT3S(ztest_fd_rand, >=, 0);
|
||||
|
||||
if (!fd_data_str) {
|
||||
if (!ischild) {
|
||||
process_options(argc, argv);
|
||||
|
||||
setup_data_fd();
|
||||
setup_fds();
|
||||
setup_hdr();
|
||||
setup_data();
|
||||
bcopy(&ztest_opts, ztest_shared_opts,
|
||||
sizeof (*ztest_shared_opts));
|
||||
} else {
|
||||
ztest_fd_data = atoi(fd_data_str);
|
||||
setup_data();
|
||||
bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts));
|
||||
}
|
||||
ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count);
|
||||
|
||||
/* Override location of zpool.cache */
|
||||
VERIFY3U(asprintf((char **)&spa_config_path, "%s/zpool.cache",
|
||||
ztest_opts.zo_dir), !=, -1);
|
||||
(void) asprintf((char **)&spa_config_path, "%s/zpool.cache",
|
||||
ztest_opts.zo_dir);
|
||||
|
||||
ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t),
|
||||
UMEM_NOFAIL);
|
||||
zs = ztest_shared;
|
||||
|
||||
if (fd_data_str) {
|
||||
if (ischild) {
|
||||
metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang;
|
||||
metaslab_df_alloc_threshold =
|
||||
zs->zs_metaslab_df_alloc_threshold;
|
||||
@@ -6131,8 +6044,7 @@ main(int argc, char **argv)
|
||||
(u_longlong_t)ztest_opts.zo_time);
|
||||
}
|
||||
|
||||
cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
|
||||
(void) strlcpy(cmd, getexecname(), MAXNAMELEN);
|
||||
(void) strlcpy(cmd, getexecname(), sizeof (cmd));
|
||||
|
||||
zs->zs_do_init = B_TRUE;
|
||||
if (strlen(ztest_opts.zo_alt_ztest) != 0) {
|
||||
@@ -6273,7 +6185,5 @@ main(int argc, char **argv)
|
||||
kills, iters - kills, (100.0 * kills) / MAX(1, iters));
|
||||
}
|
||||
|
||||
umem_free(cmd, MAXNAMELEN);
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -730,6 +730,11 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size)
|
||||
{
|
||||
void *data;
|
||||
|
||||
if (size > 16 * 1024 * 1024) {
|
||||
(void) dt_set_errno(dtp, EDT_NOMEM);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((data = malloc(size)) == NULL)
|
||||
(void) dt_set_errno(dtp, EDT_NOMEM);
|
||||
else
|
||||
@@ -743,6 +748,11 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size)
|
||||
{
|
||||
void *data;
|
||||
|
||||
if (size > 16 * 1024 * 1024) {
|
||||
(void) dt_set_errno(dtp, EDT_NOMEM);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((data = malloc(size)) == NULL)
|
||||
(void) dt_set_errno(dtp, EDT_NOMEM);
|
||||
|
||||
|
||||
@@ -21,13 +21,12 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _LIBZFS_H
|
||||
@@ -58,8 +57,7 @@ extern "C" {
|
||||
/*
|
||||
* libzfs errors
|
||||
*/
|
||||
typedef enum zfs_error {
|
||||
EZFS_SUCCESS = 0, /* no error -- success */
|
||||
enum {
|
||||
EZFS_NOMEM = 2000, /* out of memory */
|
||||
EZFS_BADPROP, /* invalid property value */
|
||||
EZFS_PROPREADONLY, /* cannot set readonly property */
|
||||
@@ -131,7 +129,7 @@ typedef enum zfs_error {
|
||||
EZFS_DIFFDATA, /* bad zfs diff data */
|
||||
EZFS_POOLREADONLY, /* pool is in read-only mode */
|
||||
EZFS_UNKNOWN
|
||||
} zfs_error_t;
|
||||
};
|
||||
|
||||
/*
|
||||
* The following data structures are all part
|
||||
@@ -187,13 +185,9 @@ extern libzfs_handle_t *zfs_get_handle(zfs_handle_t *);
|
||||
|
||||
extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t);
|
||||
|
||||
extern void zfs_save_arguments(int argc, char **, char *, int);
|
||||
extern int zpool_log_history(libzfs_handle_t *, const char *);
|
||||
|
||||
extern int libzfs_errno(libzfs_handle_t *);
|
||||
extern const char *libzfs_error_action(libzfs_handle_t *);
|
||||
extern const char *libzfs_error_description(libzfs_handle_t *);
|
||||
extern int zfs_standard_error(libzfs_handle_t *, int, const char *);
|
||||
extern void libzfs_mnttab_init(libzfs_handle_t *);
|
||||
extern void libzfs_mnttab_fini(libzfs_handle_t *);
|
||||
extern void libzfs_mnttab_cache(libzfs_handle_t *, boolean_t);
|
||||
@@ -226,7 +220,7 @@ extern int zpool_iter(libzfs_handle_t *, zpool_iter_f, void *);
|
||||
*/
|
||||
extern int zpool_create(libzfs_handle_t *, const char *, nvlist_t *,
|
||||
nvlist_t *, nvlist_t *);
|
||||
extern int zpool_destroy(zpool_handle_t *, const char *);
|
||||
extern int zpool_destroy(zpool_handle_t *);
|
||||
extern int zpool_add(zpool_handle_t *, nvlist_t *);
|
||||
|
||||
typedef struct splitflags {
|
||||
@@ -327,7 +321,6 @@ typedef enum {
|
||||
ZPOOL_STATUS_RESILVERING, /* device being resilvered */
|
||||
ZPOOL_STATUS_OFFLINE_DEV, /* device online */
|
||||
ZPOOL_STATUS_REMOVED_DEV, /* removed device */
|
||||
ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */
|
||||
|
||||
/*
|
||||
* Finally, the following indicates a healthy pool.
|
||||
@@ -350,8 +343,8 @@ extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
|
||||
/*
|
||||
* Import and export functions
|
||||
*/
|
||||
extern int zpool_export(zpool_handle_t *, boolean_t, const char *);
|
||||
extern int zpool_export_force(zpool_handle_t *, const char *);
|
||||
extern int zpool_export(zpool_handle_t *, boolean_t);
|
||||
extern int zpool_export_force(zpool_handle_t *);
|
||||
extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
|
||||
char *altroot);
|
||||
extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
|
||||
@@ -385,7 +378,7 @@ extern nvlist_t *zpool_find_import_cached(libzfs_handle_t *, const char *,
|
||||
*/
|
||||
struct zfs_cmd;
|
||||
|
||||
extern const char *zfs_history_event_names[];
|
||||
extern const char *zfs_history_event_names[LOG_END];
|
||||
|
||||
extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *,
|
||||
boolean_t verbose);
|
||||
@@ -393,9 +386,12 @@ extern int zpool_upgrade(zpool_handle_t *, uint64_t);
|
||||
extern int zpool_get_history(zpool_handle_t *, nvlist_t **);
|
||||
extern int zpool_history_unpack(char *, uint64_t, uint64_t *,
|
||||
nvlist_t ***, uint_t *);
|
||||
extern void zpool_set_history_str(const char *subcommand, int argc,
|
||||
char **argv, char *history_str);
|
||||
extern int zpool_stage_history(libzfs_handle_t *, const char *);
|
||||
extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *,
|
||||
size_t len);
|
||||
extern int zfs_ioctl(libzfs_handle_t *, int request, struct zfs_cmd *);
|
||||
extern int zfs_ioctl(libzfs_handle_t *, unsigned long, struct zfs_cmd *);
|
||||
extern int zpool_get_physpath(zpool_handle_t *, char *, size_t);
|
||||
extern void zpool_explain_recover(libzfs_handle_t *, const char *, int,
|
||||
nvlist_t *);
|
||||
@@ -445,6 +441,8 @@ extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
|
||||
char *propbuf, int proplen, boolean_t literal);
|
||||
extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname,
|
||||
char *buf, size_t len);
|
||||
extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap,
|
||||
uint64_t *usedp);
|
||||
extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
|
||||
extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t);
|
||||
extern const char *zfs_prop_values(zfs_prop_t);
|
||||
@@ -464,8 +462,7 @@ typedef struct zprop_list {
|
||||
boolean_t pl_fixed;
|
||||
} zprop_list_t;
|
||||
|
||||
extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t,
|
||||
boolean_t);
|
||||
extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t);
|
||||
extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
|
||||
|
||||
#define ZFS_MOUNTPOINT_NONE "none"
|
||||
@@ -538,7 +535,6 @@ extern int zfs_iter_filesystems(zfs_handle_t *, zfs_iter_f, void *);
|
||||
extern int zfs_iter_snapshots(zfs_handle_t *, boolean_t, zfs_iter_f, void *);
|
||||
extern int zfs_iter_snapshots_sorted(zfs_handle_t *, zfs_iter_f, void *);
|
||||
extern int zfs_iter_snapspec(zfs_handle_t *, const char *, zfs_iter_f, void *);
|
||||
extern int zfs_iter_bookmarks(zfs_handle_t *, zfs_iter_f, void *);
|
||||
|
||||
typedef struct get_all_cb {
|
||||
zfs_handle_t **cb_handles;
|
||||
@@ -559,11 +555,9 @@ extern int zfs_create(libzfs_handle_t *, const char *, zfs_type_t,
|
||||
extern int zfs_create_ancestors(libzfs_handle_t *, const char *);
|
||||
extern int zfs_destroy(zfs_handle_t *, boolean_t);
|
||||
extern int zfs_destroy_snaps(zfs_handle_t *, char *, boolean_t);
|
||||
extern int zfs_destroy_snaps_nvl(libzfs_handle_t *, nvlist_t *, boolean_t);
|
||||
extern int zfs_destroy_snaps_nvl(zfs_handle_t *, nvlist_t *, boolean_t);
|
||||
extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *);
|
||||
extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *);
|
||||
extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps,
|
||||
nvlist_t *props);
|
||||
extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
|
||||
|
||||
typedef struct renameflags {
|
||||
@@ -577,8 +571,7 @@ typedef struct renameflags {
|
||||
int forceunmount : 1;
|
||||
} renameflags_t;
|
||||
|
||||
extern int zfs_rename(zfs_handle_t *, const char *, const char *,
|
||||
renameflags_t flags);
|
||||
extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t flags);
|
||||
|
||||
typedef struct sendflags {
|
||||
/* print informational messages (ie, -v was specified) */
|
||||
@@ -613,12 +606,10 @@ typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
|
||||
|
||||
extern int zfs_send(zfs_handle_t *, const char *, const char *,
|
||||
sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **);
|
||||
extern int zfs_send_one(zfs_handle_t *, const char *, int);
|
||||
|
||||
extern int zfs_promote(zfs_handle_t *);
|
||||
extern int zfs_hold(zfs_handle_t *, const char *, const char *,
|
||||
boolean_t, int);
|
||||
extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *);
|
||||
extern int zfs_hold(zfs_handle_t *, const char *, const char *, boolean_t,
|
||||
boolean_t, boolean_t, int, uint64_t, uint64_t);
|
||||
extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t);
|
||||
extern int zfs_get_holds(zfs_handle_t *, nvlist_t **);
|
||||
extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *);
|
||||
@@ -683,7 +674,6 @@ extern zfs_handle_t *zfs_path_to_zhandle(libzfs_handle_t *, char *, zfs_type_t);
|
||||
extern boolean_t zfs_dataset_exists(libzfs_handle_t *, const char *,
|
||||
zfs_type_t);
|
||||
extern int zfs_spa_version(zfs_handle_t *, int *);
|
||||
extern boolean_t zfs_bookmark_exists(const char *path);
|
||||
|
||||
/*
|
||||
* Mount support functions.
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER SART
|
||||
*
|
||||
* 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 (c) 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "libzfs_compat.h"
|
||||
|
||||
int zfs_ioctl_version = ZFS_IOCVER_UNDEF;
|
||||
static int zfs_spa_version = -1;
|
||||
|
||||
/*
|
||||
* Get zfs_ioctl_version
|
||||
*/
|
||||
int
|
||||
get_zfs_ioctl_version(void)
|
||||
{
|
||||
size_t ver_size;
|
||||
int ver = ZFS_IOCVER_NONE;
|
||||
|
||||
ver_size = sizeof(ver);
|
||||
sysctlbyname("vfs.zfs.version.ioctl", &ver, &ver_size, NULL, 0);
|
||||
|
||||
return (ver);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the SPA version
|
||||
*/
|
||||
static int
|
||||
get_zfs_spa_version(void)
|
||||
{
|
||||
size_t ver_size;
|
||||
int ver = 0;
|
||||
|
||||
ver_size = sizeof(ver);
|
||||
sysctlbyname("vfs.zfs.version.spa", &ver, &ver_size, NULL, 0);
|
||||
|
||||
return (ver);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is FreeBSD version of ioctl, because Solaris' ioctl() updates
|
||||
* zc_nvlist_dst_size even if an error is returned, on FreeBSD if an
|
||||
* error is returned zc_nvlist_dst_size won't be updated.
|
||||
*/
|
||||
int
|
||||
zcmd_ioctl(int fd, int request, zfs_cmd_t *zc)
|
||||
{
|
||||
size_t oldsize;
|
||||
int ret, cflag = ZFS_CMD_COMPAT_NONE;
|
||||
|
||||
if (zfs_ioctl_version == ZFS_IOCVER_UNDEF)
|
||||
zfs_ioctl_version = get_zfs_ioctl_version();
|
||||
|
||||
if (zfs_ioctl_version == ZFS_IOCVER_LZC)
|
||||
cflag = ZFS_CMD_COMPAT_LZC;
|
||||
else if (zfs_ioctl_version == ZFS_IOCVER_DEADMAN)
|
||||
cflag = ZFS_CMD_COMPAT_DEADMAN;
|
||||
|
||||
/*
|
||||
* If vfs.zfs.version.ioctl is not defined, assume we have v28
|
||||
* compatible binaries and use vfs.zfs.version.spa to test for v15
|
||||
*/
|
||||
if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) {
|
||||
cflag = ZFS_CMD_COMPAT_V28;
|
||||
|
||||
if (zfs_spa_version < 0)
|
||||
zfs_spa_version = get_zfs_spa_version();
|
||||
|
||||
if (zfs_spa_version == SPA_VERSION_15 ||
|
||||
zfs_spa_version == SPA_VERSION_14 ||
|
||||
zfs_spa_version == SPA_VERSION_13)
|
||||
cflag = ZFS_CMD_COMPAT_V15;
|
||||
}
|
||||
|
||||
oldsize = zc->zc_nvlist_dst_size;
|
||||
ret = zcmd_ioctl_compat(fd, request, zc, cflag);
|
||||
|
||||
if (ret == 0 && oldsize < zc->zc_nvlist_dst_size) {
|
||||
ret = -1;
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER SART
|
||||
*
|
||||
* 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 (c) 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _LIBZFS_COMPAT_H
|
||||
#define _LIBZFS_COMPAT_H
|
||||
|
||||
#include <zfs_ioctl_compat.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int get_zfs_ioctl_version(void);
|
||||
int zcmd_ioctl(int fd, int request, zfs_cmd_t *zc);
|
||||
|
||||
#define ioctl(fd, ioc, zc) zcmd_ioctl((fd), (ioc), (zc))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBZFS_COMPAT_H */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -23,12 +23,11 @@
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _LIBZFS_IMPL_H
|
||||
#define _LIBZFS_IMPL_H
|
||||
#ifndef _LIBFS_IMPL_H
|
||||
#define _LIBFS_IMPL_H
|
||||
|
||||
#include <sys/dmu.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
@@ -39,8 +38,8 @@
|
||||
#include <libshare.h>
|
||||
#include <libuutil.h>
|
||||
#include <libzfs.h>
|
||||
#include <libzfs_core.h>
|
||||
#include <libzfs_compat.h>
|
||||
|
||||
#include "zfs_ioctl_compat.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -70,6 +69,7 @@ struct libzfs_handle {
|
||||
int libzfs_desc_active;
|
||||
char libzfs_action[1024];
|
||||
char libzfs_desc[1024];
|
||||
char *libzfs_log_str;
|
||||
int libzfs_printerr;
|
||||
int libzfs_storeerr; /* stuff error messages into buffer */
|
||||
void *libzfs_sharehdl; /* libshare handle */
|
||||
@@ -191,8 +191,6 @@ int create_parents(libzfs_handle_t *, char *, int);
|
||||
boolean_t isa_child_of(const char *dataset, const char *parent);
|
||||
|
||||
zfs_handle_t *make_dataset_handle(libzfs_handle_t *, const char *);
|
||||
zfs_handle_t *make_bookmark_handle(zfs_handle_t *, const char *,
|
||||
nvlist_t *props);
|
||||
|
||||
int zpool_open_silent(libzfs_handle_t *, const char *, zpool_handle_t **);
|
||||
|
||||
@@ -216,8 +214,46 @@ extern int zfs_unshare_proto(zfs_handle_t *,
|
||||
|
||||
extern void libzfs_fru_clear(libzfs_handle_t *, boolean_t);
|
||||
|
||||
#ifndef sun
|
||||
static int zfs_kernel_version = 0;
|
||||
|
||||
/*
|
||||
* This is FreeBSD version of ioctl, because Solaris' ioctl() updates
|
||||
* zc_nvlist_dst_size even if an error is returned, on FreeBSD if an
|
||||
* error is returned zc_nvlist_dst_size won't be updated.
|
||||
*/
|
||||
static __inline int
|
||||
zcmd_ioctl(int fd, unsigned long cmd, zfs_cmd_t *zc)
|
||||
{
|
||||
size_t oldsize, zfs_kernel_version_size;
|
||||
int version, ret, cflag = ZFS_CMD_COMPAT_NONE;
|
||||
|
||||
zfs_kernel_version_size = sizeof(zfs_kernel_version);
|
||||
if (zfs_kernel_version == 0) {
|
||||
sysctlbyname("vfs.zfs.version.spa", &zfs_kernel_version,
|
||||
&zfs_kernel_version_size, NULL, 0);
|
||||
}
|
||||
|
||||
if (zfs_kernel_version == SPA_VERSION_15 ||
|
||||
zfs_kernel_version == SPA_VERSION_14 ||
|
||||
zfs_kernel_version == SPA_VERSION_13)
|
||||
cflag = ZFS_CMD_COMPAT_V15;
|
||||
|
||||
oldsize = zc->zc_nvlist_dst_size;
|
||||
ret = zcmd_ioctl_compat(fd, cmd, zc, cflag);
|
||||
|
||||
if (ret == 0 && oldsize < zc->zc_nvlist_dst_size) {
|
||||
ret = -1;
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
return (ret);
|
||||
}
|
||||
#define ioctl(fd, cmd, zc) zcmd_ioctl((fd), (cmd), (zc))
|
||||
#endif /* !sun */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBZFS_IMPL_H */
|
||||
#endif /* _LIBFS_IMPL_H */
|
||||
@@ -18,10 +18,9 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
@@ -195,10 +194,8 @@ fix_paths(nvlist_t *nv, name_entry_t *names)
|
||||
if ((devid = get_devid(best->ne_name)) == NULL) {
|
||||
(void) nvlist_remove_all(nv, ZPOOL_CONFIG_DEVID);
|
||||
} else {
|
||||
if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0) {
|
||||
devid_str_free(devid);
|
||||
if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0)
|
||||
return (-1);
|
||||
}
|
||||
devid_str_free(devid);
|
||||
}
|
||||
|
||||
@@ -664,10 +661,8 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
|
||||
nvlist_add_uint64(holey,
|
||||
ZPOOL_CONFIG_ID, c) != 0 ||
|
||||
nvlist_add_uint64(holey,
|
||||
ZPOOL_CONFIG_GUID, 0ULL) != 0) {
|
||||
nvlist_free(holey);
|
||||
ZPOOL_CONFIG_GUID, 0ULL) != 0)
|
||||
goto nomem;
|
||||
}
|
||||
child[c] = holey;
|
||||
}
|
||||
}
|
||||
@@ -1112,10 +1107,8 @@ zpool_clear_label(int fd)
|
||||
|
||||
for (l = 0; l < VDEV_LABELS; l++) {
|
||||
if (pwrite64(fd, label, sizeof (vdev_label_t),
|
||||
label_offset(size, l)) != sizeof (vdev_label_t)) {
|
||||
free(label);
|
||||
label_offset(size, l)) != sizeof (vdev_label_t))
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
free(label);
|
||||
@@ -1133,6 +1126,7 @@ static nvlist_t *
|
||||
zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
|
||||
{
|
||||
int i, dirs = iarg->paths;
|
||||
DIR *dirp = NULL;
|
||||
struct dirent64 *dp;
|
||||
char path[MAXPATHLEN];
|
||||
char *end, **dir = iarg->path;
|
||||
@@ -1162,8 +1156,6 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
|
||||
tpool_t *t;
|
||||
char *rdsk;
|
||||
int dfd;
|
||||
boolean_t config_failed = B_FALSE;
|
||||
DIR *dirp;
|
||||
|
||||
/* use realpath to normalize the path */
|
||||
if (realpath(dir[i], path) == 0) {
|
||||
@@ -1188,8 +1180,6 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
|
||||
|
||||
if ((dfd = open64(rdsk, O_RDONLY)) < 0 ||
|
||||
(dirp = fdopendir(dfd)) == NULL) {
|
||||
if (dfd >= 0)
|
||||
(void) close(dfd);
|
||||
zfs_error_aux(hdl, strerror(errno));
|
||||
(void) zfs_error_fmt(hdl, EZFS_BADPATH,
|
||||
dgettext(TEXT_DOMAIN, "cannot open '%s'"),
|
||||
@@ -1271,7 +1261,7 @@ skipdir:
|
||||
cookie = NULL;
|
||||
while ((slice = avl_destroy_nodes(&slice_cache,
|
||||
&cookie)) != NULL) {
|
||||
if (slice->rn_config != NULL && !config_failed) {
|
||||
if (slice->rn_config != NULL) {
|
||||
nvlist_t *config = slice->rn_config;
|
||||
boolean_t matched = B_TRUE;
|
||||
|
||||
@@ -1292,16 +1282,13 @@ skipdir:
|
||||
}
|
||||
if (!matched) {
|
||||
nvlist_free(config);
|
||||
} else {
|
||||
/*
|
||||
* use the non-raw path for the config
|
||||
*/
|
||||
(void) strlcpy(end, slice->rn_name,
|
||||
pathleft);
|
||||
if (add_config(hdl, &pools, path,
|
||||
config) != 0)
|
||||
config_failed = B_TRUE;
|
||||
config = NULL;
|
||||
continue;
|
||||
}
|
||||
/* use the non-raw path for the config */
|
||||
(void) strlcpy(end, slice->rn_name, pathleft);
|
||||
if (add_config(hdl, &pools, path, config) != 0)
|
||||
goto error;
|
||||
}
|
||||
free(slice->rn_name);
|
||||
free(slice);
|
||||
@@ -1309,9 +1296,7 @@ skipdir:
|
||||
avl_destroy(&slice_cache);
|
||||
|
||||
(void) closedir(dirp);
|
||||
|
||||
if (config_failed)
|
||||
goto error;
|
||||
dirp = NULL;
|
||||
}
|
||||
|
||||
ret = get_configs(hdl, &pools, iarg->can_be_active);
|
||||
@@ -1334,10 +1319,14 @@ error:
|
||||
|
||||
for (ne = pools.names; ne != NULL; ne = nenext) {
|
||||
nenext = ne->ne_next;
|
||||
free(ne->ne_name);
|
||||
if (ne->ne_name)
|
||||
free(ne->ne_name);
|
||||
free(ne);
|
||||
}
|
||||
|
||||
if (dirp)
|
||||
(void) closedir(dirp);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
@@ -1617,16 +1606,9 @@ zpool_in_use(libzfs_handle_t *hdl, int fd, pool_state_t *state, char **namestr,
|
||||
* its state to active.
|
||||
*/
|
||||
if (pool_active(hdl, name, guid, &isactive) == 0 && isactive &&
|
||||
(zhp = zpool_open_canfail(hdl, name)) != NULL) {
|
||||
if (zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL))
|
||||
stateval = POOL_STATE_ACTIVE;
|
||||
|
||||
/*
|
||||
* All we needed the zpool handle for is the
|
||||
* readonly prop check.
|
||||
*/
|
||||
zpool_close(zhp);
|
||||
}
|
||||
(zhp = zpool_open_canfail(hdl, name)) != NULL &&
|
||||
zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL))
|
||||
stateval = POOL_STATE_ACTIVE;
|
||||
|
||||
ret = B_TRUE;
|
||||
break;
|
||||
@@ -1701,9 +1683,9 @@ zpool_in_use(libzfs_handle_t *hdl, int fd, pool_state_t *state, char **namestr,
|
||||
cb.cb_type = ZPOOL_CONFIG_SPARES;
|
||||
if (zpool_iter(hdl, find_aux, &cb) == 1) {
|
||||
name = (char *)zpool_get_name(cb.cb_zhp);
|
||||
ret = B_TRUE;
|
||||
ret = TRUE;
|
||||
} else {
|
||||
ret = B_FALSE;
|
||||
ret = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1717,9 +1699,9 @@ zpool_in_use(libzfs_handle_t *hdl, int fd, pool_state_t *state, char **namestr,
|
||||
cb.cb_type = ZPOOL_CONFIG_L2CACHE;
|
||||
if (zpool_iter(hdl, find_aux, &cb) == 1) {
|
||||
name = (char *)zpool_get_name(cb.cb_zhp);
|
||||
ret = B_TRUE;
|
||||
ret = TRUE;
|
||||
} else {
|
||||
ret = B_FALSE;
|
||||
ret = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||
* All rights reserved.
|
||||
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -146,8 +146,7 @@ zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func,
|
||||
zfs_handle_t *nzhp;
|
||||
int ret;
|
||||
|
||||
if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT ||
|
||||
zhp->zfs_type == ZFS_TYPE_BOOKMARK)
|
||||
if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT)
|
||||
return (0);
|
||||
|
||||
zc.zc_simple = simple;
|
||||
@@ -173,59 +172,6 @@ zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func,
|
||||
return ((ret < 0) ? ret : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Iterate over all bookmarks
|
||||
*/
|
||||
int
|
||||
zfs_iter_bookmarks(zfs_handle_t *zhp, zfs_iter_f func, void *data)
|
||||
{
|
||||
zfs_handle_t *nzhp;
|
||||
nvlist_t *props = NULL;
|
||||
nvlist_t *bmarks = NULL;
|
||||
int err;
|
||||
|
||||
if ((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT | ZFS_TYPE_BOOKMARK)) != 0)
|
||||
return (0);
|
||||
|
||||
/* Setup the requested properties nvlist. */
|
||||
props = fnvlist_alloc();
|
||||
fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_GUID));
|
||||
fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATETXG));
|
||||
fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATION));
|
||||
|
||||
/* Allocate an nvlist to hold the bookmarks. */
|
||||
bmarks = fnvlist_alloc();
|
||||
|
||||
if ((err = lzc_get_bookmarks(zhp->zfs_name, props, &bmarks)) != 0)
|
||||
goto out;
|
||||
|
||||
for (nvpair_t *pair = nvlist_next_nvpair(bmarks, NULL);
|
||||
pair != NULL; pair = nvlist_next_nvpair(bmarks, pair)) {
|
||||
char name[ZFS_MAXNAMELEN];
|
||||
char *bmark_name;
|
||||
nvlist_t *bmark_props;
|
||||
|
||||
bmark_name = nvpair_name(pair);
|
||||
bmark_props = fnvpair_value_nvlist(pair);
|
||||
|
||||
(void) snprintf(name, sizeof (name), "%s#%s", zhp->zfs_name,
|
||||
bmark_name);
|
||||
|
||||
nzhp = make_bookmark_handle(zhp, name, bmark_props);
|
||||
if (nzhp == NULL)
|
||||
continue;
|
||||
|
||||
if ((err = func(nzhp, data)) != 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
fnvlist_free(props);
|
||||
fnvlist_free(bmarks);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
/*
|
||||
* Routines for dealing with the sorted snapshot functionality
|
||||
*/
|
||||
@@ -362,11 +308,12 @@ int
|
||||
zfs_iter_snapspec(zfs_handle_t *fs_zhp, const char *spec_orig,
|
||||
zfs_iter_f func, void *arg)
|
||||
{
|
||||
char *buf, *comma_separated, *cp;
|
||||
char buf[ZFS_MAXNAMELEN];
|
||||
char *comma_separated, *cp;
|
||||
int err = 0;
|
||||
int ret = 0;
|
||||
|
||||
buf = zfs_strdup(fs_zhp->zfs_hdl, spec_orig);
|
||||
(void) strlcpy(buf, spec_orig, sizeof (buf));
|
||||
cp = buf;
|
||||
|
||||
while ((comma_separated = strsep(&cp, ",")) != NULL) {
|
||||
@@ -424,7 +371,6 @@ zfs_iter_snapspec(zfs_handle_t *fs_zhp, const char *spec_orig,
|
||||
}
|
||||
}
|
||||
|
||||
free(buf);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
@@ -460,13 +406,13 @@ static int
|
||||
iter_dependents_cb(zfs_handle_t *zhp, void *arg)
|
||||
{
|
||||
iter_dependents_arg_t *ida = arg;
|
||||
int err = 0;
|
||||
int err;
|
||||
boolean_t first = ida->first;
|
||||
ida->first = B_FALSE;
|
||||
|
||||
if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
|
||||
err = zfs_iter_clones(zhp, iter_dependents_cb, ida);
|
||||
} else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) {
|
||||
} else {
|
||||
iter_stack_frame_t isf;
|
||||
iter_stack_frame_t *f;
|
||||
|
||||
@@ -506,12 +452,8 @@ iter_dependents_cb(zfs_handle_t *zhp, void *arg)
|
||||
}
|
||||
ida->stack = isf.next;
|
||||
}
|
||||
|
||||
if (!first && err == 0)
|
||||
err = ida->func(zhp, ida->data);
|
||||
else
|
||||
zfs_close(zhp);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -37,7 +36,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#include <sys/zfs_ioctl.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
@@ -443,9 +441,10 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
|
||||
prop = zpool_name_to_prop(propname);
|
||||
if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) {
|
||||
int err;
|
||||
zfeature_info_t *feature;
|
||||
char *fname = strchr(propname, '@') + 1;
|
||||
|
||||
err = zfeature_lookup_name(fname, NULL);
|
||||
err = zfeature_lookup_name(fname, &feature);
|
||||
if (err != 0) {
|
||||
ASSERT3U(err, ==, ENOENT);
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
@@ -838,14 +837,14 @@ zpool_prop_get_feature(zpool_handle_t *zhp, const char *propname, char *buf,
|
||||
*/
|
||||
if (supported) {
|
||||
int ret;
|
||||
spa_feature_t fid;
|
||||
zfeature_info_t *fi;
|
||||
|
||||
ret = zfeature_lookup_name(feature, &fid);
|
||||
ret = zfeature_lookup_name(feature, &fi);
|
||||
if (ret != 0) {
|
||||
(void) strlcpy(buf, "-", len);
|
||||
return (ENOTSUP);
|
||||
}
|
||||
feature = spa_feature_table[fid].fi_guid;
|
||||
feature = fi->fi_guid;
|
||||
}
|
||||
|
||||
if (nvlist_lookup_uint64(features, feature, &refcount) == 0)
|
||||
@@ -1112,6 +1111,7 @@ zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
|
||||
nvlist_t *zc_fsprops = NULL;
|
||||
nvlist_t *zc_props = NULL;
|
||||
char msg[1024];
|
||||
char *altroot;
|
||||
int ret = -1;
|
||||
|
||||
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
|
||||
@@ -1210,6 +1210,21 @@ zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If this is an alternate root pool, then we automatically set the
|
||||
* mountpoint of the root dataset to be '/'.
|
||||
*/
|
||||
if (nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT),
|
||||
&altroot) == 0) {
|
||||
zfs_handle_t *zhp;
|
||||
|
||||
verify((zhp = zfs_open(hdl, pool, ZFS_TYPE_DATASET)) != NULL);
|
||||
verify(zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT),
|
||||
"/") == 0);
|
||||
|
||||
zfs_close(zhp);
|
||||
}
|
||||
|
||||
create_failed:
|
||||
zcmd_free_nvlists(&zc);
|
||||
nvlist_free(zc_props);
|
||||
@@ -1222,7 +1237,7 @@ create_failed:
|
||||
* datasets left in the pool.
|
||||
*/
|
||||
int
|
||||
zpool_destroy(zpool_handle_t *zhp, const char *log_str)
|
||||
zpool_destroy(zpool_handle_t *zhp)
|
||||
{
|
||||
zfs_cmd_t zc = { 0 };
|
||||
zfs_handle_t *zfp = NULL;
|
||||
@@ -1234,7 +1249,6 @@ zpool_destroy(zpool_handle_t *zhp, const char *log_str)
|
||||
return (-1);
|
||||
|
||||
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
||||
zc.zc_history = (uint64_t)(uintptr_t)log_str;
|
||||
|
||||
if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) {
|
||||
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
|
||||
@@ -1389,9 +1403,8 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
|
||||
* Exports the pool from the system. The caller must ensure that there are no
|
||||
* mounted datasets in the pool.
|
||||
*/
|
||||
static int
|
||||
zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
|
||||
const char *log_str)
|
||||
int
|
||||
zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce)
|
||||
{
|
||||
zfs_cmd_t zc = { 0 };
|
||||
char msg[1024];
|
||||
@@ -1402,7 +1415,6 @@ zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
|
||||
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
||||
zc.zc_cookie = force;
|
||||
zc.zc_guid = hardforce;
|
||||
zc.zc_history = (uint64_t)(uintptr_t)log_str;
|
||||
|
||||
if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) {
|
||||
switch (errno) {
|
||||
@@ -1424,15 +1436,15 @@ zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
|
||||
}
|
||||
|
||||
int
|
||||
zpool_export(zpool_handle_t *zhp, boolean_t force, const char *log_str)
|
||||
zpool_export(zpool_handle_t *zhp, boolean_t force)
|
||||
{
|
||||
return (zpool_export_common(zhp, force, B_FALSE, log_str));
|
||||
return (zpool_export_common(zhp, force, B_FALSE));
|
||||
}
|
||||
|
||||
int
|
||||
zpool_export_force(zpool_handle_t *zhp, const char *log_str)
|
||||
zpool_export_force(zpool_handle_t *zhp)
|
||||
{
|
||||
return (zpool_export_common(zhp, B_TRUE, B_TRUE, log_str));
|
||||
return (zpool_export_common(zhp, B_TRUE, B_TRUE));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1691,7 +1703,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||
thename = origname;
|
||||
}
|
||||
|
||||
if (props != NULL) {
|
||||
if (props) {
|
||||
uint64_t version;
|
||||
prop_flags_t flags = { .create = B_FALSE, .import = B_TRUE };
|
||||
|
||||
@@ -1699,13 +1711,12 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||
&version) == 0);
|
||||
|
||||
if ((props = zpool_valid_proplist(hdl, origname,
|
||||
props, version, flags, errbuf)) == NULL)
|
||||
props, version, flags, errbuf)) == NULL) {
|
||||
return (-1);
|
||||
if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
|
||||
} else if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
|
||||
nvlist_free(props);
|
||||
return (-1);
|
||||
}
|
||||
nvlist_free(props);
|
||||
}
|
||||
|
||||
(void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name));
|
||||
@@ -1714,11 +1725,11 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||
&zc.zc_guid) == 0);
|
||||
|
||||
if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) {
|
||||
zcmd_free_nvlists(&zc);
|
||||
nvlist_free(props);
|
||||
return (-1);
|
||||
}
|
||||
if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) {
|
||||
zcmd_free_nvlists(&zc);
|
||||
nvlist_free(props);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -1734,9 +1745,6 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||
error = errno;
|
||||
|
||||
(void) zcmd_read_dst_nvlist(hdl, &zc, &nv);
|
||||
|
||||
zcmd_free_nvlists(&zc);
|
||||
|
||||
zpool_get_rewind_policy(config, &policy);
|
||||
|
||||
if (error) {
|
||||
@@ -1842,6 +1850,9 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||
return (0);
|
||||
}
|
||||
|
||||
zcmd_free_nvlists(&zc);
|
||||
nvlist_free(props);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
@@ -3303,10 +3314,8 @@ devid_to_path(char *devid_str)
|
||||
if (ret != 0)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* In a case the strdup() fails, we will just return NULL below.
|
||||
*/
|
||||
path = strdup(list[0].devname);
|
||||
if ((path = strdup(list[0].devname)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
devid_free_nmlist(list);
|
||||
|
||||
@@ -3623,30 +3632,40 @@ zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version)
|
||||
}
|
||||
|
||||
void
|
||||
zfs_save_arguments(int argc, char **argv, char *string, int len)
|
||||
zpool_set_history_str(const char *subcommand, int argc, char **argv,
|
||||
char *history_str)
|
||||
{
|
||||
(void) strlcpy(string, basename(argv[0]), len);
|
||||
for (int i = 1; i < argc; i++) {
|
||||
(void) strlcat(string, " ", len);
|
||||
(void) strlcat(string, argv[i], len);
|
||||
int i;
|
||||
|
||||
(void) strlcpy(history_str, subcommand, HIS_MAX_RECORD_LEN);
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strlen(history_str) + 1 + strlen(argv[i]) >
|
||||
HIS_MAX_RECORD_LEN)
|
||||
break;
|
||||
(void) strlcat(history_str, " ", HIS_MAX_RECORD_LEN);
|
||||
(void) strlcat(history_str, argv[i], HIS_MAX_RECORD_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Stage command history for logging.
|
||||
*/
|
||||
int
|
||||
zpool_log_history(libzfs_handle_t *hdl, const char *message)
|
||||
zpool_stage_history(libzfs_handle_t *hdl, const char *history_str)
|
||||
{
|
||||
zfs_cmd_t zc = { 0 };
|
||||
nvlist_t *args;
|
||||
int err;
|
||||
if (history_str == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
args = fnvlist_alloc();
|
||||
fnvlist_add_string(args, "message", message);
|
||||
err = zcmd_write_src_nvlist(hdl, &zc, args);
|
||||
if (err == 0)
|
||||
err = ioctl(hdl->libzfs_fd, ZFS_IOC_LOG_HISTORY, &zc);
|
||||
nvlist_free(args);
|
||||
zcmd_free_nvlists(&zc);
|
||||
return (err);
|
||||
if (strlen(history_str) > HIS_MAX_RECORD_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
if (hdl->libzfs_log_str != NULL)
|
||||
free(hdl->libzfs_log_str);
|
||||
|
||||
if ((hdl->libzfs_log_str = strdup(history_str)) == NULL)
|
||||
return (no_memory(hdl));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3739,9 +3758,7 @@ zpool_history_unpack(char *buf, uint64_t bytes_read, uint64_t *leftover,
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* from spa_history.c: spa_history_create_obj() */
|
||||
#define HIS_BUF_LEN_DEF (128 << 10)
|
||||
#define HIS_BUF_LEN_MAX (1 << 30)
|
||||
#define HIS_BUF_LEN (128*1024)
|
||||
|
||||
/*
|
||||
* Retrieve the command history of a pool.
|
||||
@@ -3749,24 +3766,21 @@ zpool_history_unpack(char *buf, uint64_t bytes_read, uint64_t *leftover,
|
||||
int
|
||||
zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp)
|
||||
{
|
||||
char *buf = NULL;
|
||||
uint64_t bufsize = HIS_BUF_LEN_DEF;
|
||||
char buf[HIS_BUF_LEN];
|
||||
uint64_t off = 0;
|
||||
nvlist_t **records = NULL;
|
||||
uint_t numrecords = 0;
|
||||
int err, i;
|
||||
|
||||
if ((buf = malloc(bufsize)) == NULL)
|
||||
return (ENOMEM);
|
||||
do {
|
||||
uint64_t bytes_read = bufsize;
|
||||
uint64_t bytes_read = sizeof (buf);
|
||||
uint64_t leftover;
|
||||
|
||||
if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0)
|
||||
break;
|
||||
|
||||
/* if nothing else was read in, we're at EOF, just return */
|
||||
if (bytes_read == 0)
|
||||
if (!bytes_read)
|
||||
break;
|
||||
|
||||
if ((err = zpool_history_unpack(buf, bytes_read,
|
||||
@@ -3774,25 +3788,8 @@ zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp)
|
||||
break;
|
||||
off -= leftover;
|
||||
|
||||
/*
|
||||
* If the history block is too big, double the buffer
|
||||
* size and try again.
|
||||
*/
|
||||
if (leftover == bytes_read) {
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
|
||||
bufsize <<= 1;
|
||||
if ((bufsize >= HIS_BUF_LEN_MAX) ||
|
||||
((buf = malloc(bufsize)) == NULL)) {
|
||||
err = ENOMEM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* CONSTCOND */
|
||||
} while (1);
|
||||
free(buf);
|
||||
|
||||
if (!err) {
|
||||
verify(nvlist_alloc(nvhisp, NV_UNIQUE_NAME, 0) == 0);
|
||||
@@ -4045,7 +4042,9 @@ supported_dump_vdev_type(libzfs_handle_t *hdl, nvlist_t *config, char *errbuf)
|
||||
uint_t children, c;
|
||||
|
||||
verify(nvlist_lookup_string(config, ZPOOL_CONFIG_TYPE, &type) == 0);
|
||||
if (strcmp(type, VDEV_TYPE_FILE) == 0 ||
|
||||
if (strcmp(type, VDEV_TYPE_RAIDZ) == 0 ||
|
||||
strcmp(type, VDEV_TYPE_FILE) == 0 ||
|
||||
strcmp(type, VDEV_TYPE_LOG) == 0 ||
|
||||
strcmp(type, VDEV_TYPE_HOLE) == 0 ||
|
||||
strcmp(type, VDEV_TYPE_MISSING) == 0) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
@@ -4064,12 +4063,8 @@ supported_dump_vdev_type(libzfs_handle_t *hdl, nvlist_t *config, char *errbuf)
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if this zvol is allowable for use as a dump device; zero if
|
||||
* it is, > 0 if it isn't, < 0 if it isn't a zvol.
|
||||
*
|
||||
* Allowable storage configurations include mirrors, all raidz variants, and
|
||||
* pools with log, cache, and spare devices. Pools which are backed by files or
|
||||
* have missing/hole vdevs are not suitable.
|
||||
* check if this zvol is allowable for use as a dump device; zero if
|
||||
* it is, > 0 if it isn't, < 0 if it isn't a zvol
|
||||
*/
|
||||
int
|
||||
zvol_check_dump_config(char *arg)
|
||||
@@ -4131,6 +4126,12 @@ zvol_check_dump_config(char *arg)
|
||||
|
||||
verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
|
||||
&top, &toplevels) == 0);
|
||||
if (toplevels != 1) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"'%s' has multiple top level vdevs"), poolname);
|
||||
(void) zfs_error(hdl, EZFS_DEVOVERFLOW, errbuf);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!supported_dump_vdev_type(hdl, top[0], errbuf)) {
|
||||
goto out;
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@@ -54,10 +53,6 @@
|
||||
#include <sys/zio_checksum.h>
|
||||
#include <sys/ddt.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
extern int zfs_ioctl_version;
|
||||
#endif
|
||||
|
||||
/* in libzfs_dataset.c */
|
||||
extern void zfs_setprop_error(libzfs_handle_t *, zfs_prop_t, int, char *);
|
||||
/* We need to use something for ENODATA. */
|
||||
@@ -732,7 +727,7 @@ send_iterate_fs(zfs_handle_t *zhp, void *arg)
|
||||
sd->parent_fromsnap_guid = 0;
|
||||
VERIFY(0 == nvlist_alloc(&sd->parent_snaps, NV_UNIQUE_NAME, 0));
|
||||
VERIFY(0 == nvlist_alloc(&sd->snapprops, NV_UNIQUE_NAME, 0));
|
||||
(void) zfs_iter_snapshots_sorted(zhp, send_iterate_snap, sd);
|
||||
(void) zfs_iter_snapshots(zhp, B_FALSE, send_iterate_snap, sd);
|
||||
VERIFY(0 == nvlist_add_nvlist(nvfs, "snaps", sd->parent_snaps));
|
||||
VERIFY(0 == nvlist_add_nvlist(nvfs, "snapprops", sd->snapprops));
|
||||
nvlist_free(sd->parent_snaps);
|
||||
@@ -803,7 +798,6 @@ typedef struct send_dump_data {
|
||||
int outfd;
|
||||
boolean_t err;
|
||||
nvlist_t *fss;
|
||||
nvlist_t *snapholds;
|
||||
avl_tree_t *fsavl;
|
||||
snapfilter_cb_t *filter_cb;
|
||||
void *filter_cb_arg;
|
||||
@@ -954,19 +948,43 @@ dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
gather_holds(zfs_handle_t *zhp, send_dump_data_t *sdd)
|
||||
static int
|
||||
hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd)
|
||||
{
|
||||
zfs_handle_t *pzhp;
|
||||
int error = 0;
|
||||
char *thissnap;
|
||||
|
||||
assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
|
||||
|
||||
if (sdd->dryrun)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* zfs_send() only sets snapholds for sends that need them,
|
||||
* zfs_send() only opens a cleanup_fd for sends that need it,
|
||||
* e.g. replication and doall.
|
||||
*/
|
||||
if (sdd->snapholds == NULL)
|
||||
return;
|
||||
if (sdd->cleanup_fd == -1)
|
||||
return (0);
|
||||
|
||||
fnvlist_add_string(sdd->snapholds, zhp->zfs_name, sdd->holdtag);
|
||||
thissnap = strchr(zhp->zfs_name, '@') + 1;
|
||||
*(thissnap - 1) = '\0';
|
||||
pzhp = zfs_open(zhp->zfs_hdl, zhp->zfs_name, ZFS_TYPE_DATASET);
|
||||
*(thissnap - 1) = '@';
|
||||
|
||||
/*
|
||||
* It's OK if the parent no longer exists. The send code will
|
||||
* handle that error.
|
||||
*/
|
||||
if (pzhp) {
|
||||
error = zfs_hold(pzhp, thissnap, sdd->holdtag,
|
||||
B_FALSE, B_TRUE, B_TRUE, sdd->cleanup_fd,
|
||||
zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID),
|
||||
zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG));
|
||||
zfs_close(pzhp);
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
static void *
|
||||
@@ -1022,23 +1040,28 @@ dump_snapshot(zfs_handle_t *zhp, void *arg)
|
||||
send_dump_data_t *sdd = arg;
|
||||
progress_arg_t pa = { 0 };
|
||||
pthread_t tid;
|
||||
|
||||
char *thissnap;
|
||||
int err;
|
||||
boolean_t isfromsnap, istosnap, fromorigin;
|
||||
boolean_t exclude = B_FALSE;
|
||||
|
||||
err = 0;
|
||||
thissnap = strchr(zhp->zfs_name, '@') + 1;
|
||||
isfromsnap = (sdd->fromsnap != NULL &&
|
||||
strcmp(sdd->fromsnap, thissnap) == 0);
|
||||
|
||||
if (!sdd->seenfrom && isfromsnap) {
|
||||
gather_holds(zhp, sdd);
|
||||
sdd->seenfrom = B_TRUE;
|
||||
(void) strcpy(sdd->prevsnap, thissnap);
|
||||
sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
|
||||
err = hold_for_send(zhp, sdd);
|
||||
if (err == 0) {
|
||||
sdd->seenfrom = B_TRUE;
|
||||
(void) strcpy(sdd->prevsnap, thissnap);
|
||||
sdd->prevsnap_obj = zfs_prop_get_int(zhp,
|
||||
ZFS_PROP_OBJSETID);
|
||||
} else if (err == ENOENT) {
|
||||
err = 0;
|
||||
}
|
||||
zfs_close(zhp);
|
||||
return (0);
|
||||
return (err);
|
||||
}
|
||||
|
||||
if (sdd->seento || !sdd->seenfrom) {
|
||||
@@ -1089,7 +1112,14 @@ dump_snapshot(zfs_handle_t *zhp, void *arg)
|
||||
return (0);
|
||||
}
|
||||
|
||||
gather_holds(zhp, sdd);
|
||||
err = hold_for_send(zhp, sdd);
|
||||
if (err) {
|
||||
if (err == ENOENT)
|
||||
err = 0;
|
||||
zfs_close(zhp);
|
||||
return (err);
|
||||
}
|
||||
|
||||
fromorigin = sdd->prevsnap[0] == '\0' &&
|
||||
(sdd->fromorigin || sdd->replicate);
|
||||
|
||||
@@ -1357,7 +1387,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
avl_tree_t *fsavl = NULL;
|
||||
static uint64_t holdseq;
|
||||
int spa_version;
|
||||
pthread_t tid = 0;
|
||||
pthread_t tid;
|
||||
int pipefd[2];
|
||||
dedup_arg_t dda = { 0 };
|
||||
int featureflags = 0;
|
||||
@@ -1430,8 +1460,11 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
*debugnvp = hdrnv;
|
||||
else
|
||||
nvlist_free(hdrnv);
|
||||
if (err)
|
||||
if (err) {
|
||||
fsavl_destroy(fsavl);
|
||||
nvlist_free(fss);
|
||||
goto stderr_out;
|
||||
}
|
||||
}
|
||||
|
||||
if (!flags->dryrun) {
|
||||
@@ -1455,6 +1488,8 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
}
|
||||
free(packbuf);
|
||||
if (err == -1) {
|
||||
fsavl_destroy(fsavl);
|
||||
nvlist_free(fss);
|
||||
err = errno;
|
||||
goto stderr_out;
|
||||
}
|
||||
@@ -1465,6 +1500,8 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
drr.drr_u.drr_end.drr_checksum = zc;
|
||||
err = write(outfd, &drr, sizeof (drr));
|
||||
if (err == -1) {
|
||||
fsavl_destroy(fsavl);
|
||||
nvlist_free(fss);
|
||||
err = errno;
|
||||
goto stderr_out;
|
||||
}
|
||||
@@ -1476,7 +1513,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
/* dump each stream */
|
||||
sdd.fromsnap = fromsnap;
|
||||
sdd.tosnap = tosnap;
|
||||
if (tid != 0)
|
||||
if (flags->dedup)
|
||||
sdd.outfd = pipefd[0];
|
||||
else
|
||||
sdd.outfd = outfd;
|
||||
@@ -1513,69 +1550,34 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
err = errno;
|
||||
goto stderr_out;
|
||||
}
|
||||
sdd.snapholds = fnvlist_alloc();
|
||||
} else {
|
||||
sdd.cleanup_fd = -1;
|
||||
sdd.snapholds = NULL;
|
||||
}
|
||||
if (flags->verbose || sdd.snapholds != NULL) {
|
||||
if (flags->verbose) {
|
||||
/*
|
||||
* Do a verbose no-op dry run to get all the verbose output
|
||||
* or to gather snapshot hold's before generating any data,
|
||||
* then do a non-verbose real run to generate the streams.
|
||||
* before generating any data. Then do a non-verbose real
|
||||
* run to generate the streams.
|
||||
*/
|
||||
sdd.dryrun = B_TRUE;
|
||||
err = dump_filesystems(zhp, &sdd);
|
||||
|
||||
if (err != 0)
|
||||
goto stderr_out;
|
||||
|
||||
if (flags->verbose) {
|
||||
if (flags->parsable) {
|
||||
(void) fprintf(stderr, "size\t%llu\n",
|
||||
(longlong_t)sdd.size);
|
||||
} else {
|
||||
char buf[16];
|
||||
zfs_nicenum(sdd.size, buf, sizeof (buf));
|
||||
(void) fprintf(stderr, dgettext(TEXT_DOMAIN,
|
||||
"total estimated size is %s\n"), buf);
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure no snaps found is treated as an error. */
|
||||
if (!sdd.seento) {
|
||||
err = ENOENT;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
/* Skip the second run if dryrun was requested. */
|
||||
if (flags->dryrun)
|
||||
goto err_out;
|
||||
|
||||
if (sdd.snapholds != NULL) {
|
||||
err = zfs_hold_nvl(zhp, sdd.cleanup_fd, sdd.snapholds);
|
||||
if (err != 0)
|
||||
goto stderr_out;
|
||||
|
||||
fnvlist_free(sdd.snapholds);
|
||||
sdd.snapholds = NULL;
|
||||
}
|
||||
|
||||
sdd.dryrun = B_FALSE;
|
||||
sdd.dryrun = flags->dryrun;
|
||||
sdd.verbose = B_FALSE;
|
||||
if (flags->parsable) {
|
||||
(void) fprintf(stderr, "size\t%llu\n",
|
||||
(longlong_t)sdd.size);
|
||||
} else {
|
||||
char buf[16];
|
||||
zfs_nicenum(sdd.size, buf, sizeof (buf));
|
||||
(void) fprintf(stderr, dgettext(TEXT_DOMAIN,
|
||||
"total estimated size is %s\n"), buf);
|
||||
}
|
||||
}
|
||||
|
||||
err = dump_filesystems(zhp, &sdd);
|
||||
fsavl_destroy(fsavl);
|
||||
nvlist_free(fss);
|
||||
|
||||
/* Ensure no snaps found is treated as an error. */
|
||||
if (err == 0 && !sdd.seento)
|
||||
err = ENOENT;
|
||||
|
||||
if (tid != 0) {
|
||||
if (err != 0)
|
||||
(void) pthread_cancel(tid);
|
||||
if (flags->dedup) {
|
||||
(void) close(pipefd[0]);
|
||||
(void) pthread_join(tid, NULL);
|
||||
}
|
||||
@@ -1605,76 +1607,16 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
stderr_out:
|
||||
err = zfs_standard_error(zhp->zfs_hdl, err, errbuf);
|
||||
err_out:
|
||||
fsavl_destroy(fsavl);
|
||||
nvlist_free(fss);
|
||||
fnvlist_free(sdd.snapholds);
|
||||
|
||||
if (sdd.cleanup_fd != -1)
|
||||
VERIFY(0 == close(sdd.cleanup_fd));
|
||||
if (tid != 0) {
|
||||
if (flags->dedup) {
|
||||
(void) pthread_cancel(tid);
|
||||
(void) close(pipefd[0]);
|
||||
(void) pthread_join(tid, NULL);
|
||||
(void) close(pipefd[0]);
|
||||
}
|
||||
return (err);
|
||||
}
|
||||
|
||||
int
|
||||
zfs_send_one(zfs_handle_t *zhp, const char *from, int fd)
|
||||
{
|
||||
int err;
|
||||
libzfs_handle_t *hdl = zhp->zfs_hdl;
|
||||
|
||||
char errbuf[1024];
|
||||
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
|
||||
"warning: cannot send '%s'"), zhp->zfs_name);
|
||||
|
||||
err = lzc_send(zhp->zfs_name, from, fd);
|
||||
if (err != 0) {
|
||||
switch (errno) {
|
||||
case EXDEV:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"not an earlier snapshot from the same fs"));
|
||||
return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf));
|
||||
|
||||
case ENOENT:
|
||||
case ESRCH:
|
||||
if (lzc_exists(zhp->zfs_name)) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"incremental source (%s) does not exist"),
|
||||
from);
|
||||
}
|
||||
return (zfs_error(hdl, EZFS_NOENT, errbuf));
|
||||
|
||||
case EBUSY:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"target is busy; if a filesystem, "
|
||||
"it must not be mounted"));
|
||||
return (zfs_error(hdl, EZFS_BUSY, errbuf));
|
||||
|
||||
case EDQUOT:
|
||||
case EFBIG:
|
||||
case EIO:
|
||||
case ENOLINK:
|
||||
case ENOSPC:
|
||||
#ifdef illumos
|
||||
case ENOSTR:
|
||||
#endif
|
||||
case ENXIO:
|
||||
case EPIPE:
|
||||
case ERANGE:
|
||||
case EFAULT:
|
||||
case EROFS:
|
||||
zfs_error_aux(hdl, strerror(errno));
|
||||
return (zfs_error(hdl, EZFS_BADBACKUP, errbuf));
|
||||
|
||||
default:
|
||||
return (zfs_standard_error(hdl, errno, errbuf));
|
||||
}
|
||||
}
|
||||
return (err != 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Routines specific to "zfs recv"
|
||||
*/
|
||||
@@ -1777,11 +1719,12 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
|
||||
err = ENOENT;
|
||||
}
|
||||
|
||||
if (err != 0 && strncmp(name + baselen, "recv-", 5) != 0) {
|
||||
if (err != 0 && strncmp(name+baselen, "recv-", 5) != 0) {
|
||||
seq++;
|
||||
|
||||
(void) snprintf(newname, ZFS_MAXNAMELEN, "%.*srecv-%u-%u",
|
||||
baselen, name, getpid(), seq);
|
||||
(void) strncpy(newname, name, baselen);
|
||||
(void) snprintf(newname+baselen, ZFS_MAXNAMELEN-baselen,
|
||||
"recv-%u-%u", getpid(), seq);
|
||||
(void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value));
|
||||
|
||||
if (flags->verbose) {
|
||||
@@ -2002,12 +1945,11 @@ recv_incremental_replication(libzfs_handle_t *hdl, const char *tofs,
|
||||
recvflags_t *flags, nvlist_t *stream_nv, avl_tree_t *stream_avl,
|
||||
nvlist_t *renamed)
|
||||
{
|
||||
nvlist_t *local_nv, *deleted = NULL;
|
||||
nvlist_t *local_nv;
|
||||
avl_tree_t *local_avl;
|
||||
nvpair_t *fselem, *nextfselem;
|
||||
char *fromsnap;
|
||||
char newname[ZFS_MAXNAMELEN];
|
||||
char guidname[32];
|
||||
int error;
|
||||
boolean_t needagain, progress, recursive;
|
||||
char *s1, *s2;
|
||||
@@ -2023,8 +1965,6 @@ recv_incremental_replication(libzfs_handle_t *hdl, const char *tofs,
|
||||
again:
|
||||
needagain = progress = B_FALSE;
|
||||
|
||||
VERIFY(0 == nvlist_alloc(&deleted, NV_UNIQUE_NAME, 0));
|
||||
|
||||
if ((error = gather_nvlist(hdl, tofs, fromsnap, NULL,
|
||||
recursive, &local_nv, &local_avl)) != 0)
|
||||
return (error);
|
||||
@@ -2139,8 +2079,6 @@ again:
|
||||
needagain = B_TRUE;
|
||||
else
|
||||
progress = B_TRUE;
|
||||
sprintf(guidname, "%lu", thisguid);
|
||||
nvlist_add_boolean(deleted, guidname);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2196,8 +2134,6 @@ again:
|
||||
needagain = B_TRUE;
|
||||
else
|
||||
progress = B_TRUE;
|
||||
sprintf(guidname, "%lu", parent_fromsnap_guid);
|
||||
nvlist_add_boolean(deleted, guidname);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2219,24 +2155,6 @@ again:
|
||||
s1 = strrchr(fsname, '/');
|
||||
s2 = strrchr(stream_fsname, '/');
|
||||
|
||||
/*
|
||||
* Check if we're going to rename based on parent guid change
|
||||
* and the current parent guid was also deleted. If it was then
|
||||
* rename will fail and is likely unneeded, so avoid this and
|
||||
* force an early retry to determine the new
|
||||
* parent_fromsnap_guid.
|
||||
*/
|
||||
if (stream_parent_fromsnap_guid != 0 &&
|
||||
parent_fromsnap_guid != 0 &&
|
||||
stream_parent_fromsnap_guid != parent_fromsnap_guid) {
|
||||
sprintf(guidname, "%lu", parent_fromsnap_guid);
|
||||
if (nvlist_exists(deleted, guidname)) {
|
||||
progress = B_TRUE;
|
||||
needagain = B_TRUE;
|
||||
goto doagain;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for rename. If the exact receive path is specified, it
|
||||
* does not count as a rename, but we still need to check the
|
||||
@@ -2291,10 +2209,8 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
doagain:
|
||||
fsavl_destroy(local_avl);
|
||||
nvlist_free(local_nv);
|
||||
nvlist_free(deleted);
|
||||
|
||||
if (needagain && progress) {
|
||||
/* do another pass to fix up temporary names */
|
||||
@@ -2733,17 +2649,9 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||
/*
|
||||
* Determine name of destination snapshot, store in zc_value.
|
||||
*/
|
||||
(void) strcpy(zc.zc_top_ds, tosnap);
|
||||
(void) strcpy(zc.zc_value, tosnap);
|
||||
(void) strncat(zc.zc_value, chopprefix, sizeof (zc.zc_value));
|
||||
#ifdef __FreeBSD__
|
||||
if (zfs_ioctl_version == ZFS_IOCVER_UNDEF)
|
||||
zfs_ioctl_version = get_zfs_ioctl_version();
|
||||
/*
|
||||
* For forward compatibility hide tosnap in zc_value
|
||||
*/
|
||||
if (zfs_ioctl_version < ZFS_IOCVER_LZC)
|
||||
(void) strcpy(zc.zc_value + strlen(zc.zc_value) + 1, tosnap);
|
||||
#endif
|
||||
free(cp);
|
||||
if (!zfs_name_valid(zc.zc_value, ZFS_TYPE_SNAPSHOT)) {
|
||||
zcmd_free_nvlists(&zc);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -73,66 +72,57 @@ static char *zfs_msgid_table[] = {
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
vdev_missing(vdev_stat_t *vs, uint_t vsc)
|
||||
vdev_missing(uint64_t state, uint64_t aux, uint64_t errs)
|
||||
{
|
||||
return (vs->vs_state == VDEV_STATE_CANT_OPEN &&
|
||||
vs->vs_aux == VDEV_AUX_OPEN_FAILED);
|
||||
return (state == VDEV_STATE_CANT_OPEN &&
|
||||
aux == VDEV_AUX_OPEN_FAILED);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
vdev_faulted(vdev_stat_t *vs, uint_t vsc)
|
||||
vdev_faulted(uint64_t state, uint64_t aux, uint64_t errs)
|
||||
{
|
||||
return (vs->vs_state == VDEV_STATE_FAULTED);
|
||||
return (state == VDEV_STATE_FAULTED);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
vdev_errors(vdev_stat_t *vs, uint_t vsc)
|
||||
vdev_errors(uint64_t state, uint64_t aux, uint64_t errs)
|
||||
{
|
||||
return (vs->vs_state == VDEV_STATE_DEGRADED ||
|
||||
vs->vs_read_errors != 0 || vs->vs_write_errors != 0 ||
|
||||
vs->vs_checksum_errors != 0);
|
||||
return (state == VDEV_STATE_DEGRADED || errs != 0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
vdev_broken(vdev_stat_t *vs, uint_t vsc)
|
||||
vdev_broken(uint64_t state, uint64_t aux, uint64_t errs)
|
||||
{
|
||||
return (vs->vs_state == VDEV_STATE_CANT_OPEN);
|
||||
return (state == VDEV_STATE_CANT_OPEN);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
vdev_offlined(vdev_stat_t *vs, uint_t vsc)
|
||||
vdev_offlined(uint64_t state, uint64_t aux, uint64_t errs)
|
||||
{
|
||||
return (vs->vs_state == VDEV_STATE_OFFLINE);
|
||||
return (state == VDEV_STATE_OFFLINE);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
vdev_removed(vdev_stat_t *vs, uint_t vsc)
|
||||
vdev_removed(uint64_t state, uint64_t aux, uint64_t errs)
|
||||
{
|
||||
return (vs->vs_state == VDEV_STATE_REMOVED);
|
||||
}
|
||||
|
||||
static int
|
||||
vdev_non_native_ashift(vdev_stat_t *vs, uint_t vsc)
|
||||
{
|
||||
return (VDEV_STAT_VALID(vs_physical_ashift, vsc) &&
|
||||
vs->vs_configured_ashift < vs->vs_physical_ashift);
|
||||
return (state == VDEV_STATE_REMOVED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Detect if any leaf devices that have seen errors or could not be opened.
|
||||
*/
|
||||
static boolean_t
|
||||
find_vdev_problem(nvlist_t *vdev, int (*func)(vdev_stat_t *, uint_t),
|
||||
boolean_t ignore_replacing)
|
||||
find_vdev_problem(nvlist_t *vdev, int (*func)(uint64_t, uint64_t, uint64_t))
|
||||
{
|
||||
nvlist_t **child;
|
||||
vdev_stat_t *vs;
|
||||
uint_t c, vsc, children;
|
||||
uint_t c, children;
|
||||
char *type;
|
||||
|
||||
/*
|
||||
* Ignore problems within a 'replacing' vdev, since we're presumably in
|
||||
@@ -140,38 +130,26 @@ find_vdev_problem(nvlist_t *vdev, int (*func)(vdev_stat_t *, uint_t),
|
||||
* out again. We'll pick up the fact that a resilver is happening
|
||||
* later.
|
||||
*/
|
||||
if (ignore_replacing == B_TRUE) {
|
||||
char *type;
|
||||
|
||||
verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE,
|
||||
&type) == 0);
|
||||
if (strcmp(type, VDEV_TYPE_REPLACING) == 0)
|
||||
return (B_FALSE);
|
||||
}
|
||||
verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0);
|
||||
if (strcmp(type, VDEV_TYPE_REPLACING) == 0)
|
||||
return (B_FALSE);
|
||||
|
||||
if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child,
|
||||
&children) == 0) {
|
||||
for (c = 0; c < children; c++)
|
||||
if (find_vdev_problem(child[c], func, ignore_replacing))
|
||||
if (find_vdev_problem(child[c], func))
|
||||
return (B_TRUE);
|
||||
} else {
|
||||
verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS,
|
||||
(uint64_t **)&vs, &vsc) == 0);
|
||||
(uint64_t **)&vs, &c) == 0);
|
||||
|
||||
if (func(vs, vsc) != 0)
|
||||
if (func(vs->vs_state, vs->vs_aux,
|
||||
vs->vs_read_errors +
|
||||
vs->vs_write_errors +
|
||||
vs->vs_checksum_errors))
|
||||
return (B_TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check any L2 cache devs
|
||||
*/
|
||||
if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child,
|
||||
&children) == 0) {
|
||||
for (c = 0; c < children; c++)
|
||||
if (find_vdev_problem(child[c], func, ignore_replacing))
|
||||
return (B_TRUE);
|
||||
}
|
||||
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
@@ -281,15 +259,15 @@ check_status(nvlist_t *config, boolean_t isimport)
|
||||
* Bad devices in non-replicated config.
|
||||
*/
|
||||
if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
|
||||
find_vdev_problem(nvroot, vdev_faulted, B_TRUE))
|
||||
find_vdev_problem(nvroot, vdev_faulted))
|
||||
return (ZPOOL_STATUS_FAULTED_DEV_NR);
|
||||
|
||||
if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
|
||||
find_vdev_problem(nvroot, vdev_missing, B_TRUE))
|
||||
find_vdev_problem(nvroot, vdev_missing))
|
||||
return (ZPOOL_STATUS_MISSING_DEV_NR);
|
||||
|
||||
if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
|
||||
find_vdev_problem(nvroot, vdev_broken, B_TRUE))
|
||||
find_vdev_problem(nvroot, vdev_broken))
|
||||
return (ZPOOL_STATUS_CORRUPT_LABEL_NR);
|
||||
|
||||
/*
|
||||
@@ -311,37 +289,31 @@ check_status(nvlist_t *config, boolean_t isimport)
|
||||
/*
|
||||
* Missing devices in a replicated config.
|
||||
*/
|
||||
if (find_vdev_problem(nvroot, vdev_faulted, B_TRUE))
|
||||
if (find_vdev_problem(nvroot, vdev_faulted))
|
||||
return (ZPOOL_STATUS_FAULTED_DEV_R);
|
||||
if (find_vdev_problem(nvroot, vdev_missing, B_TRUE))
|
||||
if (find_vdev_problem(nvroot, vdev_missing))
|
||||
return (ZPOOL_STATUS_MISSING_DEV_R);
|
||||
if (find_vdev_problem(nvroot, vdev_broken, B_TRUE))
|
||||
if (find_vdev_problem(nvroot, vdev_broken))
|
||||
return (ZPOOL_STATUS_CORRUPT_LABEL_R);
|
||||
|
||||
/*
|
||||
* Devices with errors
|
||||
*/
|
||||
if (!isimport && find_vdev_problem(nvroot, vdev_errors, B_TRUE))
|
||||
if (!isimport && find_vdev_problem(nvroot, vdev_errors))
|
||||
return (ZPOOL_STATUS_FAILING_DEV);
|
||||
|
||||
/*
|
||||
* Offlined devices
|
||||
*/
|
||||
if (find_vdev_problem(nvroot, vdev_offlined, B_TRUE))
|
||||
if (find_vdev_problem(nvroot, vdev_offlined))
|
||||
return (ZPOOL_STATUS_OFFLINE_DEV);
|
||||
|
||||
/*
|
||||
* Removed device
|
||||
*/
|
||||
if (find_vdev_problem(nvroot, vdev_removed, B_TRUE))
|
||||
if (find_vdev_problem(nvroot, vdev_removed))
|
||||
return (ZPOOL_STATUS_REMOVED_DEV);
|
||||
|
||||
/*
|
||||
* Suboptimal, but usable, ashift configuration.
|
||||
*/
|
||||
if (find_vdev_problem(nvroot, vdev_non_native_ashift, B_FALSE))
|
||||
return (ZPOOL_STATUS_NON_NATIVE_ASHIFT);
|
||||
|
||||
/*
|
||||
* Outdated, but usable, version
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <libzfs.h>
|
||||
#include <libzfs_core.h>
|
||||
|
||||
#include "libzfs_impl.h"
|
||||
#include "zfs_prop.h"
|
||||
@@ -658,14 +657,6 @@ libzfs_init(void)
|
||||
|
||||
hdl->libzfs_sharetab = fopen(ZFS_EXPORTS_PATH, "r");
|
||||
|
||||
if (libzfs_core_init() != 0) {
|
||||
(void) close(hdl->libzfs_fd);
|
||||
(void) fclose(hdl->libzfs_mnttab);
|
||||
(void) fclose(hdl->libzfs_sharetab);
|
||||
free(hdl);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
zfs_prop_init();
|
||||
zpool_prop_init();
|
||||
zpool_feature_init();
|
||||
@@ -683,13 +674,14 @@ libzfs_fini(libzfs_handle_t *hdl)
|
||||
if (hdl->libzfs_sharetab)
|
||||
(void) fclose(hdl->libzfs_sharetab);
|
||||
zfs_uninit_libshare(hdl);
|
||||
if (hdl->libzfs_log_str)
|
||||
(void) free(hdl->libzfs_log_str);
|
||||
zpool_free_handles(hdl);
|
||||
#ifdef sun
|
||||
libzfs_fru_clear(hdl, B_TRUE);
|
||||
#endif
|
||||
namespace_clear(hdl);
|
||||
libzfs_mnttab_fini(hdl);
|
||||
libzfs_core_fini();
|
||||
free(hdl);
|
||||
}
|
||||
|
||||
@@ -863,9 +855,19 @@ zcmd_read_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, nvlist_t **nvlp)
|
||||
}
|
||||
|
||||
int
|
||||
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
|
||||
zfs_ioctl(libzfs_handle_t *hdl, unsigned long request, zfs_cmd_t *zc)
|
||||
{
|
||||
return (ioctl(hdl->libzfs_fd, request, zc));
|
||||
int error;
|
||||
|
||||
zc->zc_history = (uint64_t)(uintptr_t)hdl->libzfs_log_str;
|
||||
error = ioctl(hdl->libzfs_fd, request, zc);
|
||||
if (hdl->libzfs_log_str) {
|
||||
free(hdl->libzfs_log_str);
|
||||
hdl->libzfs_log_str = NULL;
|
||||
}
|
||||
zc->zc_history = 0;
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,760 +0,0 @@
|
||||
/*
|
||||
* 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 (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* LibZFS_Core (lzc) is intended to replace most functionality in libzfs.
|
||||
* It has the following characteristics:
|
||||
*
|
||||
* - Thread Safe. libzfs_core is accessible concurrently from multiple
|
||||
* threads. This is accomplished primarily by avoiding global data
|
||||
* (e.g. caching). Since it's thread-safe, there is no reason for a
|
||||
* process to have multiple libzfs "instances". Therefore, we store
|
||||
* our few pieces of data (e.g. the file descriptor) in global
|
||||
* variables. The fd is reference-counted so that the libzfs_core
|
||||
* library can be "initialized" multiple times (e.g. by different
|
||||
* consumers within the same process).
|
||||
*
|
||||
* - Committed Interface. The libzfs_core interface will be committed,
|
||||
* therefore consumers can compile against it and be confident that
|
||||
* their code will continue to work on future releases of this code.
|
||||
* Currently, the interface is Evolving (not Committed), but we intend
|
||||
* to commit to it once it is more complete and we determine that it
|
||||
* meets the needs of all consumers.
|
||||
*
|
||||
* - Programatic Error Handling. libzfs_core communicates errors with
|
||||
* defined error numbers, and doesn't print anything to stdout/stderr.
|
||||
*
|
||||
* - Thin Layer. libzfs_core is a thin layer, marshaling arguments
|
||||
* to/from the kernel ioctls. There is generally a 1:1 correspondence
|
||||
* between libzfs_core functions and ioctls to /dev/zfs.
|
||||
*
|
||||
* - Clear Atomicity. Because libzfs_core functions are generally 1:1
|
||||
* with kernel ioctls, and kernel ioctls are general atomic, each
|
||||
* libzfs_core function is atomic. For example, creating multiple
|
||||
* snapshots with a single call to lzc_snapshot() is atomic -- it
|
||||
* can't fail with only some of the requested snapshots created, even
|
||||
* in the event of power loss or system crash.
|
||||
*
|
||||
* - Continued libzfs Support. Some higher-level operations (e.g.
|
||||
* support for "zfs send -R") are too complicated to fit the scope of
|
||||
* libzfs_core. This functionality will continue to live in libzfs.
|
||||
* Where appropriate, libzfs will use the underlying atomic operations
|
||||
* of libzfs_core. For example, libzfs may implement "zfs send -R |
|
||||
* zfs receive" by using individual "send one snapshot", rename,
|
||||
* destroy, and "receive one snapshot" operations in libzfs_core.
|
||||
* /sbin/zfs and /zbin/zpool will link with both libzfs and
|
||||
* libzfs_core. Other consumers should aim to use only libzfs_core,
|
||||
* since that will be the supported, stable interface going forwards.
|
||||
*/
|
||||
|
||||
#define _IN_LIBZFS_CORE_
|
||||
|
||||
#include <libzfs_core.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/nvpair.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/zfs_ioctl.h>
|
||||
#include "libzfs_core_compat.h"
|
||||
#include "libzfs_compat.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
extern int zfs_ioctl_version;
|
||||
#endif
|
||||
|
||||
static int g_fd;
|
||||
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static int g_refcount;
|
||||
|
||||
int
|
||||
libzfs_core_init(void)
|
||||
{
|
||||
(void) pthread_mutex_lock(&g_lock);
|
||||
if (g_refcount == 0) {
|
||||
g_fd = open("/dev/zfs", O_RDWR);
|
||||
if (g_fd < 0) {
|
||||
(void) pthread_mutex_unlock(&g_lock);
|
||||
return (errno);
|
||||
}
|
||||
}
|
||||
g_refcount++;
|
||||
(void) pthread_mutex_unlock(&g_lock);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
libzfs_core_fini(void)
|
||||
{
|
||||
(void) pthread_mutex_lock(&g_lock);
|
||||
ASSERT3S(g_refcount, >, 0);
|
||||
g_refcount--;
|
||||
if (g_refcount == 0)
|
||||
(void) close(g_fd);
|
||||
(void) pthread_mutex_unlock(&g_lock);
|
||||
}
|
||||
|
||||
static int
|
||||
lzc_ioctl(zfs_ioc_t ioc, const char *name,
|
||||
nvlist_t *source, nvlist_t **resultp)
|
||||
{
|
||||
zfs_cmd_t zc = { 0 };
|
||||
int error = 0;
|
||||
char *packed;
|
||||
#ifdef __FreeBSD__
|
||||
nvlist_t *oldsource;
|
||||
#endif
|
||||
size_t size;
|
||||
|
||||
ASSERT3S(g_refcount, >, 0);
|
||||
|
||||
(void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
if (zfs_ioctl_version == ZFS_IOCVER_UNDEF)
|
||||
zfs_ioctl_version = get_zfs_ioctl_version();
|
||||
|
||||
if (zfs_ioctl_version < ZFS_IOCVER_LZC) {
|
||||
oldsource = source;
|
||||
error = lzc_compat_pre(&zc, &ioc, &source);
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
#endif
|
||||
|
||||
packed = fnvlist_pack(source, &size);
|
||||
zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
|
||||
zc.zc_nvlist_src_size = size;
|
||||
|
||||
if (resultp != NULL) {
|
||||
*resultp = NULL;
|
||||
zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024);
|
||||
zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
|
||||
malloc(zc.zc_nvlist_dst_size);
|
||||
#ifdef illumos
|
||||
if (zc.zc_nvlist_dst == NULL) {
|
||||
#else
|
||||
if (zc.zc_nvlist_dst == 0) {
|
||||
#endif
|
||||
error = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
while (ioctl(g_fd, ioc, &zc) != 0) {
|
||||
if (errno == ENOMEM && resultp != NULL) {
|
||||
free((void *)(uintptr_t)zc.zc_nvlist_dst);
|
||||
zc.zc_nvlist_dst_size *= 2;
|
||||
zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
|
||||
malloc(zc.zc_nvlist_dst_size);
|
||||
#ifdef illumos
|
||||
if (zc.zc_nvlist_dst == NULL) {
|
||||
#else
|
||||
if (zc.zc_nvlist_dst == 0) {
|
||||
#endif
|
||||
error = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
error = errno;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
if (zfs_ioctl_version < ZFS_IOCVER_LZC)
|
||||
lzc_compat_post(&zc, ioc);
|
||||
#endif
|
||||
if (zc.zc_nvlist_dst_filled) {
|
||||
*resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
|
||||
zc.zc_nvlist_dst_size);
|
||||
}
|
||||
#ifdef __FreeBSD__
|
||||
if (zfs_ioctl_version < ZFS_IOCVER_LZC)
|
||||
lzc_compat_outnvl(&zc, ioc, resultp);
|
||||
#endif
|
||||
out:
|
||||
#ifdef __FreeBSD__
|
||||
if (zfs_ioctl_version < ZFS_IOCVER_LZC) {
|
||||
if (source != oldsource)
|
||||
nvlist_free(source);
|
||||
source = oldsource;
|
||||
}
|
||||
#endif
|
||||
fnvlist_pack_free(packed, size);
|
||||
free((void *)(uintptr_t)zc.zc_nvlist_dst);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props)
|
||||
{
|
||||
int error;
|
||||
nvlist_t *args = fnvlist_alloc();
|
||||
fnvlist_add_int32(args, "type", type);
|
||||
if (props != NULL)
|
||||
fnvlist_add_nvlist(args, "props", props);
|
||||
error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL);
|
||||
nvlist_free(args);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
lzc_clone(const char *fsname, const char *origin,
|
||||
nvlist_t *props)
|
||||
{
|
||||
int error;
|
||||
nvlist_t *args = fnvlist_alloc();
|
||||
fnvlist_add_string(args, "origin", origin);
|
||||
if (props != NULL)
|
||||
fnvlist_add_nvlist(args, "props", props);
|
||||
error = lzc_ioctl(ZFS_IOC_CLONE, fsname, args, NULL);
|
||||
nvlist_free(args);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates snapshots.
|
||||
*
|
||||
* The keys in the snaps nvlist are the snapshots to be created.
|
||||
* They must all be in the same pool.
|
||||
*
|
||||
* The props nvlist is properties to set. Currently only user properties
|
||||
* are supported. { user:prop_name -> string value }
|
||||
*
|
||||
* The returned results nvlist will have an entry for each snapshot that failed.
|
||||
* The value will be the (int32) error code.
|
||||
*
|
||||
* The return value will be 0 if all snapshots were created, otherwise it will
|
||||
* be the errno of a (unspecified) snapshot that failed.
|
||||
*/
|
||||
int
|
||||
lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist)
|
||||
{
|
||||
nvpair_t *elem;
|
||||
nvlist_t *args;
|
||||
int error;
|
||||
char pool[MAXNAMELEN];
|
||||
|
||||
*errlist = NULL;
|
||||
|
||||
/* determine the pool name */
|
||||
elem = nvlist_next_nvpair(snaps, NULL);
|
||||
if (elem == NULL)
|
||||
return (0);
|
||||
(void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
|
||||
pool[strcspn(pool, "/@")] = '\0';
|
||||
|
||||
args = fnvlist_alloc();
|
||||
fnvlist_add_nvlist(args, "snaps", snaps);
|
||||
if (props != NULL)
|
||||
fnvlist_add_nvlist(args, "props", props);
|
||||
|
||||
error = lzc_ioctl(ZFS_IOC_SNAPSHOT, pool, args, errlist);
|
||||
nvlist_free(args);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys snapshots.
|
||||
*
|
||||
* The keys in the snaps nvlist are the snapshots to be destroyed.
|
||||
* They must all be in the same pool.
|
||||
*
|
||||
* Snapshots that do not exist will be silently ignored.
|
||||
*
|
||||
* If 'defer' is not set, and a snapshot has user holds or clones, the
|
||||
* destroy operation will fail and none of the snapshots will be
|
||||
* destroyed.
|
||||
*
|
||||
* If 'defer' is set, and a snapshot has user holds or clones, it will be
|
||||
* marked for deferred destruction, and will be destroyed when the last hold
|
||||
* or clone is removed/destroyed.
|
||||
*
|
||||
* The return value will be 0 if all snapshots were destroyed (or marked for
|
||||
* later destruction if 'defer' is set) or didn't exist to begin with.
|
||||
*
|
||||
* Otherwise the return value will be the errno of a (unspecified) snapshot
|
||||
* that failed, no snapshots will be destroyed, and the errlist will have an
|
||||
* entry for each snapshot that failed. The value in the errlist will be
|
||||
* the (int32) error code.
|
||||
*/
|
||||
int
|
||||
lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist)
|
||||
{
|
||||
nvpair_t *elem;
|
||||
nvlist_t *args;
|
||||
int error;
|
||||
char pool[MAXNAMELEN];
|
||||
|
||||
/* determine the pool name */
|
||||
elem = nvlist_next_nvpair(snaps, NULL);
|
||||
if (elem == NULL)
|
||||
return (0);
|
||||
(void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
|
||||
pool[strcspn(pool, "/@")] = '\0';
|
||||
|
||||
args = fnvlist_alloc();
|
||||
fnvlist_add_nvlist(args, "snaps", snaps);
|
||||
if (defer)
|
||||
fnvlist_add_boolean(args, "defer");
|
||||
|
||||
error = lzc_ioctl(ZFS_IOC_DESTROY_SNAPS, pool, args, errlist);
|
||||
nvlist_free(args);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
lzc_snaprange_space(const char *firstsnap, const char *lastsnap,
|
||||
uint64_t *usedp)
|
||||
{
|
||||
nvlist_t *args;
|
||||
nvlist_t *result;
|
||||
int err;
|
||||
char fs[MAXNAMELEN];
|
||||
char *atp;
|
||||
|
||||
/* determine the fs name */
|
||||
(void) strlcpy(fs, firstsnap, sizeof (fs));
|
||||
atp = strchr(fs, '@');
|
||||
if (atp == NULL)
|
||||
return (EINVAL);
|
||||
*atp = '\0';
|
||||
|
||||
args = fnvlist_alloc();
|
||||
fnvlist_add_string(args, "firstsnap", firstsnap);
|
||||
|
||||
err = lzc_ioctl(ZFS_IOC_SPACE_SNAPS, lastsnap, args, &result);
|
||||
nvlist_free(args);
|
||||
if (err == 0)
|
||||
*usedp = fnvlist_lookup_uint64(result, "used");
|
||||
fnvlist_free(result);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
boolean_t
|
||||
lzc_exists(const char *dataset)
|
||||
{
|
||||
/*
|
||||
* The objset_stats ioctl is still legacy, so we need to construct our
|
||||
* own zfs_cmd_t rather than using zfsc_ioctl().
|
||||
*/
|
||||
zfs_cmd_t zc = { 0 };
|
||||
|
||||
(void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
|
||||
return (ioctl(g_fd, ZFS_IOC_OBJSET_STATS, &zc) == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create "user holds" on snapshots. If there is a hold on a snapshot,
|
||||
* the snapshot can not be destroyed. (However, it can be marked for deletion
|
||||
* by lzc_destroy_snaps(defer=B_TRUE).)
|
||||
*
|
||||
* The keys in the nvlist are snapshot names.
|
||||
* The snapshots must all be in the same pool.
|
||||
* The value is the name of the hold (string type).
|
||||
*
|
||||
* If cleanup_fd is not -1, it must be the result of open("/dev/zfs", O_EXCL).
|
||||
* In this case, when the cleanup_fd is closed (including on process
|
||||
* termination), the holds will be released. If the system is shut down
|
||||
* uncleanly, the holds will be released when the pool is next opened
|
||||
* or imported.
|
||||
*
|
||||
* Holds for snapshots which don't exist will be skipped and have an entry
|
||||
* added to errlist, but will not cause an overall failure.
|
||||
*
|
||||
* The return value will be 0 if all holds, for snapshots that existed,
|
||||
* were succesfully created.
|
||||
*
|
||||
* Otherwise the return value will be the errno of a (unspecified) hold that
|
||||
* failed and no holds will be created.
|
||||
*
|
||||
* In all cases the errlist will have an entry for each hold that failed
|
||||
* (name = snapshot), with its value being the error code (int32).
|
||||
*/
|
||||
int
|
||||
lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist)
|
||||
{
|
||||
char pool[MAXNAMELEN];
|
||||
nvlist_t *args;
|
||||
nvpair_t *elem;
|
||||
int error;
|
||||
|
||||
/* determine the pool name */
|
||||
elem = nvlist_next_nvpair(holds, NULL);
|
||||
if (elem == NULL)
|
||||
return (0);
|
||||
(void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
|
||||
pool[strcspn(pool, "/@")] = '\0';
|
||||
|
||||
args = fnvlist_alloc();
|
||||
fnvlist_add_nvlist(args, "holds", holds);
|
||||
if (cleanup_fd != -1)
|
||||
fnvlist_add_int32(args, "cleanup_fd", cleanup_fd);
|
||||
|
||||
error = lzc_ioctl(ZFS_IOC_HOLD, pool, args, errlist);
|
||||
nvlist_free(args);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Release "user holds" on snapshots. If the snapshot has been marked for
|
||||
* deferred destroy (by lzc_destroy_snaps(defer=B_TRUE)), it does not have
|
||||
* any clones, and all the user holds are removed, then the snapshot will be
|
||||
* destroyed.
|
||||
*
|
||||
* The keys in the nvlist are snapshot names.
|
||||
* The snapshots must all be in the same pool.
|
||||
* The value is a nvlist whose keys are the holds to remove.
|
||||
*
|
||||
* Holds which failed to release because they didn't exist will have an entry
|
||||
* added to errlist, but will not cause an overall failure.
|
||||
*
|
||||
* The return value will be 0 if the nvl holds was empty or all holds that
|
||||
* existed, were successfully removed.
|
||||
*
|
||||
* Otherwise the return value will be the errno of a (unspecified) hold that
|
||||
* failed to release and no holds will be released.
|
||||
*
|
||||
* In all cases the errlist will have an entry for each hold that failed to
|
||||
* to release.
|
||||
*/
|
||||
int
|
||||
lzc_release(nvlist_t *holds, nvlist_t **errlist)
|
||||
{
|
||||
char pool[MAXNAMELEN];
|
||||
nvpair_t *elem;
|
||||
|
||||
/* determine the pool name */
|
||||
elem = nvlist_next_nvpair(holds, NULL);
|
||||
if (elem == NULL)
|
||||
return (0);
|
||||
(void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
|
||||
pool[strcspn(pool, "/@")] = '\0';
|
||||
|
||||
return (lzc_ioctl(ZFS_IOC_RELEASE, pool, holds, errlist));
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve list of user holds on the specified snapshot.
|
||||
*
|
||||
* On success, *holdsp will be set to a nvlist which the caller must free.
|
||||
* The keys are the names of the holds, and the value is the creation time
|
||||
* of the hold (uint64) in seconds since the epoch.
|
||||
*/
|
||||
int
|
||||
lzc_get_holds(const char *snapname, nvlist_t **holdsp)
|
||||
{
|
||||
int error;
|
||||
nvlist_t *innvl = fnvlist_alloc();
|
||||
error = lzc_ioctl(ZFS_IOC_GET_HOLDS, snapname, innvl, holdsp);
|
||||
fnvlist_free(innvl);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* "snapname" is the full name of the snapshot to send (e.g. "pool/fs@snap")
|
||||
*
|
||||
* If "from" is NULL, a full (non-incremental) stream will be sent.
|
||||
* If "from" is non-NULL, it must be the full name of a snapshot or
|
||||
* bookmark to send an incremental from (e.g. "pool/fs@earlier_snap" or
|
||||
* "pool/fs#earlier_bmark"). If non-NULL, the specified snapshot or
|
||||
* bookmark must represent an earlier point in the history of "snapname").
|
||||
* It can be an earlier snapshot in the same filesystem or zvol as "snapname",
|
||||
* or it can be the origin of "snapname"'s filesystem, or an earlier
|
||||
* snapshot in the origin, etc.
|
||||
*
|
||||
* "fd" is the file descriptor to write the send stream to.
|
||||
*/
|
||||
int
|
||||
lzc_send(const char *snapname, const char *from, int fd)
|
||||
{
|
||||
nvlist_t *args;
|
||||
int err;
|
||||
|
||||
args = fnvlist_alloc();
|
||||
fnvlist_add_int32(args, "fd", fd);
|
||||
if (from != NULL)
|
||||
fnvlist_add_string(args, "fromsnap", from);
|
||||
err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL);
|
||||
nvlist_free(args);
|
||||
return (err);
|
||||
}
|
||||
|
||||
/*
|
||||
* If fromsnap is NULL, a full (non-incremental) stream will be estimated.
|
||||
*/
|
||||
int
|
||||
lzc_send_space(const char *snapname, const char *fromsnap, uint64_t *spacep)
|
||||
{
|
||||
nvlist_t *args;
|
||||
nvlist_t *result;
|
||||
int err;
|
||||
|
||||
args = fnvlist_alloc();
|
||||
if (fromsnap != NULL)
|
||||
fnvlist_add_string(args, "fromsnap", fromsnap);
|
||||
err = lzc_ioctl(ZFS_IOC_SEND_SPACE, snapname, args, &result);
|
||||
nvlist_free(args);
|
||||
if (err == 0)
|
||||
*spacep = fnvlist_lookup_uint64(result, "space");
|
||||
nvlist_free(result);
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
recv_read(int fd, void *buf, int ilen)
|
||||
{
|
||||
char *cp = buf;
|
||||
int rv;
|
||||
int len = ilen;
|
||||
|
||||
do {
|
||||
rv = read(fd, cp, len);
|
||||
cp += rv;
|
||||
len -= rv;
|
||||
} while (rv > 0);
|
||||
|
||||
if (rv < 0 || len != 0)
|
||||
return (EIO);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* The simplest receive case: receive from the specified fd, creating the
|
||||
* specified snapshot. Apply the specified properties a "received" properties
|
||||
* (which can be overridden by locally-set properties). If the stream is a
|
||||
* clone, its origin snapshot must be specified by 'origin'. The 'force'
|
||||
* flag will cause the target filesystem to be rolled back or destroyed if
|
||||
* necessary to receive.
|
||||
*
|
||||
* Return 0 on success or an errno on failure.
|
||||
*
|
||||
* Note: this interface does not work on dedup'd streams
|
||||
* (those with DMU_BACKUP_FEATURE_DEDUP).
|
||||
*/
|
||||
int
|
||||
lzc_receive(const char *snapname, nvlist_t *props, const char *origin,
|
||||
boolean_t force, int fd)
|
||||
{
|
||||
/*
|
||||
* The receive ioctl is still legacy, so we need to construct our own
|
||||
* zfs_cmd_t rather than using zfsc_ioctl().
|
||||
*/
|
||||
zfs_cmd_t zc = { 0 };
|
||||
char *atp;
|
||||
char *packed = NULL;
|
||||
size_t size;
|
||||
dmu_replay_record_t drr;
|
||||
int error;
|
||||
|
||||
ASSERT3S(g_refcount, >, 0);
|
||||
|
||||
/* zc_name is name of containing filesystem */
|
||||
(void) strlcpy(zc.zc_name, snapname, sizeof (zc.zc_name));
|
||||
atp = strchr(zc.zc_name, '@');
|
||||
if (atp == NULL)
|
||||
return (EINVAL);
|
||||
*atp = '\0';
|
||||
|
||||
/* if the fs does not exist, try its parent. */
|
||||
if (!lzc_exists(zc.zc_name)) {
|
||||
char *slashp = strrchr(zc.zc_name, '/');
|
||||
if (slashp == NULL)
|
||||
return (ENOENT);
|
||||
*slashp = '\0';
|
||||
|
||||
}
|
||||
|
||||
/* zc_value is full name of the snapshot to create */
|
||||
(void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
|
||||
|
||||
if (props != NULL) {
|
||||
/* zc_nvlist_src is props to set */
|
||||
packed = fnvlist_pack(props, &size);
|
||||
zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
|
||||
zc.zc_nvlist_src_size = size;
|
||||
}
|
||||
|
||||
/* zc_string is name of clone origin (if DRR_FLAG_CLONE) */
|
||||
if (origin != NULL)
|
||||
(void) strlcpy(zc.zc_string, origin, sizeof (zc.zc_string));
|
||||
|
||||
/* zc_begin_record is non-byteswapped BEGIN record */
|
||||
error = recv_read(fd, &drr, sizeof (drr));
|
||||
if (error != 0)
|
||||
goto out;
|
||||
zc.zc_begin_record = drr.drr_u.drr_begin;
|
||||
|
||||
/* zc_cookie is fd to read from */
|
||||
zc.zc_cookie = fd;
|
||||
|
||||
/* zc guid is force flag */
|
||||
zc.zc_guid = force;
|
||||
|
||||
/* zc_cleanup_fd is unused */
|
||||
zc.zc_cleanup_fd = -1;
|
||||
|
||||
error = ioctl(g_fd, ZFS_IOC_RECV, &zc);
|
||||
if (error != 0)
|
||||
error = errno;
|
||||
|
||||
out:
|
||||
if (packed != NULL)
|
||||
fnvlist_pack_free(packed, size);
|
||||
free((void*)(uintptr_t)zc.zc_nvlist_dst);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Roll back this filesystem or volume to its most recent snapshot.
|
||||
* If snapnamebuf is not NULL, it will be filled in with the name
|
||||
* of the most recent snapshot.
|
||||
*
|
||||
* Return 0 on success or an errno on failure.
|
||||
*/
|
||||
int
|
||||
lzc_rollback(const char *fsname, char *snapnamebuf, int snapnamelen)
|
||||
{
|
||||
nvlist_t *args;
|
||||
nvlist_t *result;
|
||||
int err;
|
||||
|
||||
args = fnvlist_alloc();
|
||||
err = lzc_ioctl(ZFS_IOC_ROLLBACK, fsname, args, &result);
|
||||
nvlist_free(args);
|
||||
if (err == 0 && snapnamebuf != NULL) {
|
||||
const char *snapname = fnvlist_lookup_string(result, "target");
|
||||
(void) strlcpy(snapnamebuf, snapname, snapnamelen);
|
||||
}
|
||||
return (err);
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates bookmarks.
|
||||
*
|
||||
* The bookmarks nvlist maps from name of the bookmark (e.g. "pool/fs#bmark") to
|
||||
* the name of the snapshot (e.g. "pool/fs@snap"). All the bookmarks and
|
||||
* snapshots must be in the same pool.
|
||||
*
|
||||
* The returned results nvlist will have an entry for each bookmark that failed.
|
||||
* The value will be the (int32) error code.
|
||||
*
|
||||
* The return value will be 0 if all bookmarks were created, otherwise it will
|
||||
* be the errno of a (undetermined) bookmarks that failed.
|
||||
*/
|
||||
int
|
||||
lzc_bookmark(nvlist_t *bookmarks, nvlist_t **errlist)
|
||||
{
|
||||
nvpair_t *elem;
|
||||
int error;
|
||||
char pool[MAXNAMELEN];
|
||||
|
||||
/* determine the pool name */
|
||||
elem = nvlist_next_nvpair(bookmarks, NULL);
|
||||
if (elem == NULL)
|
||||
return (0);
|
||||
(void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
|
||||
pool[strcspn(pool, "/#")] = '\0';
|
||||
|
||||
error = lzc_ioctl(ZFS_IOC_BOOKMARK, pool, bookmarks, errlist);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve bookmarks.
|
||||
*
|
||||
* Retrieve the list of bookmarks for the given file system. The props
|
||||
* parameter is an nvlist of property names (with no values) that will be
|
||||
* returned for each bookmark.
|
||||
*
|
||||
* The following are valid properties on bookmarks, all of which are numbers
|
||||
* (represented as uint64 in the nvlist)
|
||||
*
|
||||
* "guid" - globally unique identifier of the snapshot it refers to
|
||||
* "createtxg" - txg when the snapshot it refers to was created
|
||||
* "creation" - timestamp when the snapshot it refers to was created
|
||||
*
|
||||
* The format of the returned nvlist as follows:
|
||||
* <short name of bookmark> -> {
|
||||
* <name of property> -> {
|
||||
* "value" -> uint64
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
int
|
||||
lzc_get_bookmarks(const char *fsname, nvlist_t *props, nvlist_t **bmarks)
|
||||
{
|
||||
return (lzc_ioctl(ZFS_IOC_GET_BOOKMARKS, fsname, props, bmarks));
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys bookmarks.
|
||||
*
|
||||
* The keys in the bmarks nvlist are the bookmarks to be destroyed.
|
||||
* They must all be in the same pool. Bookmarks are specified as
|
||||
* <fs>#<bmark>.
|
||||
*
|
||||
* Bookmarks that do not exist will be silently ignored.
|
||||
*
|
||||
* The return value will be 0 if all bookmarks that existed were destroyed.
|
||||
*
|
||||
* Otherwise the return value will be the errno of a (undetermined) bookmark
|
||||
* that failed, no bookmarks will be destroyed, and the errlist will have an
|
||||
* entry for each bookmarks that failed. The value in the errlist will be
|
||||
* the (int32) error code.
|
||||
*/
|
||||
int
|
||||
lzc_destroy_bookmarks(nvlist_t *bmarks, nvlist_t **errlist)
|
||||
{
|
||||
nvpair_t *elem;
|
||||
int error;
|
||||
char pool[MAXNAMELEN];
|
||||
|
||||
/* determine the pool name */
|
||||
elem = nvlist_next_nvpair(bmarks, NULL);
|
||||
if (elem == NULL)
|
||||
return (0);
|
||||
(void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
|
||||
pool[strcspn(pool, "/#")] = '\0';
|
||||
|
||||
error = lzc_ioctl(ZFS_IOC_DESTROY_BOOKMARKS, pool, bmarks, errlist);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* 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 (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013 by Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _LIBZFS_CORE_H
|
||||
#define _LIBZFS_CORE_H
|
||||
|
||||
#include <libnvpair.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int libzfs_core_init(void);
|
||||
void libzfs_core_fini(void);
|
||||
|
||||
int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
|
||||
int lzc_create(const char *, dmu_objset_type_t, nvlist_t *);
|
||||
int lzc_clone(const char *, const char *, nvlist_t *);
|
||||
int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
|
||||
int lzc_bookmark(nvlist_t *, nvlist_t **);
|
||||
int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
|
||||
int lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
|
||||
|
||||
int lzc_snaprange_space(const char *, const char *, uint64_t *);
|
||||
|
||||
int lzc_hold(nvlist_t *, int, nvlist_t **);
|
||||
int lzc_release(nvlist_t *, nvlist_t **);
|
||||
int lzc_get_holds(const char *, nvlist_t **);
|
||||
|
||||
int lzc_send(const char *, const char *, int);
|
||||
int lzc_receive(const char *, nvlist_t *, const char *, boolean_t, int);
|
||||
int lzc_send_space(const char *, const char *, uint64_t *);
|
||||
|
||||
boolean_t lzc_exists(const char *);
|
||||
|
||||
int lzc_rollback(const char *, char *, int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBZFS_CORE_H */
|
||||
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* 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 (c) 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_ioctl.h>
|
||||
#include <zfs_ioctl_compat.h>
|
||||
#include "libzfs_core_compat.h"
|
||||
|
||||
extern int zfs_ioctl_version;
|
||||
|
||||
int
|
||||
lzc_compat_pre(zfs_cmd_t *zc, zfs_ioc_t *ioc, nvlist_t **source)
|
||||
{
|
||||
nvlist_t *nvl = NULL;
|
||||
nvpair_t *pair, *hpair;
|
||||
char *buf, *val;
|
||||
zfs_ioc_t vecnum;
|
||||
uint32_t type32;
|
||||
int32_t cleanup_fd;
|
||||
int error = 0;
|
||||
int pos;
|
||||
|
||||
if (zfs_ioctl_version >= ZFS_IOCVER_LZC)
|
||||
return (0);
|
||||
|
||||
vecnum = *ioc;
|
||||
|
||||
switch (vecnum) {
|
||||
case ZFS_IOC_CREATE:
|
||||
type32 = fnvlist_lookup_int32(*source, "type");
|
||||
zc->zc_objset_type = (uint64_t)type32;
|
||||
nvlist_lookup_nvlist(*source, "props", &nvl);
|
||||
*source = nvl;
|
||||
break;
|
||||
case ZFS_IOC_CLONE:
|
||||
buf = fnvlist_lookup_string(*source, "origin");
|
||||
strlcpy(zc->zc_value, buf, MAXPATHLEN);
|
||||
nvlist_lookup_nvlist(*source, "props", &nvl);
|
||||
*ioc = ZFS_IOC_CREATE;
|
||||
*source = nvl;
|
||||
break;
|
||||
case ZFS_IOC_SNAPSHOT:
|
||||
nvl = fnvlist_lookup_nvlist(*source, "snaps");
|
||||
pair = nvlist_next_nvpair(nvl, NULL);
|
||||
if (pair != NULL) {
|
||||
buf = nvpair_name(pair);
|
||||
pos = strcspn(buf, "@");
|
||||
strlcpy(zc->zc_name, buf, pos + 1);
|
||||
strlcpy(zc->zc_value, buf + pos + 1, MAXPATHLEN);
|
||||
} else
|
||||
error = EINVAL;
|
||||
/* old kernel cannot create multiple snapshots */
|
||||
if (!error && nvlist_next_nvpair(nvl, pair) != NULL)
|
||||
error = EOPNOTSUPP;
|
||||
nvlist_free(nvl);
|
||||
nvl = NULL;
|
||||
nvlist_lookup_nvlist(*source, "props", &nvl);
|
||||
*source = nvl;
|
||||
break;
|
||||
case ZFS_IOC_SPACE_SNAPS:
|
||||
buf = fnvlist_lookup_string(*source, "firstsnap");
|
||||
strlcpy(zc->zc_value, buf, MAXPATHLEN);
|
||||
break;
|
||||
case ZFS_IOC_DESTROY_SNAPS:
|
||||
nvl = fnvlist_lookup_nvlist(*source, "snaps");
|
||||
pair = nvlist_next_nvpair(nvl, NULL);
|
||||
if (pair != NULL) {
|
||||
buf = nvpair_name(pair);
|
||||
pos = strcspn(buf, "@");
|
||||
strlcpy(zc->zc_name, buf, pos + 1);
|
||||
} else
|
||||
error = EINVAL;
|
||||
/* old kernel cannot atomically destroy multiple snaps */
|
||||
if (!error && nvlist_next_nvpair(nvl, pair) != NULL)
|
||||
error = EOPNOTSUPP;
|
||||
*source = nvl;
|
||||
break;
|
||||
case ZFS_IOC_HOLD:
|
||||
nvl = fnvlist_lookup_nvlist(*source, "holds");
|
||||
pair = nvlist_next_nvpair(nvl, NULL);
|
||||
if (pair != NULL) {
|
||||
buf = nvpair_name(pair);
|
||||
pos = strcspn(buf, "@");
|
||||
strlcpy(zc->zc_name, buf, pos + 1);
|
||||
strlcpy(zc->zc_value, buf + pos + 1, MAXPATHLEN);
|
||||
if (nvpair_value_string(pair, &val) == 0)
|
||||
strlcpy(zc->zc_string, val, MAXNAMELEN);
|
||||
else
|
||||
error = EINVAL;
|
||||
} else
|
||||
error = EINVAL;
|
||||
/* old kernel cannot atomically create multiple holds */
|
||||
if (!error && nvlist_next_nvpair(nvl, pair) != NULL)
|
||||
error = EOPNOTSUPP;
|
||||
nvlist_free(nvl);
|
||||
if (nvlist_lookup_int32(*source, "cleanup_fd",
|
||||
&cleanup_fd) == 0)
|
||||
zc->zc_cleanup_fd = cleanup_fd;
|
||||
else
|
||||
zc->zc_cleanup_fd = -1;
|
||||
break;
|
||||
case ZFS_IOC_RELEASE:
|
||||
pair = nvlist_next_nvpair(*source, NULL);
|
||||
if (pair != NULL) {
|
||||
buf = nvpair_name(pair);
|
||||
pos = strcspn(buf, "@");
|
||||
strlcpy(zc->zc_name, buf, pos + 1);
|
||||
strlcpy(zc->zc_value, buf + pos + 1, MAXPATHLEN);
|
||||
if (nvpair_value_nvlist(pair, &nvl) == 0) {
|
||||
hpair = nvlist_next_nvpair(nvl, NULL);
|
||||
if (hpair != NULL)
|
||||
strlcpy(zc->zc_string,
|
||||
nvpair_name(hpair), MAXNAMELEN);
|
||||
else
|
||||
error = EINVAL;
|
||||
if (!error && nvlist_next_nvpair(nvl,
|
||||
hpair) != NULL)
|
||||
error = EOPNOTSUPP;
|
||||
} else
|
||||
error = EINVAL;
|
||||
} else
|
||||
error = EINVAL;
|
||||
/* old kernel cannot atomically release multiple holds */
|
||||
if (!error && nvlist_next_nvpair(nvl, pair) != NULL)
|
||||
error = EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
void
|
||||
lzc_compat_post(zfs_cmd_t *zc, const zfs_ioc_t ioc)
|
||||
{
|
||||
if (zfs_ioctl_version >= ZFS_IOCVER_LZC)
|
||||
return;
|
||||
|
||||
switch (ioc) {
|
||||
case ZFS_IOC_CREATE:
|
||||
case ZFS_IOC_CLONE:
|
||||
case ZFS_IOC_SNAPSHOT:
|
||||
case ZFS_IOC_SPACE_SNAPS:
|
||||
case ZFS_IOC_DESTROY_SNAPS:
|
||||
zc->zc_nvlist_dst_filled = B_FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
lzc_compat_outnvl(zfs_cmd_t *zc, const zfs_ioc_t ioc, nvlist_t **outnvl)
|
||||
{
|
||||
nvlist_t *nvl;
|
||||
|
||||
if (zfs_ioctl_version >= ZFS_IOCVER_LZC)
|
||||
return (0);
|
||||
|
||||
switch (ioc) {
|
||||
case ZFS_IOC_SPACE_SNAPS:
|
||||
nvl = fnvlist_alloc();
|
||||
fnvlist_add_uint64(nvl, "used", zc->zc_cookie);
|
||||
fnvlist_add_uint64(nvl, "compressed", zc->zc_objset_type);
|
||||
fnvlist_add_uint64(nvl, "uncompressed", zc->zc_perm_action);
|
||||
*outnvl = nvl;
|
||||
break;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* 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 (c) 2013 by Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _LIBZFS_CORE_COMPAT_H
|
||||
#define _LIBZFS_CORE_COMPAT_H
|
||||
|
||||
#include <libnvpair.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
#include <sys/zfs_ioctl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int lzc_compat_pre(zfs_cmd_t *, zfs_ioc_t *, nvlist_t **);
|
||||
void lzc_compat_post(zfs_cmd_t *, const zfs_ioc_t);
|
||||
int lzc_compat_outnvl(zfs_cmd_t *, const zfs_ioc_t, nvlist_t **);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBZFS_CORE_COMPAT_H */
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/processor.h>
|
||||
#include <sys/zfs_context.h>
|
||||
#include <sys/rrwlock.h>
|
||||
#include <sys/zmod.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/systeminfo.h>
|
||||
@@ -346,41 +345,6 @@ top:
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
clock_t
|
||||
cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
|
||||
int flag)
|
||||
{
|
||||
int error;
|
||||
timestruc_t ts;
|
||||
hrtime_t delta;
|
||||
|
||||
ASSERT(flag == 0);
|
||||
|
||||
top:
|
||||
delta = tim - gethrtime();
|
||||
if (delta <= 0)
|
||||
return (-1);
|
||||
|
||||
ts.tv_sec = delta / NANOSEC;
|
||||
ts.tv_nsec = delta % NANOSEC;
|
||||
|
||||
ASSERT(mutex_owner(mp) == curthread);
|
||||
mp->m_owner = NULL;
|
||||
error = pthread_cond_timedwait(cv, &mp->m_lock, &ts);
|
||||
mp->m_owner = curthread;
|
||||
|
||||
if (error == ETIMEDOUT)
|
||||
return (-1);
|
||||
|
||||
if (error == EINTR)
|
||||
goto top;
|
||||
|
||||
ASSERT(error == 0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
cv_signal(kcondvar_t *cv)
|
||||
{
|
||||
@@ -623,12 +587,6 @@ dprintf_setup(int *argc, char **argv)
|
||||
dprintf_print_all = 1;
|
||||
}
|
||||
|
||||
int
|
||||
sysctl_handle_64(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* =========================================================================
|
||||
* debug printfs
|
||||
@@ -658,7 +616,7 @@ __dprintf(const char *file, const char *func, int line, const char *fmt, ...)
|
||||
if (dprintf_find_string("pid"))
|
||||
(void) printf("%d ", getpid());
|
||||
if (dprintf_find_string("tid"))
|
||||
(void) printf("%ul ", thr_self());
|
||||
(void) printf("%u ", thr_self());
|
||||
#if 0
|
||||
if (dprintf_find_string("cpu"))
|
||||
(void) printf("%u ", getcpuid());
|
||||
@@ -902,8 +860,6 @@ umem_out_of_memory(void)
|
||||
void
|
||||
kernel_init(int mode)
|
||||
{
|
||||
extern uint_t rrw_tsd_key;
|
||||
|
||||
umem_nofail_callback(umem_out_of_memory);
|
||||
|
||||
physmem = sysconf(_SC_PHYS_PAGES);
|
||||
@@ -920,8 +876,6 @@ kernel_init(int mode)
|
||||
system_taskq_init();
|
||||
|
||||
spa_init(mode);
|
||||
|
||||
tsd_create(&rrw_tsd_key, rrw_tsd_destroy);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -969,12 +923,6 @@ crgetuid(cred_t *cr)
|
||||
return (0);
|
||||
}
|
||||
|
||||
uid_t
|
||||
crgetruid(cred_t *cr)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
gid_t
|
||||
crgetgid(cred_t *cr)
|
||||
{
|
||||
@@ -1096,50 +1044,3 @@ zvol_create_minors(const char *name)
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef illumos
|
||||
void
|
||||
bioinit(buf_t *bp)
|
||||
{
|
||||
bzero(bp, sizeof (buf_t));
|
||||
}
|
||||
|
||||
void
|
||||
biodone(buf_t *bp)
|
||||
{
|
||||
if (bp->b_iodone != NULL) {
|
||||
(*(bp->b_iodone))(bp);
|
||||
return;
|
||||
}
|
||||
ASSERT((bp->b_flags & B_DONE) == 0);
|
||||
bp->b_flags |= B_DONE;
|
||||
}
|
||||
|
||||
void
|
||||
bioerror(buf_t *bp, int error)
|
||||
{
|
||||
ASSERT(bp != NULL);
|
||||
ASSERT(error >= 0);
|
||||
|
||||
if (error != 0) {
|
||||
bp->b_flags |= B_ERROR;
|
||||
} else {
|
||||
bp->b_flags &= ~B_ERROR;
|
||||
}
|
||||
bp->b_error = error;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
geterror(struct buf *bp)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
if (bp->b_flags & B_ERROR) {
|
||||
error = bp->b_error;
|
||||
if (!error)
|
||||
error = EIO;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
#endif
|
||||
@@ -20,12 +20,8 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_ZFS_CONTEXT_H
|
||||
#define _SYS_ZFS_CONTEXT_H
|
||||
@@ -64,9 +60,6 @@ extern "C" {
|
||||
#include <umem.h>
|
||||
#include <inttypes.h>
|
||||
#include <fsshare.h>
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/note.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/cred.h>
|
||||
@@ -91,9 +84,6 @@ extern "C" {
|
||||
#include <sys/sysevent/dev.h>
|
||||
#include <machine/atomic.h>
|
||||
#include <sys/debug.h>
|
||||
#ifdef illumos
|
||||
#include "zfs.h"
|
||||
#endif
|
||||
|
||||
#define ZFS_EXPORTS_PATH "/etc/zfs/exports"
|
||||
|
||||
@@ -141,72 +131,34 @@ extern int aok;
|
||||
|
||||
#ifdef DTRACE_PROBE
|
||||
#undef DTRACE_PROBE
|
||||
#define DTRACE_PROBE(a) ((void)0)
|
||||
#endif /* DTRACE_PROBE */
|
||||
#ifdef illumos
|
||||
#define DTRACE_PROBE(a) \
|
||||
ZFS_PROBE0(#a)
|
||||
#endif
|
||||
|
||||
#ifdef DTRACE_PROBE1
|
||||
#undef DTRACE_PROBE1
|
||||
#define DTRACE_PROBE1(a, b, c) ((void)0)
|
||||
#endif /* DTRACE_PROBE1 */
|
||||
#ifdef illumos
|
||||
#define DTRACE_PROBE1(a, b, c) \
|
||||
ZFS_PROBE1(#a, (unsigned long)c)
|
||||
#endif
|
||||
|
||||
#ifdef DTRACE_PROBE2
|
||||
#undef DTRACE_PROBE2
|
||||
#define DTRACE_PROBE2(a, b, c, d, e) ((void)0)
|
||||
#endif /* DTRACE_PROBE2 */
|
||||
#ifdef illumos
|
||||
#define DTRACE_PROBE2(a, b, c, d, e) \
|
||||
ZFS_PROBE2(#a, (unsigned long)c, (unsigned long)e)
|
||||
#endif
|
||||
|
||||
#ifdef DTRACE_PROBE3
|
||||
#undef DTRACE_PROBE3
|
||||
#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0)
|
||||
#endif /* DTRACE_PROBE3 */
|
||||
#ifdef illumos
|
||||
#define DTRACE_PROBE3(a, b, c, d, e, f, g) \
|
||||
ZFS_PROBE3(#a, (unsigned long)c, (unsigned long)e, (unsigned long)g)
|
||||
#endif
|
||||
|
||||
#ifdef DTRACE_PROBE4
|
||||
#undef DTRACE_PROBE4
|
||||
#endif /* DTRACE_PROBE4 */
|
||||
#ifdef illumos
|
||||
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) \
|
||||
ZFS_PROBE4(#a, (unsigned long)c, (unsigned long)e, (unsigned long)g, \
|
||||
(unsigned long)i)
|
||||
#endif
|
||||
|
||||
#ifdef illumos
|
||||
/*
|
||||
* We use the comma operator so that this macro can be used without much
|
||||
* additional code. For example, "return (EINVAL);" becomes
|
||||
* "return (SET_ERROR(EINVAL));". Note that the argument will be evaluated
|
||||
* twice, so it should not have side effects (e.g. something like:
|
||||
* "return (SET_ERROR(log_error(EINVAL, info)));" would log the error twice).
|
||||
*/
|
||||
#define SET_ERROR(err) (ZFS_SET_ERROR(err), err)
|
||||
#else /* !illumos */
|
||||
|
||||
#define DTRACE_PROBE(a) ((void)0)
|
||||
#define DTRACE_PROBE1(a, b, c) ((void)0)
|
||||
#define DTRACE_PROBE2(a, b, c, d, e) ((void)0)
|
||||
#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0)
|
||||
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
|
||||
|
||||
#define SET_ERROR(err) (err)
|
||||
#endif /* !illumos */
|
||||
#endif /* DTRACE_PROBE4 */
|
||||
|
||||
/*
|
||||
* Threads
|
||||
*/
|
||||
#define curthread ((void *)(uintptr_t)thr_self())
|
||||
|
||||
#define kpreempt(x) sched_yield()
|
||||
|
||||
typedef struct kthread kthread_t;
|
||||
|
||||
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
|
||||
@@ -290,9 +242,6 @@ typedef int krw_t;
|
||||
#define RW_WRITE_HELD(x) ((x)->rw_owner == curthread)
|
||||
#define RW_LOCK_HELD(x) rw_lock_held(x)
|
||||
|
||||
#undef RW_LOCK_HELD
|
||||
#define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x))
|
||||
|
||||
extern void rw_init(krwlock_t *rwlp, char *name, int type, void *arg);
|
||||
extern void rw_destroy(krwlock_t *rwlp);
|
||||
extern void rw_enter(krwlock_t *rwlp, krw_t rw);
|
||||
@@ -303,7 +252,6 @@ extern int rw_lock_held(krwlock_t *rwlp);
|
||||
#define rw_downgrade(rwlp) do { } while (0)
|
||||
|
||||
extern uid_t crgetuid(cred_t *cr);
|
||||
extern uid_t crgetruid(cred_t *cr);
|
||||
extern gid_t crgetgid(cred_t *cr);
|
||||
extern int crgetngroups(cred_t *cr);
|
||||
extern gid_t *crgetgroups(cred_t *cr);
|
||||
@@ -319,19 +267,9 @@ extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg);
|
||||
extern void cv_destroy(kcondvar_t *cv);
|
||||
extern void cv_wait(kcondvar_t *cv, kmutex_t *mp);
|
||||
extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime);
|
||||
extern clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim,
|
||||
hrtime_t res, int flag);
|
||||
extern void cv_signal(kcondvar_t *cv);
|
||||
extern void cv_broadcast(kcondvar_t *cv);
|
||||
|
||||
/*
|
||||
* Thread-specific data
|
||||
*/
|
||||
#define tsd_get(k) pthread_getspecific(k)
|
||||
#define tsd_set(k, v) pthread_setspecific(k, v)
|
||||
#define tsd_create(kp, d) pthread_key_create(kp, d)
|
||||
#define tsd_destroy(kp) /* nothing */
|
||||
|
||||
/*
|
||||
* Kernel memory
|
||||
*/
|
||||
@@ -372,16 +310,6 @@ typedef struct taskq taskq_t;
|
||||
typedef uintptr_t taskqid_t;
|
||||
typedef void (task_func_t)(void *);
|
||||
|
||||
typedef struct taskq_ent {
|
||||
struct taskq_ent *tqent_next;
|
||||
struct taskq_ent *tqent_prev;
|
||||
task_func_t *tqent_func;
|
||||
void *tqent_arg;
|
||||
uintptr_t tqent_flags;
|
||||
} taskq_ent_t;
|
||||
|
||||
#define TQENT_FLAG_PREALLOC 0x1 /* taskq_dispatch_ent used */
|
||||
|
||||
#define TASKQ_PREPOPULATE 0x0001
|
||||
#define TASKQ_CPR_SAFE 0x0002 /* Use CPR safe protocol */
|
||||
#define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */
|
||||
@@ -393,7 +321,6 @@ typedef struct taskq_ent {
|
||||
#define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */
|
||||
#define TQ_FRONT 0x08 /* Queue in front */
|
||||
|
||||
|
||||
extern taskq_t *system_taskq;
|
||||
|
||||
extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
|
||||
@@ -402,8 +329,6 @@ extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
|
||||
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
|
||||
(taskq_create(a, b, maxclsyspri, d, e, f))
|
||||
extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
|
||||
extern void taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t,
|
||||
taskq_ent_t *);
|
||||
extern void taskq_destroy(taskq_t *);
|
||||
extern void taskq_wait(taskq_t *);
|
||||
extern int taskq_member(taskq_t *, void *);
|
||||
@@ -598,7 +523,7 @@ typedef struct callb_cpr {
|
||||
#define INGLOBALZONE(z) (1)
|
||||
|
||||
extern char *kmem_asprintf(const char *fmt, ...);
|
||||
#define strfree(str) kmem_free((str), strlen(str) + 1)
|
||||
#define strfree(str) kmem_free((str), strlen(str)+1)
|
||||
|
||||
/*
|
||||
* Hostname information
|
||||
@@ -684,55 +609,11 @@ typedef uint32_t idmap_rid_t;
|
||||
|
||||
#define SX_SYSINIT(name, lock, desc)
|
||||
|
||||
#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \
|
||||
intptr_t arg2, struct sysctl_req *req
|
||||
|
||||
/*
|
||||
* This describes the access space for a sysctl request. This is needed
|
||||
* so that we can use the interface from the kernel or from user-space.
|
||||
*/
|
||||
struct sysctl_req {
|
||||
struct thread *td; /* used for access checking */
|
||||
int lock; /* wiring state */
|
||||
void *oldptr;
|
||||
size_t oldlen;
|
||||
size_t oldidx;
|
||||
int (*oldfunc)(struct sysctl_req *, const void *, size_t);
|
||||
void *newptr;
|
||||
size_t newlen;
|
||||
size_t newidx;
|
||||
int (*newfunc)(struct sysctl_req *, void *, size_t);
|
||||
size_t validlen;
|
||||
int flags;
|
||||
};
|
||||
|
||||
SLIST_HEAD(sysctl_oid_list, sysctl_oid);
|
||||
|
||||
/*
|
||||
* This describes one "oid" in the MIB tree. Potentially more nodes can
|
||||
* be hidden behind it, expanded by the handler.
|
||||
*/
|
||||
struct sysctl_oid {
|
||||
struct sysctl_oid_list *oid_parent;
|
||||
SLIST_ENTRY(sysctl_oid) oid_link;
|
||||
int oid_number;
|
||||
u_int oid_kind;
|
||||
void *oid_arg1;
|
||||
intptr_t oid_arg2;
|
||||
const char *oid_name;
|
||||
int (*oid_handler)(SYSCTL_HANDLER_ARGS);
|
||||
const char *oid_fmt;
|
||||
int oid_refcnt;
|
||||
u_int oid_running;
|
||||
const char *oid_descr;
|
||||
};
|
||||
|
||||
#define SYSCTL_DECL(...)
|
||||
#define SYSCTL_NODE(...)
|
||||
#define SYSCTL_INT(...)
|
||||
#define SYSCTL_UINT(...)
|
||||
#define SYSCTL_ULONG(...)
|
||||
#define SYSCTL_PROC(...)
|
||||
#define SYSCTL_QUAD(...)
|
||||
#ifdef TUNABLE_INT
|
||||
#undef TUNABLE_INT
|
||||
@@ -743,46 +624,12 @@ struct sysctl_oid {
|
||||
#define TUNABLE_ULONG(...)
|
||||
#define TUNABLE_QUAD(...)
|
||||
|
||||
int sysctl_handle_64(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
/* Errors */
|
||||
|
||||
#ifndef ERESTART
|
||||
#define ERESTART (-1)
|
||||
#endif
|
||||
|
||||
#ifdef illumos
|
||||
/*
|
||||
* Buf structure
|
||||
*/
|
||||
#define B_BUSY 0x0001
|
||||
#define B_DONE 0x0002
|
||||
#define B_ERROR 0x0004
|
||||
#define B_READ 0x0040 /* read when I/O occurs */
|
||||
#define B_WRITE 0x0100 /* non-read pseudo-flag */
|
||||
|
||||
typedef struct buf {
|
||||
int b_flags;
|
||||
size_t b_bcount;
|
||||
union {
|
||||
caddr_t b_addr;
|
||||
} b_un;
|
||||
|
||||
lldaddr_t _b_blkno;
|
||||
#define b_lblkno _b_blkno._f
|
||||
size_t b_resid;
|
||||
size_t b_bufsize;
|
||||
int (*b_iodone)(struct buf *);
|
||||
int b_error;
|
||||
void *b_private;
|
||||
} buf_t;
|
||||
|
||||
extern void bioinit(buf_t *);
|
||||
extern void biodone(buf_t *);
|
||||
extern void bioerror(buf_t *, int);
|
||||
extern int geterror(buf_t *);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -22,15 +22,19 @@
|
||||
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
|
||||
int taskq_now;
|
||||
taskq_t *system_taskq;
|
||||
|
||||
typedef struct task {
|
||||
struct task *task_next;
|
||||
struct task *task_prev;
|
||||
task_func_t *task_func;
|
||||
void *task_arg;
|
||||
} task_t;
|
||||
|
||||
#define TASKQ_ACTIVE 0x00010000
|
||||
|
||||
struct taskq {
|
||||
@@ -47,18 +51,18 @@ struct taskq {
|
||||
int tq_maxalloc;
|
||||
kcondvar_t tq_maxalloc_cv;
|
||||
int tq_maxalloc_wait;
|
||||
taskq_ent_t *tq_freelist;
|
||||
taskq_ent_t tq_task;
|
||||
task_t *tq_freelist;
|
||||
task_t tq_task;
|
||||
};
|
||||
|
||||
static taskq_ent_t *
|
||||
static task_t *
|
||||
task_alloc(taskq_t *tq, int tqflags)
|
||||
{
|
||||
taskq_ent_t *t;
|
||||
task_t *t;
|
||||
int rv;
|
||||
|
||||
again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
|
||||
tq->tq_freelist = t->tqent_next;
|
||||
tq->tq_freelist = t->task_next;
|
||||
} else {
|
||||
if (tq->tq_nalloc >= tq->tq_maxalloc) {
|
||||
if (!(tqflags & KM_SLEEP))
|
||||
@@ -83,7 +87,7 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
|
||||
}
|
||||
mutex_exit(&tq->tq_lock);
|
||||
|
||||
t = kmem_alloc(sizeof (taskq_ent_t), tqflags & KM_SLEEP);
|
||||
t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP);
|
||||
|
||||
mutex_enter(&tq->tq_lock);
|
||||
if (t != NULL)
|
||||
@@ -93,15 +97,15 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
|
||||
}
|
||||
|
||||
static void
|
||||
task_free(taskq_t *tq, taskq_ent_t *t)
|
||||
task_free(taskq_t *tq, task_t *t)
|
||||
{
|
||||
if (tq->tq_nalloc <= tq->tq_minalloc) {
|
||||
t->tqent_next = tq->tq_freelist;
|
||||
t->task_next = tq->tq_freelist;
|
||||
tq->tq_freelist = t;
|
||||
} else {
|
||||
tq->tq_nalloc--;
|
||||
mutex_exit(&tq->tq_lock);
|
||||
kmem_free(t, sizeof (taskq_ent_t));
|
||||
kmem_free(t, sizeof (task_t));
|
||||
mutex_enter(&tq->tq_lock);
|
||||
}
|
||||
|
||||
@@ -112,7 +116,7 @@ task_free(taskq_t *tq, taskq_ent_t *t)
|
||||
taskqid_t
|
||||
taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
|
||||
{
|
||||
taskq_ent_t *t;
|
||||
task_t *t;
|
||||
|
||||
if (taskq_now) {
|
||||
func(arg);
|
||||
@@ -126,58 +130,26 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
|
||||
return (0);
|
||||
}
|
||||
if (tqflags & TQ_FRONT) {
|
||||
t->tqent_next = tq->tq_task.tqent_next;
|
||||
t->tqent_prev = &tq->tq_task;
|
||||
t->task_next = tq->tq_task.task_next;
|
||||
t->task_prev = &tq->tq_task;
|
||||
} else {
|
||||
t->tqent_next = &tq->tq_task;
|
||||
t->tqent_prev = tq->tq_task.tqent_prev;
|
||||
t->task_next = &tq->tq_task;
|
||||
t->task_prev = tq->tq_task.task_prev;
|
||||
}
|
||||
t->tqent_next->tqent_prev = t;
|
||||
t->tqent_prev->tqent_next = t;
|
||||
t->tqent_func = func;
|
||||
t->tqent_arg = arg;
|
||||
t->task_next->task_prev = t;
|
||||
t->task_prev->task_next = t;
|
||||
t->task_func = func;
|
||||
t->task_arg = arg;
|
||||
cv_signal(&tq->tq_dispatch_cv);
|
||||
mutex_exit(&tq->tq_lock);
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,
|
||||
taskq_ent_t *t)
|
||||
{
|
||||
ASSERT(func != NULL);
|
||||
ASSERT(!(tq->tq_flags & TASKQ_DYNAMIC));
|
||||
|
||||
/*
|
||||
* Mark it as a prealloc'd task. This is important
|
||||
* to ensure that we don't free it later.
|
||||
*/
|
||||
t->tqent_flags |= TQENT_FLAG_PREALLOC;
|
||||
/*
|
||||
* Enqueue the task to the underlying queue.
|
||||
*/
|
||||
mutex_enter(&tq->tq_lock);
|
||||
|
||||
if (flags & TQ_FRONT) {
|
||||
t->tqent_next = tq->tq_task.tqent_next;
|
||||
t->tqent_prev = &tq->tq_task;
|
||||
} else {
|
||||
t->tqent_next = &tq->tq_task;
|
||||
t->tqent_prev = tq->tq_task.tqent_prev;
|
||||
}
|
||||
t->tqent_next->tqent_prev = t;
|
||||
t->tqent_prev->tqent_next = t;
|
||||
t->tqent_func = func;
|
||||
t->tqent_arg = arg;
|
||||
cv_signal(&tq->tq_dispatch_cv);
|
||||
mutex_exit(&tq->tq_lock);
|
||||
}
|
||||
|
||||
void
|
||||
taskq_wait(taskq_t *tq)
|
||||
{
|
||||
mutex_enter(&tq->tq_lock);
|
||||
while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0)
|
||||
while (tq->tq_task.task_next != &tq->tq_task || tq->tq_active != 0)
|
||||
cv_wait(&tq->tq_wait_cv, &tq->tq_lock);
|
||||
mutex_exit(&tq->tq_lock);
|
||||
}
|
||||
@@ -186,32 +158,27 @@ static void *
|
||||
taskq_thread(void *arg)
|
||||
{
|
||||
taskq_t *tq = arg;
|
||||
taskq_ent_t *t;
|
||||
boolean_t prealloc;
|
||||
task_t *t;
|
||||
|
||||
mutex_enter(&tq->tq_lock);
|
||||
while (tq->tq_flags & TASKQ_ACTIVE) {
|
||||
if ((t = tq->tq_task.tqent_next) == &tq->tq_task) {
|
||||
if ((t = tq->tq_task.task_next) == &tq->tq_task) {
|
||||
if (--tq->tq_active == 0)
|
||||
cv_broadcast(&tq->tq_wait_cv);
|
||||
cv_wait(&tq->tq_dispatch_cv, &tq->tq_lock);
|
||||
tq->tq_active++;
|
||||
continue;
|
||||
}
|
||||
t->tqent_prev->tqent_next = t->tqent_next;
|
||||
t->tqent_next->tqent_prev = t->tqent_prev;
|
||||
t->tqent_next = NULL;
|
||||
t->tqent_prev = NULL;
|
||||
prealloc = t->tqent_flags & TQENT_FLAG_PREALLOC;
|
||||
t->task_prev->task_next = t->task_next;
|
||||
t->task_next->task_prev = t->task_prev;
|
||||
mutex_exit(&tq->tq_lock);
|
||||
|
||||
rw_enter(&tq->tq_threadlock, RW_READER);
|
||||
t->tqent_func(t->tqent_arg);
|
||||
t->task_func(t->task_arg);
|
||||
rw_exit(&tq->tq_threadlock);
|
||||
|
||||
mutex_enter(&tq->tq_lock);
|
||||
if (!prealloc)
|
||||
task_free(tq, t);
|
||||
task_free(tq, t);
|
||||
}
|
||||
tq->tq_nthreads--;
|
||||
cv_broadcast(&tq->tq_wait_cv);
|
||||
@@ -250,8 +217,8 @@ taskq_create(const char *name, int nthreads, pri_t pri,
|
||||
tq->tq_nthreads = nthreads;
|
||||
tq->tq_minalloc = minalloc;
|
||||
tq->tq_maxalloc = maxalloc;
|
||||
tq->tq_task.tqent_next = &tq->tq_task;
|
||||
tq->tq_task.tqent_prev = &tq->tq_task;
|
||||
tq->tq_task.task_next = &tq->tq_task;
|
||||
tq->tq_task.task_prev = &tq->tq_task;
|
||||
tq->tq_threadlist = kmem_alloc(nthreads * sizeof (thread_t), KM_SLEEP);
|
||||
|
||||
if (flags & TASKQ_PREPOPULATE) {
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* This file and its contents are supplied under the terms of the
|
||||
* Common Development and Distribution License ("CDDL"), version 1.0.
|
||||
* You may only use this file in accordance with the terms of version
|
||||
* 1.0 of the CDDL.
|
||||
*
|
||||
* A full copy of the text of the CDDL should have accompanied this
|
||||
* source. A copy of the CDDL is also available via the Internet at
|
||||
* http://www.illumos.org/license/CDDL.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
provider zfs {
|
||||
probe probe0(char *probename);
|
||||
probe probe1(char *probename, unsigned long arg1);
|
||||
probe probe2(char *probename, unsigned long arg1, unsigned long arg2);
|
||||
probe probe3(char *probename, unsigned long arg1, unsigned long arg2,
|
||||
unsigned long arg3);
|
||||
probe probe4(char *probename, unsigned long arg1, unsigned long arg2,
|
||||
unsigned long arg3, unsigned long arg4);
|
||||
|
||||
probe set__error(int err);
|
||||
};
|
||||
|
||||
#pragma D attributes Evolving/Evolving/ISA provider zfs provider
|
||||
#pragma D attributes Private/Private/Unknown provider zfs module
|
||||
#pragma D attributes Private/Private/Unknown provider zfs function
|
||||
#pragma D attributes Evolving/Evolving/ISA provider zfs name
|
||||
#pragma D attributes Evolving/Evolving/ISA provider zfs args
|
||||
@@ -20,7 +20,6 @@
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
#
|
||||
|
||||
"""This module implements the "zfs allow" and "zfs unallow" subcommands.
|
||||
@@ -220,7 +219,6 @@ perms_subcmd = dict(
|
||||
hold=_("Allows adding a user hold to a snapshot"),
|
||||
release=_("Allows releasing a user hold which\n\t\t\t\tmight destroy the snapshot"),
|
||||
diff=_("Allows lookup of paths within a dataset,\n\t\t\t\tgiven an object number. Ordinary users need this\n\t\t\t\tin order to use zfs diff"),
|
||||
bookmark="",
|
||||
)
|
||||
|
||||
perms_other = dict(
|
||||
|
||||
@@ -9,12 +9,10 @@ SUBDIR= ${_drti} \
|
||||
libnvpair \
|
||||
libumem \
|
||||
libuutil \
|
||||
${_libzfs_core} \
|
||||
${_libzfs} \
|
||||
${_libzpool}
|
||||
|
||||
.if ${MK_ZFS} != "no"
|
||||
_libzfs_core= libzfs_core
|
||||
_libzfs= libzfs
|
||||
.if ${MK_LIBTHR} != "no"
|
||||
_libzpool= libzpool
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
|
||||
|
||||
LIB= zfs
|
||||
DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \
|
||||
${LIBAVL} ${LIBZFS_CORE}
|
||||
LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core
|
||||
DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR}
|
||||
LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair
|
||||
|
||||
SRCS= deviceid.c \
|
||||
fsshare.c \
|
||||
@@ -18,7 +17,6 @@ SRCS= deviceid.c \
|
||||
zone.c
|
||||
|
||||
SRCS+= libzfs_changelist.c \
|
||||
libzfs_compat.c \
|
||||
libzfs_config.c \
|
||||
libzfs_dataset.c \
|
||||
libzfs_diff.c \
|
||||
@@ -55,6 +53,5 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
@@ -1,37 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
|
||||
|
||||
LIB= zfs_core
|
||||
DPADD= ${LIBNVPAIR}
|
||||
LDADD= -lnvpair
|
||||
|
||||
SRCS= libzfs_core.c \
|
||||
libzfs_core_compat.c
|
||||
|
||||
SRCS+= libzfs_compat.c
|
||||
|
||||
WARNS?= 0
|
||||
CSTD= c99
|
||||
CFLAGS+= -DZFS_NO_ACL
|
||||
CFLAGS+= -I${.CURDIR}/../../../sbin/mount
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
@@ -26,7 +26,7 @@ ATOMIC_SRCS= opensolaris_atomic.c
|
||||
|
||||
LIB= zpool
|
||||
|
||||
ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c trim_map.c
|
||||
ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c
|
||||
ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/}
|
||||
KERNEL_SRCS= kernel.c taskq.c util.c
|
||||
LIST_SRCS= list.c
|
||||
|
||||
@@ -13,7 +13,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
@@ -22,7 +21,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
|
||||
|
||||
DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \
|
||||
${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
|
||||
LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
|
||||
${LIBUTIL} ${LIBUUTIL} ${LIBZFS}
|
||||
LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -26,7 +26,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common
|
||||
|
||||
DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \
|
||||
${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
|
||||
LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
|
||||
${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS}
|
||||
LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -15,12 +15,11 @@ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/
|
||||
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../lib/libumem
|
||||
|
||||
DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \
|
||||
${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
|
||||
LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs_core -lzfs -lzpool
|
||||
${LIBZFS} ${LIBZPOOL} ${LIBUUTIL}
|
||||
LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -18,9 +18,8 @@ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../lib/libumem
|
||||
|
||||
DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
|
||||
${LIBPTHREAD} ${LIBAVL} ${LIBZFS_CORE} ${LIBZFS} ${LIBUUTIL}
|
||||
LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs_core -lzfs \
|
||||
-luutil
|
||||
${LIBPTHREAD} ${LIBAVL} ${LIBZFS} ${LIBUUTIL}
|
||||
LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs -luutil
|
||||
|
||||
CSTD= c99
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../lib/libumem
|
||||
|
||||
DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
|
||||
${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
|
||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
|
||||
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
||||
|
||||
CSTD= c99
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../lib/libumem
|
||||
|
||||
DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
|
||||
${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
|
||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
|
||||
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
||||
|
||||
CFLAGS+= -DDEBUG=1
|
||||
#DEBUG_FLAGS+= -g
|
||||
|
||||
+32
-692
@@ -1,681 +1,21 @@
|
||||
4006. [security] A flaw in delegation handling could be exploited
|
||||
to put named into an infinite loop. This has
|
||||
been addressed by placing limits on the number
|
||||
of levels of recursion named will allow (default 7),
|
||||
and the number of iterative queries that it will
|
||||
send (default 50) before terminating a recursive
|
||||
query (CVE-2014-8500).
|
||||
--- 9.8.4-P2 released ---
|
||||
|
||||
The recursion depth limit is configured via the
|
||||
"max-recursion-depth" option, and the query limit
|
||||
via the "max-recursion-queries" option. [RT #37580]
|
||||
3516. [security] Removed the check for regex.h in configure in order
|
||||
to disable regex syntax checking, as it exposes
|
||||
BIND to a critical flaw in libregex on some
|
||||
platforms. [RT #32688]
|
||||
|
||||
--- 9.8.7 released ---
|
||||
--- 9.8.4-P1 released ---
|
||||
|
||||
--- 9.8.7rc2 released ---
|
||||
|
||||
3710. [bug] Address double dns_zone_detach when switching to
|
||||
using automatic empty zones from regular zones.
|
||||
[RT #35177]
|
||||
|
||||
3707. [bug] irs_resconf_load now returns ISC_R_FILENOTFOUND
|
||||
on a missing resolv.conf file and initializes the
|
||||
structure as if it had been configured with:
|
||||
|
||||
nameserver ::1
|
||||
nameserver 127.0.0.1
|
||||
|
||||
Note: Callers will need to be updated to treat
|
||||
ISC_R_FILENOTFOUND as a qualified success or else
|
||||
they will leak memory. The following code fragment
|
||||
will work with both old and new versions without
|
||||
changing the behaviour of the existing code.
|
||||
|
||||
resconf = NULL;
|
||||
result = irs_resconf_load(mctx, "/etc/resolv.conf",
|
||||
&resconf);
|
||||
if (result != ISC_SUCCESS) {
|
||||
if (resconf != NULL)
|
||||
irs_resconf_destroy(&resconf);
|
||||
....
|
||||
}
|
||||
|
||||
[RT #35194]
|
||||
|
||||
3706. [contrib] queryperf: Fixed a possible integer overflow when
|
||||
printing results. [RT #35182]
|
||||
|
||||
3704. [protocol] Accept integer timestamps in RRSIG records. [RT #35185]
|
||||
|
||||
--- 9.8.7rc1 released ---
|
||||
|
||||
3701. [func] named-checkconf can now suppress the printing of
|
||||
shared secrets by specifying '-x'. [RT #34465]
|
||||
|
||||
3698. [cleanup] Replaced all uses of memcpy() with memmove().
|
||||
[RT #35120]
|
||||
|
||||
3697. [bug] Handle "." as a search list element when IDN support
|
||||
is enabled. [RT #35133]
|
||||
|
||||
3696. [bug] dig failed to handle AXFR style IXFR responses which
|
||||
span multiple messages. [RT #35137]
|
||||
|
||||
3695. [bug] Address a possible race in dispatch.c. [RT #35107]
|
||||
|
||||
3694. [bug] Warn when a key-directory is configured for a zone,
|
||||
but does not exist or is not a directory. [RT #35108]
|
||||
|
||||
3693. [security] memcpy was incorrectly called with overlapping
|
||||
ranges resulting in malformed names being generated
|
||||
on some platforms. This could cause INSIST failures
|
||||
when serving NSEC3 signed zones (CVE-2014-0591).
|
||||
[RT #35120]
|
||||
|
||||
3692. [bug] Two calls to dns_db_getoriginnode were fatal if there
|
||||
was no data at the node. [RT #35080]
|
||||
|
||||
3689. [bug] Fixed a bug causing an insecure delegation from one
|
||||
static-stub zone to another to fail with a broken
|
||||
trust chain. [RT #35081]
|
||||
|
||||
--- 9.8.7b1 released ---
|
||||
|
||||
3688. [bug] loadnode could return a freed node on out of memory.
|
||||
[RT #35106]
|
||||
|
||||
3683. [cleanup] Add a more detailed "not found" message to rndc
|
||||
commands which specify a zone name. [RT #35059]
|
||||
|
||||
3681. [port] Update the Windows build system to support feature
|
||||
selection and WIN64 builds. This is a work in
|
||||
progress. [RT #34160]
|
||||
|
||||
3679. [bug] dig could fail to clean up TCP sockets still
|
||||
waiting on connect(). [RT #35074]
|
||||
|
||||
3678. [port] Update config.guess and config.sub. [RT #35060]
|
||||
|
||||
3677. [bug] 'nsupdate' leaked memory if 'realm' was used multiple
|
||||
times. [RT #35073]
|
||||
|
||||
3676. [bug] "named-checkconf -z" now checks zones of type
|
||||
hint as well as master. [RT #35046]
|
||||
|
||||
3675. [misc] Provide a place for third parties to add version
|
||||
information for their extensions in the version
|
||||
file by setting the EXTENSIONS variable.
|
||||
|
||||
3670. [bug] Address read after free in server side of
|
||||
lwres_getrrsetbyname. [RT #29075]
|
||||
|
||||
3669. [port] freebsd: --with-gssapi needs -lhx509. [RT #35001]
|
||||
|
||||
3668. [bug] Fix cast in lex.c which could see 0xff treated as eof.
|
||||
[RT #34993]
|
||||
3667. [test] dig: add support to keep the TCP socket open between
|
||||
successive queries (+[no]keepopen). [RT #34918]
|
||||
|
||||
3664. [bug] Updated OpenSSL PKCS#11 patches to fix active list
|
||||
locking and other bugs. [RT #34855]
|
||||
|
||||
3663. [bug] Address bugs in dns_rdata_fromstruct and
|
||||
dns_rdata_tostruct for WKS and ISDN types. [RT #34910]
|
||||
|
||||
3662. [bug] 'host' could die if a UDP query timed out. [RT #34870]
|
||||
|
||||
3660. [cleanup] Changed the name of "isc-config.sh" to "bind9-config".
|
||||
[RT #23825]
|
||||
|
||||
3658. [port] linux: Address platform specific compilation issue
|
||||
when libcap-devel is installed. [RT #34838]
|
||||
|
||||
3656. [security] Treat an all zero netmask as invalid when generating
|
||||
the localnets acl. (The prior behavior could
|
||||
allow unexpected matches when using some versions
|
||||
of Winsock: CVE-2013-6320.) [RT #34687]
|
||||
|
||||
3655. [cleanup] Simplify TCP message processing when requesting a
|
||||
zone transfer. [RT #34825]
|
||||
|
||||
3654. [bug] Address race condition with manual notify requests.
|
||||
[RT #34806]
|
||||
|
||||
3653. [func] Create delegations for all "children" of empty zones
|
||||
except "forward first". [RT #34826]
|
||||
|
||||
3651. [tuning] Adjust when a master server is deemed unreachable.
|
||||
[RT #27075]
|
||||
|
||||
3650. [tuning] Use separate rate limiting queues for refresh and
|
||||
notify requests. [RT #30589]
|
||||
|
||||
3649. [cleanup] Include a comment in .nzf files, giving the name of
|
||||
the associated view. [RT #34765]
|
||||
|
||||
3648. [test] Updated the ATF test framework to version 0.17.
|
||||
[RT #25627]
|
||||
|
||||
3646. [bug] Journal filename string could be set incorrectly,
|
||||
causing garbage in log messages. [RT #34738]
|
||||
|
||||
3645. [protocol] Use case sensitive compression when responding to
|
||||
queries. [RT #34737]
|
||||
|
||||
3644. [protocol] Check that EDNS subnet client options are well formed.
|
||||
[RT #34718]
|
||||
|
||||
3641. [bug] Handle changes to sig-validity-interval settings
|
||||
better. [RT #34625]
|
||||
|
||||
3640. [bug] ndots was not being checked when searching. Only
|
||||
continue searching on NXDOMAIN responses. Add the
|
||||
ability to specify ndots to nslookup. [RT #34711]
|
||||
|
||||
3639. [bug] Treat type 65533 (KEYDATA) as opaque except when used
|
||||
in a key zone. [RT #34238]
|
||||
|
||||
--- 9.8.6 released ---
|
||||
|
||||
3638. [cleanup] Add the ability to handle ENOPROTOOPT in case it is
|
||||
encountered. [RT #34668]
|
||||
|
||||
--- 9.8.6rc2 released ---
|
||||
|
||||
3637. [bug] 'allow-query-on' was checking the source address
|
||||
rather than the destination address. [RT #34590]
|
||||
|
||||
3636. [bug] Automatic empty zones now behave better with
|
||||
forward only "zones" beneath them. [RT #34583]
|
||||
|
||||
3635. [bug] Signatures were not being removed from a zone with
|
||||
only KSK keys for a algorithm. [RT #34439]
|
||||
|
||||
3634. [func] Report build-id in rndc status. Report build-id
|
||||
when building from a git repository. [RT #20422]
|
||||
|
||||
3633. [cleanup] Refactor OPT processing in named to make it easier
|
||||
to support new EDNS options. [RT #34414]
|
||||
|
||||
3632. [bug] Signature from newly inactive keys were not being
|
||||
removed. [RT #32178]
|
||||
|
||||
3631. [bug] Remove spurious warning about missing signatures when
|
||||
qtype is SIG. [RT #34600]
|
||||
|
||||
3630. [bug] Ensure correct ID computation for MD5 keys. [RT #33033]
|
||||
|
||||
3627. [bug] RPZ changes were not effective on slaves. [RT #34450]
|
||||
|
||||
3625. [bug] Don't send notify messages to machines outside of the
|
||||
test setup.
|
||||
|
||||
--- 9.8.6rc1 released ---
|
||||
|
||||
3621. [security] Incorrect bounds checking on private type 'keydata'
|
||||
can lead to a remotely triggerable REQUIRE failure
|
||||
(CVE-2013-4854). [RT #34238]
|
||||
|
||||
3615. [cleanup] "configure" now finishes by printing a summary
|
||||
of optional BIND features and whether they are
|
||||
active or inactive. ("configure --enable-full-report"
|
||||
increases the verbosity of the summary.) [RT #31777]
|
||||
|
||||
3614. [port] Check for <linux/types.h>. [RT #34162]
|
||||
|
||||
3611. [bug] Improved resistance to a theoretical authentication
|
||||
attack based on differential timing. [RT #33939]
|
||||
|
||||
3610. [cleanup] win32: Some executables had been omitted from the
|
||||
installer. [RT #34116]
|
||||
|
||||
3608. [port] win32: added todos.pl script to ensure all text files
|
||||
the win32 build depends on are converted to DOS
|
||||
newline format. [RT #22067]
|
||||
|
||||
3607. [bug] dnssec-keygen had broken 'Invalid keyfile' error
|
||||
message. [RT #34045]
|
||||
|
||||
--- 9.8.6b1 released ---
|
||||
|
||||
3605. [port] win32: Addressed several compatibility issues
|
||||
with newer versions of Visual Studio. [RT #33916]
|
||||
|
||||
3603. [bug] Install <isc/stat.h>. [RT #33956]
|
||||
|
||||
3601. [bug] Added to PKCS#11 openssl patches a value len
|
||||
attribute in DH derive key. [RT #33928]
|
||||
|
||||
3600. [cleanup] dig: Fixed a typo in the warning output when receiving
|
||||
an oversized response. [RT #33910]
|
||||
|
||||
3599. [tuning] Check for pointer equivalence in name comparisons.
|
||||
[RT #18125]
|
||||
|
||||
3594. [maint] Update config.guess and config.sub. [RT #33816]
|
||||
|
||||
3592. [doc] Moved documentation of rndc command options to the
|
||||
rndc man page. [RT #33506]
|
||||
|
||||
3588. [bug] dig: addressed a memory leak in the sigchase code
|
||||
that could cause a shutdown crash. [RT #33733]
|
||||
|
||||
3587. [func] 'named -g' now checks the logging configuration but
|
||||
does not use it. [RT #33473]
|
||||
|
||||
3586. [bug] Handle errors in xmlDocDumpFormatMemoryEnc. [RT #33706]
|
||||
|
||||
3584. [security] Caching data from an incompletely signed zone could
|
||||
trigger an assertion failure in resolver.c
|
||||
(CVE-2013-3919). [RT #33690]
|
||||
|
||||
3583. [bug] Address memory leak in GSS-API processing [RT #33574]
|
||||
|
||||
3581. [bug] Changed the tcp-listen-queue default to 10. [RT #33029]
|
||||
|
||||
3580. [bug] Addressed a possible race in acache.c [RT #33602]
|
||||
|
||||
3579. [maint] Updates to PKCS#11 openssl patches, supporting
|
||||
versions 0.9.8y, 1.0.0k, 1.0.1e [RT #33463]
|
||||
|
||||
3578. [bug] 'rndc -c file' now fails if 'file' does not exist.
|
||||
[RT #33571]
|
||||
|
||||
3577. [bug] Handle zero TTL values better. [RT #33411]
|
||||
|
||||
3576. [bug] Address a shutdown race when validating. [RT #33573]
|
||||
|
||||
3574. [doc] The 'hostname' keyword was missing from server-id
|
||||
description in the named.conf man page. [RT #33476]
|
||||
|
||||
3573. [bug] "rndc addzone" and "rndc delzone" incorrectly handled
|
||||
zone names containing punctuation marks and other
|
||||
nonstandard characters. [RT #33419]
|
||||
|
||||
3571. [bug] Address race condition in dns_client_startresolve().
|
||||
[RT #33234]
|
||||
|
||||
3566. [func] Log when forwarding updates to master. [RT #33240]
|
||||
|
||||
--- 9.8.5 released ---
|
||||
|
||||
3568. [cleanup] Add a product description line to the version file,
|
||||
to be reported by named -v/-V. [RT #33366]
|
||||
|
||||
3567. [bug] Silence clang static analyzer warnings. [RT #33365]
|
||||
|
||||
3563. [contrib] zone2sqlite failed with some table names. [RT #33375]
|
||||
|
||||
3561. [bug] dig: issue a warning if an EDNS query returns FORMERR
|
||||
or NOTIMP. Adjust usage message. [RT #33363]
|
||||
|
||||
--- 9.8.5rc1 released ---
|
||||
|
||||
3560. [bug] isc-config.sh did not honor includedir and libdir
|
||||
when set via configure. [RT #33345]
|
||||
|
||||
3559. [func] Check that both forms of Sender Policy Framework
|
||||
records exist or do not exist. [RT #33355]
|
||||
|
||||
3558. [bug] IXFR of a DLZ stored zone was broken. [RT #33331]
|
||||
|
||||
3556. [maint] Added AAAA for D.ROOT-SERVERS.NET.
|
||||
|
||||
3555. [bug] Address theoretical race conditions in acache.c
|
||||
(change #3553 was incomplete). [RT #33252]
|
||||
|
||||
3553. [bug] Address suspected double free in acache. [RT #33252]
|
||||
|
||||
3552. [bug] Wrong getopt option string for 'nsupdate -r'.
|
||||
[RT #33280]
|
||||
|
||||
3549. [doc] Documentation for "request-nsid" was missing.
|
||||
[RT #33153]
|
||||
|
||||
3548. [bug] The NSID request code in resolver.c was broken
|
||||
resulting in invalid EDNS options being sent.
|
||||
[RT #33153]
|
||||
|
||||
3547. [bug] Some malformed unknown rdata records were not properly
|
||||
detected and rejected. [RT #33129]
|
||||
|
||||
3056. [func] Added support for URI resource record. [RT #23386]
|
||||
|
||||
--- 9.8.5rc1 released ---
|
||||
|
||||
3546. [func] Add EUI48 and EUI64 types. [RT #33082]
|
||||
|
||||
3544. [contrib] check5011.pl: Script to report the status of
|
||||
managed keys as recorded in managed-keys.bind.
|
||||
Contributed by Tony Finch <[email protected]>
|
||||
|
||||
3543. [bug] Update socket structure before attaching to socket
|
||||
manager after accept. [RT #33084]
|
||||
|
||||
3542. [bug] masterformat system test was broken. [RT #33086]
|
||||
|
||||
3541. [bug] Parts of libdns were not properly initialized when
|
||||
built in libexport mode. [RT #33028]
|
||||
|
||||
3540. [test] libt_api: t_info and t_assert were not thread safe.
|
||||
|
||||
3539. [port] win32: timestamp format didn't match other platforms.
|
||||
|
||||
3538. [test] Running "make test" now requires loopback interfaces
|
||||
to be set up. [RT #32452]
|
||||
|
||||
3537. [tuning] Slave zones, when updated, now send NOTIFY messages
|
||||
to peers before being dumped to disk rather than
|
||||
after. [RT #27242]
|
||||
|
||||
3535. [bug] Minor win32 cleanups. [RT #32962]
|
||||
|
||||
3534. [bug] Extra text after an embedded NULL was ignored when
|
||||
parsing zone files. [RT #32699]
|
||||
|
||||
3533. [contrib] query-loc-0.4.0: memory leaks. [RT #32960]
|
||||
|
||||
3532. [contrib] zkt: fixed buffer overrun, resource leaks. [RT #32960]
|
||||
|
||||
3531. [bug] win32: A uninitialized value could be returned on out
|
||||
of memory. [RT #32960]
|
||||
|
||||
3530. [contrib] Better RTT tracking in queryperf. [RT #30128]
|
||||
|
||||
3526. [cleanup] Set up dependencies for unit tests correctly during
|
||||
build. [RT #32803]
|
||||
|
||||
3521. [bug] Address memory leak in opensslecdsa_link.c. [RT #32249]
|
||||
|
||||
3520. [bug] 'mctx' was not being referenced counted in some places
|
||||
where it should have been. [RT #32794]
|
||||
|
||||
--- 9.8.5b2 released ---
|
||||
|
||||
3517. [bug] Reorder destruction to avoid shutdown race. [RT #32777]
|
||||
|
||||
3515. [port] '%T' is not portable in strftime(). [RT #32763]
|
||||
|
||||
3514. [bug] The ranges for valid key sizes in ddns-confgen and
|
||||
rndc-confgen were too constrained. Keys up to 512
|
||||
bits are now allowed for most algorithms, and up
|
||||
to 1024 bits for hmac-sha384 and hmac-sha512.
|
||||
[RT #32753]
|
||||
|
||||
3509. [cleanup] Added a product line to version file to allow for
|
||||
easy naming of different products (BIND
|
||||
vs BIND ESV, for example). [RT #32755]
|
||||
|
||||
3508. [contrib] queryperf was incorrectly rejecting the -T option.
|
||||
[RT #32338]
|
||||
|
||||
3503. [doc] Clarify size_spec syntax. [RT #32449]
|
||||
|
||||
3500. [security] Support NAPTR regular expression validation on
|
||||
all platforms without using libregex, which
|
||||
can be vulnerable to memory exhaustion attack
|
||||
(CVE-2013-2266). [RT #32688]
|
||||
|
||||
3499. [doc] Corrected ARM documentation of built-in zones.
|
||||
[RT #32694]
|
||||
|
||||
3498. [bug] zone statistics for zones which matched a potential
|
||||
empty zone could have their zone-statistics setting
|
||||
overridden.
|
||||
|
||||
3496. [func] Improvements to RPZ performance. The "response-policy"
|
||||
syntax now includes a "min-ns-dots" clause, with
|
||||
default 1, to exclude top-level domains from
|
||||
NSIP and NSDNAME checking. --enable-rpz-nsip and
|
||||
--enable-rpz-nsdname are now the default. [RT #32251]
|
||||
|
||||
3489. [bug] --enable-developer now turns on ISC_LIST_CHECKINIT.
|
||||
When cloning a rdataset do not copy the link contents.
|
||||
[RT #32651]
|
||||
|
||||
3488. [bug] Use after free error with DH generated keys. [RT #32649]
|
||||
|
||||
3487. [bug] Change 3444 was not complete. There was a additional
|
||||
place where the NOQNAME proof needed to be saved.
|
||||
[RT #32629]
|
||||
|
||||
3486. [bug] named could crash when using TKEY-negotiated keys
|
||||
that had been deleted and then recreated. [RT #32506]
|
||||
|
||||
3485. [cleanup] Only compile openssl_gostlink.c if we support GOST.
|
||||
|
||||
3481. [cleanup] Removed use of const const in atf.
|
||||
|
||||
3479. [bug] Address potential memory leaks in gssapi support
|
||||
code. [RT #32405]
|
||||
|
||||
3478. [port] Fix a build failure in strict C99 environments
|
||||
[RT #32475]
|
||||
|
||||
3474. [bug] nsupdate could assert when the local and remote
|
||||
address families didn't match. [RT #22897]
|
||||
|
||||
3470. [bug] Slave zones could fail to dump when successfully
|
||||
refreshing after an initial failure. [RT #31276]
|
||||
|
||||
--- 9.8.5b1 released ---
|
||||
|
||||
3468. [security] RPZ rules to generate A records (but not AAAA records)
|
||||
could trigger an assertion failure when used in
|
||||
conjunction with DNS64 (CVE-2012-5689). [RT #32141]
|
||||
|
||||
3467. [bug] Added checks in dnssec-keygen and dnssec-settime
|
||||
to check for delete date < inactive date. [RT #31719]
|
||||
|
||||
3465. [bug] Handle isolated reserved ports. [RT #31778]
|
||||
|
||||
3464. [maint] Updates to PKCS#11 openssl patches, supporting
|
||||
versions 0.9.8x, 1.0.0j, 1.0.1c [RT #29749]
|
||||
|
||||
3463. [doc] Clarify managed-keys syntax in ARM. [RT #32232]
|
||||
|
||||
3462. [doc] Clarify server selection behavior of dig when using
|
||||
-4 or -6 options. [RT #32181]
|
||||
|
||||
3461. [bug] Negative responses could incorrectly have AD=1
|
||||
set. [RT #32237]
|
||||
|
||||
3458. [bug] Return FORMERR when presented with a overly long
|
||||
domain named in a request. [RT #29682]
|
||||
|
||||
3457. [protocol] Add ILNP records (NID, LP, L32, L64). [RT #31836]
|
||||
|
||||
3456. [port] g++47: ATF failed to compile. [RT #32012]
|
||||
|
||||
3455. [contrib] queryperf: fix getopt option list. [RT #32338]
|
||||
|
||||
3454. [port] sparc64: improve atomic support. [RT #25182]
|
||||
|
||||
3452. [bug] Accept duplicate singleton records. [RT #32329]
|
||||
|
||||
3451. [port] Increase per thread stack size from 64K to 1M.
|
||||
[RT #32230]
|
||||
|
||||
3450. [bug] Stop logfileconfig system test spam system logs.
|
||||
[RT #32315]
|
||||
|
||||
3449. [bug] gen.c: use the pre-processor to construct format
|
||||
strings so that compiler can perform sanity checks;
|
||||
check the snprintf results. [RT #17576]
|
||||
|
||||
3448. [bug] The allow-query-on ACL was not processed correctly.
|
||||
[RT #29486]
|
||||
|
||||
3447. [port] Add support for libxml2-2.9.x [RT #32231]
|
||||
|
||||
3446. [port] win32: Add source ID (see change #3400) to build.
|
||||
[RT #31683]
|
||||
|
||||
3445. [bug] Warn about zone files with blank owner names
|
||||
immediately after $ORIGIN directives. [RT #31848]
|
||||
|
||||
3444. [bug] The NOQNAME proof was not being returned from cached
|
||||
insecure responses. [RT #21409]
|
||||
|
||||
3443. [bug] ddns-confgen: Some TSIG algorithms were incorrectly
|
||||
rejected when generating keys. [RT #31927]
|
||||
|
||||
3442. [port] Net::DNS 0.69 introduced a non backwards compatible
|
||||
change. [RT #32216]
|
||||
|
||||
3441. [maint] D.ROOT-SERVERS.NET is now 199.7.91.13.
|
||||
|
||||
3440. [bug] Reorder get_key_struct to not trigger a assertion when
|
||||
cleaning up due to out of memory error. [RT #32131]
|
||||
|
||||
3439. [bug] contrib/dlz error checking fixes. [RT #32102]
|
||||
|
||||
3438. [bug] Don't accept unknown data escape in quotes. [RT #32031]
|
||||
|
||||
3437. [bug] isc_buffer_init -> isc_buffer_constinit to initialize
|
||||
buffers with constant data. [RT #32064]
|
||||
|
||||
3436. [bug] Check malloc/calloc return values. [RT #32088]
|
||||
|
||||
3435. [bug] Cross compilation support in configure was broken.
|
||||
[RT #32078]
|
||||
|
||||
3431. [bug] ddns-confgen: Some valid key algorithms were
|
||||
not accepted. [RT #31927]
|
||||
|
||||
3430. [bug] win32: isc_time_formatISO8601 was missing the
|
||||
'T' between the date and time. [RT #32044]
|
||||
|
||||
3429. [bug] dns_zone_getserial2 could a return success without
|
||||
returning a valid serial. [RT #32007]
|
||||
|
||||
3428. [cleanup] dig: Add timezone to date output. [RT #2269]
|
||||
|
||||
3427. [bug] dig +trace incorrectly displayed name server
|
||||
addresses instead of names. [RT #31641]
|
||||
|
||||
3425. [bug] "acacheentry" reference counting was broken resulting
|
||||
in use after free. [RT #31908]
|
||||
|
||||
3422. [bug] Added a clear error message for when the SOA does not
|
||||
match the referral. [RT #31281]
|
||||
|
||||
3421. [bug] Named loops when re-signing if all keys are offline.
|
||||
[RT #31916]
|
||||
|
||||
3420. [bug] Address VPATH compilation issues. [RT #31879]
|
||||
|
||||
3419. [bug] Memory leak on validation cancel. [RT #31869]
|
||||
|
||||
3415. [bug] named could die with a REQUIRE failure if a validation
|
||||
was canceled. [RT #31804]
|
||||
|
||||
3412. [bug] Copy timeval structure from control message data.
|
||||
[RT #31548]
|
||||
|
||||
3411. [tuning] Use IPV6_USE_MIN_MTU or equivalent with TCP in addition
|
||||
to UDP. [RT #31690]
|
||||
|
||||
3410. [bug] Addressed Coverity warnings. [RT #31626]
|
||||
|
||||
3409. [contrib] contrib/dane/mkdane.sh: Tool to generate TLSA RR's
|
||||
from X.509 certificates, for use with DANE
|
||||
(DNS-based Authentication of Named Entities).
|
||||
[RT #30513]
|
||||
|
||||
3406. [bug] mem.c: Fix compilation errors when building with
|
||||
ISC_MEM_TRACKLINES or ISC_MEMPOOL_NAMES disabled.
|
||||
Also, ISC_MEM_DEBUG is no longer optional. [RT #31559]
|
||||
|
||||
3405. [bug] Handle time going backwards in acache. [RT #31253]
|
||||
|
||||
3404. [bug] dnssec-signzone: When re-signing a zone, remove
|
||||
RRSIG and NSEC records from nodes that used to be
|
||||
in-zone but are now below a zone cut. [RT #31556]
|
||||
|
||||
3403. [bug] Silence noisy OpenSSL logging. [RT #31497]
|
||||
|
||||
3402. [test] The IPv6 interface numbers used for system
|
||||
tests were incorrect on some platforms. [RT #25085]
|
||||
|
||||
3401. [bug] Addressed Coverity warnings. [RT #31484]
|
||||
|
||||
3400. [cleanup] "named -V" can now report a source ID string, defined
|
||||
in the "srcid" file in the build tree and normally set
|
||||
to the most recent git hash. [RT #31494]
|
||||
|
||||
3397. [bug] dig crashed when using +nssearch with +tcp. [RT #25298]
|
||||
|
||||
3396. [bug] OPT records were incorrectly removed from signed,
|
||||
truncated responses. [RT #31439]
|
||||
|
||||
3395. [protocol] Add RFC 6598 reverse zones to built in empty zones
|
||||
list, 64.100.IN-ADDR.ARPA ... 127.100.IN-ADDR.ARPA.
|
||||
[RT #31336]
|
||||
|
||||
3394. [bug] Adjust 'successfully validated after lower casing
|
||||
signer' log level and category. [RT #31414]
|
||||
|
||||
3393. [bug] 'host -C' could core dump if REFUSED was received.
|
||||
[RT #31381]
|
||||
|
||||
3391. [bug] A DNSKEY lookup that encountered a CNAME failed.
|
||||
[RT #31262]
|
||||
|
||||
3390. [bug] Silence clang compiler warnings. [RT #30417]
|
||||
|
||||
3389. [bug] Always return NOERROR (not 0) in TSIG. [RT #31275]
|
||||
|
||||
3388. [bug] Fixed several Coverity warnings.
|
||||
Note: This change includes a fix for a bug that
|
||||
was subsequently determined to be an exploitable
|
||||
security vulnerability, CVE-2012-5688: named could
|
||||
die on specific queries with dns64 enabled.
|
||||
[RT #30996]
|
||||
|
||||
3386. [bug] Address locking violation when generating new NSEC /
|
||||
NSEC3 chains. [RT #31224]
|
||||
|
||||
3384. [bug] Improved logging of crypto errors. [RT #30963]
|
||||
|
||||
3383. [security] A certain combination of records in the RBT could
|
||||
cause named to hang while populating the additional
|
||||
section of a response. [RT #31090]
|
||||
|
||||
3382. [bug] SOA query from slave used use-v6-udp-ports range,
|
||||
if set, regardless of the address family in use.
|
||||
[RT #24173]
|
||||
|
||||
3381. [contrib] Update queryperf to support more RR types.
|
||||
[RT #30762]
|
||||
|
||||
3380. [bug] named could die if a nonexistent master list was
|
||||
referenced in a also-notify. [RT #31004]
|
||||
|
||||
3379. [bug] isc_interval_zero and isc_time_epoch should be
|
||||
"const (type)* const". [RT #31069]
|
||||
|
||||
3378. [bug] Handle missing 'managed-keys-directory' better.
|
||||
[RT #30625]
|
||||
|
||||
3376. [bug] Lack of EDNS support was being recorded without a
|
||||
successful response. [RT #30811]
|
||||
|
||||
3375. [func] Check that 'rndc dumpdb' works on a empty cache.
|
||||
[RT #30808]
|
||||
|
||||
3374. [bug] isc_parse_uint32 failed to return a range error on
|
||||
systems with 64 bit longs. [RT #30232]
|
||||
|
||||
3372. [bug] Silence spurious "deleted from unreachable cache"
|
||||
messages. [RT #30501]
|
||||
|
||||
3371. [bug] AD=1 should behave like DO=1 when deciding whether to
|
||||
add NS RRsets to the additional section or not.
|
||||
[RT #30479]
|
||||
3407. [security] Named could die on specific queries with dns64 enabled.
|
||||
[Addressed in change #3388 for BIND 9.8.5 and 9.9.3.]
|
||||
|
||||
--- 9.8.4 released ---
|
||||
|
||||
3383. [security] A certain combination of records in the RBT could
|
||||
cause named to hang while populating the additional
|
||||
section of a response. [RT #31090]
|
||||
|
||||
3373. [bug] win32: open raw files in binary mode. [RT #30944]
|
||||
|
||||
3364. [security] Named could die on specially crafted record.
|
||||
@@ -795,11 +135,11 @@
|
||||
--- 9.8.3 released ---
|
||||
|
||||
3318. [tuning] Reduce the amount of work performed while holding a
|
||||
bucket lock when finished with a fetch context.
|
||||
bucket lock when finshed with a fetch context.
|
||||
[RT #29239]
|
||||
|
||||
3314. [bug] The masters list could be updated while stub_callback
|
||||
or refresh_callback were using it. [RT #26732]
|
||||
3314. [bug] The masters list could be updated while refesh_callback
|
||||
and stub_callback were using it. [RT #26732]
|
||||
|
||||
3313. [protocol] Add TLSA record type. [RT #28989]
|
||||
|
||||
@@ -811,7 +151,7 @@
|
||||
|
||||
3310. [test] Increase table size for mutex profiling. [RT #28809]
|
||||
|
||||
3309. [bug] resolver.c:fctx_finddone() was not thread safe.
|
||||
3309. [bug] resolver.c:fctx_finddone() was not threadsafe.
|
||||
[RT #27995]
|
||||
|
||||
3307. [bug] Add missing ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS.
|
||||
@@ -988,7 +328,7 @@
|
||||
|
||||
3234. [bug] 'make depend' produced invalid makefiles. [RT #26830]
|
||||
|
||||
3231. [bug] named could fail to send a incompressible zone.
|
||||
3231. [bug] named could fail to send a uncompressable zone.
|
||||
[RT #26796]
|
||||
|
||||
3230. [bug] 'dig axfr' failed to properly handle a multi-message
|
||||
@@ -1005,7 +345,7 @@
|
||||
|
||||
3226. [bug] Address minor resource leakages. [RT #26624]
|
||||
|
||||
3221. [bug] Fixed a potential core dump on shutdown due to
|
||||
3221. [bug] Fixed a potential coredump on shutdown due to
|
||||
referencing fetch context after it's been freed.
|
||||
[RT #26720]
|
||||
|
||||
@@ -1029,7 +369,7 @@
|
||||
|
||||
3209. [func] Add "dnssec-lookaside 'no'". [RT #24858]
|
||||
|
||||
3208. [bug] 'dig -y' handle unknown tsig algorithm better.
|
||||
3208. [bug] 'dig -y' handle unknown tsig alorithm better.
|
||||
[RT #25522]
|
||||
|
||||
3207. [contrib] Fixed build error in Berkeley DB DLZ module. [RT #26444]
|
||||
@@ -1332,7 +672,7 @@
|
||||
3077. [bug] zone.c:zone_refreshkeys() incorrectly called
|
||||
dns_zone_attach(), use zone->irefs instead. [RT #23303]
|
||||
|
||||
3075. [bug] dns_dnssec_findzonekeys{2} used a inconsistent
|
||||
3075. [bug] dns_dnssec_findzonekeys{2} used a inconsistant
|
||||
timestamp when determining which keys are active.
|
||||
[RT #23642]
|
||||
|
||||
@@ -1346,7 +686,7 @@
|
||||
3072. [bug] dns_dns64_aaaaok() potential NULL pointer dereference.
|
||||
[RT #20256]
|
||||
|
||||
3071. [bug] has_nsec could be used uninitialized in
|
||||
3071. [bug] has_nsec could be used unintialised in
|
||||
update.c:next_active. [RT #20256]
|
||||
|
||||
3070. [bug] dnssec-signzone potential NULL pointer dereference.
|
||||
@@ -1392,7 +732,7 @@
|
||||
|
||||
3052. [test] Fixed last autosign test report. [RT #23256]
|
||||
|
||||
3051. [bug] NS records obscure DNAME records at the bottom of the
|
||||
3051. [bug] NS records obsure DNAME records at the bottom of the
|
||||
zone if both are present. [RT #23035]
|
||||
|
||||
3050. [bug] The autosign system test was timing dependent.
|
||||
@@ -1402,7 +742,7 @@
|
||||
3049. [bug] Save and restore the gid when creating creating
|
||||
named.pid at startup. [RT #23290]
|
||||
|
||||
3048. [bug] Fully separate view key management. [RT #23419]
|
||||
3048. [bug] Fully separate view key mangement. [RT #23419]
|
||||
|
||||
3047. [bug] DNSKEY NODATA responses not cached fixed in
|
||||
validator.c. Tests added to dnssec system test.
|
||||
@@ -1739,7 +1079,7 @@
|
||||
no data response. [RT #21744]
|
||||
|
||||
2952. [port] win32: named-checkzone and named-checkconf failed
|
||||
to initialize winsock. [RT #21932]
|
||||
to initialise winsock. [RT #21932]
|
||||
|
||||
2951. [bug] named failed to generate a correct signed response
|
||||
in a optout, delegation only zone with no secure
|
||||
@@ -1785,7 +1125,7 @@
|
||||
in use. [RT# 21868]
|
||||
|
||||
2938. [bug] When generating signed responses, from a signed zone
|
||||
that uses NSEC3, named would use a uninitialized
|
||||
that uses NSEC3, named would use a uninitialised
|
||||
pointer if it needed to skip a NSEC3 record because
|
||||
it didn't match the selected NSEC3PARAM record for
|
||||
zone. [RT# 21868]
|
||||
@@ -1839,7 +1179,7 @@
|
||||
revisit the issue and complete the fix later.
|
||||
[RT #21710]
|
||||
|
||||
2930. [experimental] New "rndc addzone" and "rndc delzone" commands
|
||||
2930. [experimental] New "rndc addzone" and "rndc delzone" commads
|
||||
allow dynamic addition and deletion of zones.
|
||||
To enable this feature, specify a "new-zone-file"
|
||||
option at the view or options level in named.conf.
|
||||
@@ -2015,7 +1355,7 @@
|
||||
successfully responds to the query using plain DNS.
|
||||
[RT #20930]
|
||||
|
||||
2873. [bug] Canceling a dynamic update via the dns/client module
|
||||
2873. [bug] Cancelling a dynamic update via the dns/client module
|
||||
could trigger an assertion failure. [RT #21133]
|
||||
|
||||
2872. [bug] Modify dns/client.c:dns_client_createx() to only
|
||||
@@ -2057,7 +1397,7 @@
|
||||
|
||||
2860. [bug] named-checkconf's usage was out of date. [RT #21039]
|
||||
|
||||
2859. [bug] When canceling validation it was possible to leak
|
||||
2859. [bug] When cancelling validation it was possible to leak
|
||||
memory. [RT #20800]
|
||||
|
||||
2858. [bug] RTT estimates were not being adjusted on ICMP errors.
|
||||
@@ -2610,7 +1950,7 @@
|
||||
|
||||
2695. [func] DHCP/DDNS - update fdwatch code for use by
|
||||
DHCP. Modify the api to isc_sockfdwatch_t (the
|
||||
callback function for isc_socket_fdwatchcreate)
|
||||
callback functon for isc_socket_fdwatchcreate)
|
||||
to include information about the direction (read
|
||||
or write) and add isc_socket_fdwatchpoke.
|
||||
[RT #20253]
|
||||
@@ -2675,7 +2015,7 @@
|
||||
sets the time when a key is no longer used for
|
||||
signing but is still published.
|
||||
- The "unpublished" date (-U) is deprecated in
|
||||
favor of "deleted" (-D).
|
||||
favour of "deleted" (-D).
|
||||
[RT #20247]
|
||||
|
||||
2676. [bug] --with-export-installdir should have been
|
||||
@@ -3121,7 +2461,7 @@
|
||||
|
||||
2553. [bug] Reference leak on DNSSEC validation errors. [RT #19291]
|
||||
|
||||
2552. [bug] zero-no-soa-ttl-cache was not being honored.
|
||||
2552. [bug] zero-no-soa-ttl-cache was not being honoured.
|
||||
[RT #19340]
|
||||
|
||||
2551. [bug] Potential Reference leak on return. [RT #19341]
|
||||
@@ -3174,7 +2514,7 @@
|
||||
|
||||
2534. [func] Check NAPTR records regular expressions and
|
||||
replacement strings to ensure they are syntactically
|
||||
valid and consistent. [RT #18168]
|
||||
valid and consistant. [RT #18168]
|
||||
|
||||
2533. [doc] ARM: document @ (at-sign). [RT #17144]
|
||||
|
||||
|
||||
+8
-28
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright (C) 1996-2003 Internet Software Consortium.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -13,6 +13,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
$Id: COPYRIGHT,v 1.17.14.2 2012/01/04 23:46:18 tbox Exp $
|
||||
|
||||
Portions of this code release fall under one or more of the
|
||||
following Copyright notices. Please see individual source
|
||||
files for details.
|
||||
@@ -97,7 +99,11 @@ are met:
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University nor the names of its contributors
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the University of
|
||||
California, Berkeley and its contributors.
|
||||
4. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
@@ -510,29 +516,3 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1995, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
Frequently Asked Questions about BIND 9
|
||||
|
||||
Copyright © 2004-2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright © 2004-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
|
||||
Copyright © 2000-2003 Internet Software Consortium.
|
||||
|
||||
@@ -869,7 +869,7 @@ A: If you run Tiger(Mac OS 10.4) or later then this is all you need to do:
|
||||
Copy the key statement from /etc/rndc.conf into /etc/rndc.key, e.g.:
|
||||
|
||||
key "rndc-key" {
|
||||
algorithm hmac-sha256;
|
||||
algorithm hmac-md5;
|
||||
secret "uvceheVuqf17ZwIcTydddw==";
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []>
|
||||
<!--
|
||||
- Copyright (C) 2004-2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -30,7 +30,6 @@
|
||||
<year>2008</year>
|
||||
<year>2009</year>
|
||||
<year>2010</year>
|
||||
<year>2013</year>
|
||||
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
|
||||
</copyright>
|
||||
<copyright>
|
||||
@@ -1565,7 +1564,7 @@ rand_irqs="3 14 15"</programlisting>
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
key "rndc-key" {
|
||||
algorithm hmac-sha256;
|
||||
algorithm hmac-md5;
|
||||
secret "uvceheVuqf17ZwIcTydddw==";
|
||||
};</programlisting>
|
||||
</informalexample>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2004-2009, 2011-2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 1998-2002 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -54,32 +54,16 @@ installdirs:
|
||||
|
||||
install:: isc-config.sh installdirs
|
||||
${INSTALL_SCRIPT} isc-config.sh ${DESTDIR}${bindir}
|
||||
rm -f ${DESTDIR}${bindir}/bind9-config
|
||||
@LN@ ${DESTDIR}${bindir}/isc-config.sh ${DESTDIR}${bindir}/bind9-config
|
||||
${INSTALL_DATA} ${top_srcdir}/isc-config.sh.1 ${DESTDIR}${mandir}/man1
|
||||
rm -f ${DESTDIR}${mandir}/man1/bind9-config.1
|
||||
@LN@ ${DESTDIR}${mandir}/man1/isc-config.sh.1 ${DESTDIR}${mandir}/man1/bind9-config.1
|
||||
${INSTALL_DATA} ${top_srcdir}/bind.keys ${DESTDIR}${sysconfdir}
|
||||
|
||||
tags:
|
||||
rm -f TAGS
|
||||
find lib bin -name "*.[ch]" -print | @ETAGS@ -
|
||||
|
||||
test check:
|
||||
@if test -n "`${PERL} ${top_srcdir}/bin/tests/system/testsock.pl 2>&- || echo fail`"; then \
|
||||
echo I: NOTE: The tests were not run because they require that; \
|
||||
echo I: the IP addresses 10.53.0.1 through 10.53.0.8 are configured; \
|
||||
echo I: as alias addresses on the loopback interface. Please run; \
|
||||
echo I: \'bin/tests/system/ifconfig.sh up\' as root to configure; \
|
||||
echo I: them, then rerun the tests. Run make force-test to run the; \
|
||||
echo I: tests anyway.; \
|
||||
exit 1; \
|
||||
fi
|
||||
${MAKE} test-force
|
||||
check: test
|
||||
|
||||
force-test: test-force
|
||||
|
||||
test-force:
|
||||
test:
|
||||
status=0; \
|
||||
(cd bin/tests && ${MAKE} ${MAKEDEFS} test) || status=1; \
|
||||
(test -f unit/unittest.sh && $(SHELL) unit/unittest.sh) || status=1; \
|
||||
@@ -90,8 +74,5 @@ FAQ: FAQ.xml
|
||||
LC_ALL=C ${W3M} -T text/html -dump -cols 72 >$@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
unit::
|
||||
sh ${top_srcdir}/unit/unittest.sh
|
||||
|
||||
clean::
|
||||
rm -f FAQ.tmp
|
||||
+35
-58
@@ -48,36 +48,13 @@ BIND 9
|
||||
For a detailed list of user-visible changes from
|
||||
previous releases, see the CHANGES file.
|
||||
|
||||
For up-to-date release notes and errata, see
|
||||
http://www.isc.org/software/bind9/releasenotes
|
||||
|
||||
BIND 9.8.7
|
||||
|
||||
BIND 9.8.7 includes several bug fixes and patches the security
|
||||
flaws described in CVE-2013-6320 and CVE-2014-0591. It also
|
||||
includes the following functional enhancements:
|
||||
|
||||
- "named" now preserves the capitalization of names when
|
||||
responding to queries.
|
||||
- "named-checkconf -px" will print the contents of configuration
|
||||
files with the shared secrets obscured, making it easier to
|
||||
share configuration (e.g. when submitting a bug report)
|
||||
without revealing private information.
|
||||
|
||||
BIND 9.8.6
|
||||
|
||||
BIND 9.8.6 includes several bug fixes and patches the security
|
||||
flaws described in CVE-2013-3919 and CVE-2013-4854.
|
||||
|
||||
BIND 9.8.5
|
||||
|
||||
BIND 9.8.5 includes several bug fixes and patches security
|
||||
flaws described in CVE-2012-5688, CVE-2012-5689 and CVE-2013-2266.
|
||||
For up-to-date release notes and errata, see
|
||||
http://www.isc.org/software/bind9/releasenotes
|
||||
|
||||
BIND 9.8.4
|
||||
|
||||
BIND 9.8.4 includes several bug fixes and patches security
|
||||
flaws described in CVE-2012-1667, CVE-2012-3817 and CVE-2012-4244.
|
||||
BIND 9.8.4 includes several bug fixes and patches security
|
||||
flaws described in CVE-2012-1667, CVE-2012-3817 and CVE-2012-4244.
|
||||
|
||||
BIND 9.8.3
|
||||
|
||||
@@ -90,32 +67,32 @@ BIND 9.8.2
|
||||
|
||||
BIND 9.8.1
|
||||
|
||||
BIND 9.8.1 includes a number of bug fixes and enhancements from
|
||||
BIND 9.8.1 includes a number of bug fixes and enhancements from
|
||||
BIND 9.8 and earlier releases. New features include:
|
||||
|
||||
- The DLZ "dlopen" driver is now built by default.
|
||||
- Added a new include file with function typedefs
|
||||
for the DLZ "dlopen" driver.
|
||||
for the DLZ "dlopen" driver.
|
||||
- Made "--with-gssapi" default.
|
||||
- More verbose error reporting from DLZ LDAP.
|
||||
|
||||
BIND 9.8.0
|
||||
|
||||
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
|
||||
releases. New features include:
|
||||
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
|
||||
releases. New features include:
|
||||
|
||||
- Built-in trust anchor for the root zone, which can be
|
||||
switched on via "dnssec-validation auto;"
|
||||
- Support for DNS64.
|
||||
- Support for response policy zones (RPZ).
|
||||
- Support for writable DLZ zones.
|
||||
- Improved ease of configuration of GSS/TSIG for
|
||||
interoperability with Active Directory
|
||||
- Support for GOST signing algorithm for DNSSEC.
|
||||
- Removed RTT Banding from server selection algorithm.
|
||||
- New "static-stub" zone type.
|
||||
- Allow configuration of resolver timeouts via
|
||||
"resolver-query-timeout" option.
|
||||
- Built-in trust anchor for the root zone, which can be
|
||||
switched on via "dnssec-validation auto;"
|
||||
- Support for DNS64.
|
||||
- Support for response policy zones (RPZ).
|
||||
- Support for writable DLZ zones.
|
||||
- Improved ease of configuration of GSS/TSIG for
|
||||
interoperability with Active Directory
|
||||
- Support for GOST signing algorithm for DNSSEC.
|
||||
- Removed RTT Banding from server selection algorithm.
|
||||
- New "static-stub" zone type.
|
||||
- Allow configuration of resolver timeouts via
|
||||
"resolver-query-timeout" option.
|
||||
|
||||
BIND 9.7.0
|
||||
|
||||
@@ -201,9 +178,9 @@ Building
|
||||
Ubuntu 7.04, 7.10
|
||||
Windows XP/2003/2008
|
||||
|
||||
NOTE: As of BIND 9.5.1, 9.4.3, and 9.3.6, older versions of
|
||||
Windows, including Windows NT and Windows 2000, are no longer
|
||||
supported.
|
||||
NOTE: As of BIND 9.5.1, 9.4.3, and 9.3.6, older versions of
|
||||
Windows, including Windows NT and Windows 2000, are no longer
|
||||
supported.
|
||||
|
||||
We have recent reports from the user community that a supported
|
||||
version of BIND will build and run on the following systems:
|
||||
@@ -256,7 +233,7 @@ Building
|
||||
-DDIG_SIGCHASE_BU=1)
|
||||
Disable dropping queries from particular well known ports.
|
||||
-DNS_CLIENT_DROPPORT=0
|
||||
Sibling glue checking in named-checkzone is enabled by default.
|
||||
Sibling glue checking in named-checkzone is enabled by default.
|
||||
To disable the default check set. -DCHECK_SIBLING=0
|
||||
named-checkzone checks out-of-zone addresses by default.
|
||||
To disable this default set. -DCHECK_LOCAL=0
|
||||
@@ -303,10 +280,10 @@ Building
|
||||
on the configure command line. The default is operating
|
||||
system dependent.
|
||||
|
||||
Support for the "fixed" rrset-order option can be enabled
|
||||
or disabled by specifying "--enable-fixed-rrset" or
|
||||
"--disable-fixed-rrset" on the configure command line.
|
||||
The default is "disabled", to reduce memory footprint.
|
||||
Support for the "fixed" rrset-order option can be enabled
|
||||
or disabled by specifying "--enable-fixed-rrset" or
|
||||
"--disable-fixed-rrset" on the configure command line.
|
||||
The default is "disabled", to reduce memory footprint.
|
||||
|
||||
If your operating system has integrated support for IPv6, it
|
||||
will be used automatically. If you have installed KAME IPv6
|
||||
@@ -373,8 +350,8 @@ Documentation
|
||||
Frequently asked questions and their answers can be found in
|
||||
FAQ.
|
||||
|
||||
Additional information on various subjects can be found
|
||||
in the other README files.
|
||||
Additional information on various subjects can be found
|
||||
in the other README files.
|
||||
|
||||
|
||||
Change Log
|
||||
@@ -391,7 +368,7 @@ Change Log
|
||||
[security] Fix for a significant security flaw
|
||||
|
||||
[experimental] Used for new features when the syntax
|
||||
or other aspects of the design are still
|
||||
or other aspects of the design are still
|
||||
in flux and may change
|
||||
|
||||
[port] Portability enhancement
|
||||
@@ -400,15 +377,15 @@ Change Log
|
||||
server addresses and keys
|
||||
|
||||
[tuning] Changes to built-in configuration defaults
|
||||
and constants to improve performanceo
|
||||
and constants to improve performanceo
|
||||
|
||||
[protocol] Updates to the DNS protocol such as new
|
||||
RR types
|
||||
|
||||
[test] Changes to the automatic tests, not
|
||||
affecting server functionality
|
||||
[test] Changes to the automatic tests, not
|
||||
affecting server functionality
|
||||
|
||||
[cleanup] Minor corrections and refactoring
|
||||
[cleanup] Minor corrections and refactoring
|
||||
|
||||
[doc] Documentation
|
||||
|
||||
|
||||
Vendored
+2
-5
@@ -1,5 +1,2 @@
|
||||
sinclude(libtool.m4/libtool.m4)dnl
|
||||
sinclude(libtool.m4/ltoptions.m4)dnl
|
||||
sinclude(libtool.m4/ltsugar.m4)dnl
|
||||
sinclude(libtool.m4/ltversion.m4)dnl
|
||||
sinclude(libtool.m4/lt~obsolete.m4)dnl
|
||||
sinclude(./libtool.m4)dnl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2004, 2007, 2009, 2012, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
# Copyright (C) 1998-2001 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -19,7 +19,7 @@ srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
SUBDIRS = named rndc dig dnssec tools tests nsupdate \
|
||||
SUBDIRS = named rndc dig dnssec tests tools nsupdate \
|
||||
check confgen @PKCS11_TOOLS@
|
||||
TARGETS =
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2010, 2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -196,10 +196,6 @@ checkns(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner,
|
||||
a->type == dns_rdatatype_a);
|
||||
REQUIRE(aaaa == NULL || !dns_rdataset_isassociated(aaaa) ||
|
||||
aaaa->type == dns_rdatatype_aaaa);
|
||||
|
||||
if (a == NULL || aaaa == NULL)
|
||||
return (answer);
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
@@ -262,7 +258,8 @@ checkns(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner,
|
||||
}
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
if (a == NULL || aaaa == NULL)
|
||||
return (answer);
|
||||
/*
|
||||
* Check that all glue records really exist.
|
||||
*/
|
||||
@@ -600,7 +597,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
|
||||
dns_zone_settype(zone, dns_zone_master);
|
||||
|
||||
isc_buffer_constinit(&buffer, zonename, strlen(zonename));
|
||||
isc_buffer_init(&buffer, zonename, strlen(zonename));
|
||||
isc_buffer_add(&buffer, strlen(zonename));
|
||||
dns_fixedname_init(&fixorigin);
|
||||
origin = dns_fixedname_name(&fixorigin);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2004, 2005, 2007, 2009, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -33,7 +33,7 @@
|
||||
named\-checkconf \- named configuration file syntax checking tool
|
||||
.SH "SYNOPSIS"
|
||||
.HP 16
|
||||
\fBnamed\-checkconf\fR [\fB\-h\fR] [\fB\-v\fR] [\fB\-j\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] {filename} [\fB\-p\fR] [\fB\-x\fR] [\fB\-z\fR]
|
||||
\fBnamed\-checkconf\fR [\fB\-h\fR] [\fB\-v\fR] [\fB\-j\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] {filename} [\fB\-p\fR] [\fB\-z\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBnamed\-checkconf\fR
|
||||
@@ -84,14 +84,6 @@ Print out the
|
||||
and included files in canonical form if no errors were detected.
|
||||
.RE
|
||||
.PP
|
||||
\-x
|
||||
.RS 4
|
||||
When printing the configuration files in canonical form, obscure shared secrets by replacing them with strings of question marks ('?'). This allows the contents of
|
||||
\fInamed.conf\fR
|
||||
and related files to be shared \(em for example, when submitting bug reports \(em without compromising private data. This option cannot be used without
|
||||
\fB\-p\fR.
|
||||
.RE
|
||||
.PP
|
||||
\-z
|
||||
.RS 4
|
||||
Perform a test load of all master zones found in
|
||||
@@ -121,7 +113,7 @@ BIND 9 Administrator Reference Manual.
|
||||
.PP
|
||||
Internet Systems Consortium
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 2004, 2005, 2007, 2009, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright \(co 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
.br
|
||||
Copyright \(co 2000\-2002 Internet Software Consortium.
|
||||
.br
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2007, 2009-2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2007, 2009-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -39,13 +39,10 @@
|
||||
|
||||
#include <bind9/check.h>
|
||||
|
||||
#include <dns/db.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/log.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdataclass.h>
|
||||
#include <dns/result.h>
|
||||
#include <dns/rootns.h>
|
||||
#include <dns/zone.h>
|
||||
|
||||
#include "check-tool.h"
|
||||
@@ -154,30 +151,6 @@ config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
|
||||
}
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
|
||||
isc_result_t result;
|
||||
dns_db_t *db = NULL;
|
||||
dns_rdataclass_t rdclass;
|
||||
isc_textregion_t r;
|
||||
|
||||
if (zfile == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
|
||||
DE_CONST(zclass, r.base);
|
||||
r.length = strlen(zclass);
|
||||
result = dns_rdataclass_fromtext(&rdclass, &r);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
result = dns_rootns_create(mctx, rdclass, zfile, &db);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
dns_db_detach(&db);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*% configure the zone */
|
||||
static isc_result_t
|
||||
configure_zone(const char *vclass, const char *view,
|
||||
@@ -188,7 +161,7 @@ configure_zone(const char *vclass, const char *view,
|
||||
isc_result_t result;
|
||||
const char *zclass;
|
||||
const char *zname;
|
||||
const char *zfile = NULL;
|
||||
const char *zfile;
|
||||
const cfg_obj_t *maps[4];
|
||||
const cfg_obj_t *zoptions = NULL;
|
||||
const cfg_obj_t *classobj = NULL;
|
||||
@@ -222,26 +195,15 @@ configure_zone(const char *vclass, const char *view,
|
||||
cfg_map_get(zoptions, "type", &typeobj);
|
||||
if (typeobj == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
|
||||
cfg_map_get(zoptions, "file", &fileobj);
|
||||
if (fileobj != NULL)
|
||||
zfile = cfg_obj_asstring(fileobj);
|
||||
|
||||
/*
|
||||
* Check hints files for hint zones.
|
||||
* Skip loading checks for any type other than master.
|
||||
*/
|
||||
if (strcasecmp(cfg_obj_asstring(typeobj), "hint") == 0)
|
||||
return (configure_hint(zfile, zclass, mctx));
|
||||
else if ((strcasecmp(cfg_obj_asstring(typeobj), "master") != 0))
|
||||
if (strcasecmp(cfg_obj_asstring(typeobj), "master") != 0)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
if (zfile == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
|
||||
cfg_map_get(zoptions, "database", &dbobj);
|
||||
if (dbobj != NULL)
|
||||
return (ISC_R_SUCCESS);
|
||||
cfg_map_get(zoptions, "file", &fileobj);
|
||||
if (fileobj == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
zfile = cfg_obj_asstring(fileobj);
|
||||
|
||||
obj = NULL;
|
||||
if (get_maps(maps, "check-dup-records", &obj)) {
|
||||
@@ -332,18 +294,6 @@ configure_zone(const char *vclass, const char *view,
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
if (get_maps(maps, "check-spf", &obj)) {
|
||||
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
|
||||
zone_options |= DNS_ZONEOPT_CHECKSPF;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKSPF;
|
||||
} else
|
||||
INSIST(0);
|
||||
} else {
|
||||
zone_options |= DNS_ZONEOPT_CHECKSPF;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
if (get_checknames(maps, &obj)) {
|
||||
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
|
||||
@@ -379,7 +329,7 @@ configure_zone(const char *vclass, const char *view,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fprintf(stderr, "%s/%s/%s: %s\n", view, zname, zclass,
|
||||
dns_result_totext(result));
|
||||
return (result);
|
||||
return(result);
|
||||
}
|
||||
|
||||
/*% configure a view */
|
||||
@@ -480,11 +430,10 @@ main(int argc, char **argv) {
|
||||
isc_entropy_t *ectx = NULL;
|
||||
isc_boolean_t load_zones = ISC_FALSE;
|
||||
isc_boolean_t print = ISC_FALSE;
|
||||
unsigned int flags = 0;
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
|
||||
while ((c = isc_commandline_parse(argc, argv, "dhjt:pvxz")) != EOF) {
|
||||
while ((c = isc_commandline_parse(argc, argv, "dhjt:pvz")) != EOF) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
debug++;
|
||||
@@ -511,10 +460,6 @@ main(int argc, char **argv) {
|
||||
printf(VERSION "\n");
|
||||
exit(0);
|
||||
|
||||
case 'x':
|
||||
flags |= CFG_PRINTER_XKEY;
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
load_zones = ISC_TRUE;
|
||||
docheckmx = ISC_FALSE;
|
||||
@@ -526,7 +471,6 @@ main(int argc, char **argv) {
|
||||
if (isc_commandline_option != '?')
|
||||
fprintf(stderr, "%s: invalid argument -%c\n",
|
||||
program, isc_commandline_option);
|
||||
/* FALLTHROUGH */
|
||||
case 'h':
|
||||
usage();
|
||||
|
||||
@@ -537,11 +481,6 @@ main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (((flags & CFG_PRINTER_XKEY) != 0) && !print) {
|
||||
fprintf(stderr, "%s: -x cannot be used without -p\n", program);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (isc_commandline_index + 1 < argc)
|
||||
usage();
|
||||
if (argv[isc_commandline_index] != NULL)
|
||||
@@ -582,7 +521,7 @@ main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (print && exit_status == 0)
|
||||
cfg_printx(config, flags, output, NULL);
|
||||
cfg_print(config, output, NULL);
|
||||
cfg_obj_destroy(parser, &config);
|
||||
|
||||
cfg_parser_destroy(&parser);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY mdash "—">]>
|
||||
<!--
|
||||
- Copyright (C) 2004, 2005, 2007, 2009, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -36,7 +36,6 @@
|
||||
<year>2005</year>
|
||||
<year>2007</year>
|
||||
<year>2009</year>
|
||||
<year>2014</year>
|
||||
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
|
||||
</copyright>
|
||||
<copyright>
|
||||
@@ -61,7 +60,6 @@
|
||||
<arg><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg choice="req">filename</arg>
|
||||
<arg><option>-p</option></arg>
|
||||
<arg><option>-x</option></arg>
|
||||
<arg><option>-z</option></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
@@ -131,21 +129,6 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-x</term>
|
||||
<listitem>
|
||||
<para>
|
||||
When printing the configuration files in canonical
|
||||
form, obscure shared secrets by replacing them with
|
||||
strings of question marks ('?'). This allows the
|
||||
contents of <filename>named.conf</filename> and related
|
||||
files to be shared — for example, when submitting
|
||||
bug reports — without compromising private data.
|
||||
This option cannot be used without <option>-p</option>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-z</term>
|
||||
<listitem>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
- Copyright (C) 2004, 2005, 2007, 2009, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -29,10 +29,10 @@
|
||||
</div>
|
||||
<div class="refsynopsisdiv">
|
||||
<h2>Synopsis</h2>
|
||||
<div class="cmdsynopsis"><p><code class="command">named-checkconf</code> [<code class="option">-h</code>] [<code class="option">-v</code>] [<code class="option">-j</code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] {filename} [<code class="option">-p</code>] [<code class="option">-x</code>] [<code class="option">-z</code>]</p></div>
|
||||
<div class="cmdsynopsis"><p><code class="command">named-checkconf</code> [<code class="option">-h</code>] [<code class="option">-v</code>] [<code class="option">-j</code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] {filename} [<code class="option">-p</code>] [<code class="option">-z</code>]</p></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543403"></a><h2>DESCRIPTION</h2>
|
||||
<a name="id2543396"></a><h2>DESCRIPTION</h2>
|
||||
<p><span><strong class="command">named-checkconf</strong></span>
|
||||
checks the syntax, but not the semantics, of a
|
||||
<span><strong class="command">named</strong></span> configuration file. The file is parsed
|
||||
@@ -52,7 +52,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543452"></a><h2>OPTIONS</h2>
|
||||
<a name="id2543445"></a><h2>OPTIONS</h2>
|
||||
<div class="variablelist"><dl>
|
||||
<dt><span class="term">-h</span></dt>
|
||||
<dd><p>
|
||||
@@ -74,16 +74,6 @@
|
||||
Print out the <code class="filename">named.conf</code> and included files
|
||||
in canonical form if no errors were detected.
|
||||
</p></dd>
|
||||
<dt><span class="term">-x</span></dt>
|
||||
<dd><p>
|
||||
When printing the configuration files in canonical
|
||||
form, obscure shared secrets by replacing them with
|
||||
strings of question marks ('?'). This allows the
|
||||
contents of <code class="filename">named.conf</code> and related
|
||||
files to be shared — for example, when submitting
|
||||
bug reports — without compromising private data.
|
||||
This option cannot be used without <code class="option">-p</code>.
|
||||
</p></dd>
|
||||
<dt><span class="term">-z</span></dt>
|
||||
<dd><p>
|
||||
Perform a test load of all master zones found in
|
||||
@@ -101,21 +91,21 @@
|
||||
</dl></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543596"></a><h2>RETURN VALUES</h2>
|
||||
<a name="id2543569"></a><h2>RETURN VALUES</h2>
|
||||
<p><span><strong class="command">named-checkconf</strong></span>
|
||||
returns an exit status of 1 if
|
||||
errors were detected and 0 otherwise.
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543608"></a><h2>SEE ALSO</h2>
|
||||
<a name="id2543580"></a><h2>SEE ALSO</h2>
|
||||
<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">named-checkzone</span>(8)</span>,
|
||||
<em class="citetitle">BIND 9 Administrator Reference Manual</em>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543638"></a><h2>AUTHOR</h2>
|
||||
<a name="id2543610"></a><h2>AUTHOR</h2>
|
||||
<p><span class="corpauthor">Internet Systems Consortium</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2004-2007, 2009, 2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -33,9 +33,9 @@
|
||||
named\-checkzone, named\-compilezone \- zone file validity checking or converting tool
|
||||
.SH "SYNOPSIS"
|
||||
.HP 16
|
||||
\fBnamed\-checkzone\fR [\fB\-d\fR] [\fB\-h\fR] [\fB\-j\fR] [\fB\-q\fR] [\fB\-v\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-F\ \fR\fB\fIformat\fR\fR] [\fB\-i\ \fR\fB\fImode\fR\fR] [\fB\-k\ \fR\fB\fImode\fR\fR] [\fB\-m\ \fR\fB\fImode\fR\fR] [\fB\-M\ \fR\fB\fImode\fR\fR] [\fB\-n\ \fR\fB\fImode\fR\fR] [\fB\-o\ \fR\fB\fIfilename\fR\fR] [\fB\-r\ \fR\fB\fImode\fR\fR] [\fB\-s\ \fR\fB\fIstyle\fR\fR] [\fB\-S\ \fR\fB\fImode\fR\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-T\ \fR\fB\fImode\fR\fR] [\fB\-w\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-W\ \fR\fB\fImode\fR\fR] {zonename} {filename}
|
||||
\fBnamed\-checkzone\fR [\fB\-d\fR] [\fB\-h\fR] [\fB\-j\fR] [\fB\-q\fR] [\fB\-v\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-F\ \fR\fB\fIformat\fR\fR] [\fB\-i\ \fR\fB\fImode\fR\fR] [\fB\-k\ \fR\fB\fImode\fR\fR] [\fB\-m\ \fR\fB\fImode\fR\fR] [\fB\-M\ \fR\fB\fImode\fR\fR] [\fB\-n\ \fR\fB\fImode\fR\fR] [\fB\-o\ \fR\fB\fIfilename\fR\fR] [\fB\-r\ \fR\fB\fImode\fR\fR] [\fB\-s\ \fR\fB\fIstyle\fR\fR] [\fB\-S\ \fR\fB\fImode\fR\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-w\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-W\ \fR\fB\fImode\fR\fR] {zonename} {filename}
|
||||
.HP 18
|
||||
\fBnamed\-compilezone\fR [\fB\-d\fR] [\fB\-j\fR] [\fB\-q\fR] [\fB\-v\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-C\ \fR\fB\fImode\fR\fR] [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-F\ \fR\fB\fIformat\fR\fR] [\fB\-i\ \fR\fB\fImode\fR\fR] [\fB\-k\ \fR\fB\fImode\fR\fR] [\fB\-m\ \fR\fB\fImode\fR\fR] [\fB\-n\ \fR\fB\fImode\fR\fR] [\fB\-r\ \fR\fB\fImode\fR\fR] [\fB\-s\ \fR\fB\fIstyle\fR\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-T\ \fR\fB\fImode\fR\fR] [\fB\-w\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-W\ \fR\fB\fImode\fR\fR] {\fB\-o\ \fR\fB\fIfilename\fR\fR} {zonename} {filename}
|
||||
\fBnamed\-compilezone\fR [\fB\-d\fR] [\fB\-j\fR] [\fB\-q\fR] [\fB\-v\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-C\ \fR\fB\fImode\fR\fR] [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-F\ \fR\fB\fIformat\fR\fR] [\fB\-i\ \fR\fB\fImode\fR\fR] [\fB\-k\ \fR\fB\fImode\fR\fR] [\fB\-m\ \fR\fB\fImode\fR\fR] [\fB\-n\ \fR\fB\fImode\fR\fR] [\fB\-r\ \fR\fB\fImode\fR\fR] [\fB\-s\ \fR\fB\fIstyle\fR\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-w\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-W\ \fR\fB\fImode\fR\fR] {\fB\-o\ \fR\fB\fIfilename\fR\fR} {zonename} {filename}
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBnamed\-checkzone\fR
|
||||
@@ -236,14 +236,6 @@ Chroot to
|
||||
so that include directives in the configuration file are processed as if run by a similarly chrooted named.
|
||||
.RE
|
||||
.PP
|
||||
\-T \fImode\fR
|
||||
.RS 4
|
||||
Check if Sender Policy Framework records (TXT and SPF) both exist or both don't exist. A warning is issued if they don't match. Possible modes are
|
||||
\fB"warn"\fR
|
||||
(default),
|
||||
\fB"ignore"\fR.
|
||||
.RE
|
||||
.PP
|
||||
\-w \fIdirectory\fR
|
||||
.RS 4
|
||||
chdir to
|
||||
@@ -289,7 +281,7 @@ BIND 9 Administrator Reference Manual.
|
||||
.PP
|
||||
Internet Systems Consortium
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 2004\-2007, 2009, 2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright \(co 2004\-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
.br
|
||||
Copyright \(co 2000\-2002 Internet Software Consortium.
|
||||
.br
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 1999-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -145,21 +145,19 @@ main(int argc, char **argv) {
|
||||
if (progmode == progmode_compile) {
|
||||
zone_options |= (DNS_ZONEOPT_CHECKNS |
|
||||
DNS_ZONEOPT_FATALNS |
|
||||
DNS_ZONEOPT_CHECKSPF |
|
||||
DNS_ZONEOPT_CHECKDUPRR |
|
||||
DNS_ZONEOPT_CHECKNAMES |
|
||||
DNS_ZONEOPT_CHECKNAMESFAIL |
|
||||
DNS_ZONEOPT_CHECKWILDCARD);
|
||||
} else
|
||||
zone_options |= (DNS_ZONEOPT_CHECKDUPRR |
|
||||
DNS_ZONEOPT_CHECKSPF);
|
||||
zone_options |= DNS_ZONEOPT_CHECKDUPRR;
|
||||
|
||||
#define ARGCMP(X) (strcmp(isc_commandline_argument, X) == 0)
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
|
||||
while ((c = isc_commandline_parse(argc, argv,
|
||||
"c:df:hi:jk:m:n:qr:s:t:o:vw:DF:M:S:T:W:"))
|
||||
"c:df:hi:jk:m:n:qr:s:t:o:vw:DF:M:S:W:"))
|
||||
!= EOF) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
@@ -365,18 +363,6 @@ main(int argc, char **argv) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
if (ARGCMP("warn")) {
|
||||
zone_options |= DNS_ZONEOPT_CHECKSPF;
|
||||
} else if (ARGCMP("ignore")) {
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKSPF;
|
||||
} else {
|
||||
fprintf(stderr, "invalid argument to -T: %s\n",
|
||||
isc_commandline_argument);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
if (ARGCMP("warn"))
|
||||
zone_options |= DNS_ZONEOPT_CHECKWILDCARD;
|
||||
@@ -388,7 +374,6 @@ main(int argc, char **argv) {
|
||||
if (isc_commandline_option != '?')
|
||||
fprintf(stderr, "%s: invalid argument -%c\n",
|
||||
prog_name, isc_commandline_option);
|
||||
/* FALLTHROUGH */
|
||||
case 'h':
|
||||
usage();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY mdash "—">]>
|
||||
<!--
|
||||
- Copyright (C) 2004-2007, 2009, 2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -38,7 +38,6 @@
|
||||
<year>2007</year>
|
||||
<year>2009</year>
|
||||
<year>2010</year>
|
||||
<year>2013</year>
|
||||
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
|
||||
</copyright>
|
||||
<copyright>
|
||||
@@ -76,7 +75,6 @@
|
||||
<arg><option>-s <replaceable class="parameter">style</replaceable></option></arg>
|
||||
<arg><option>-S <replaceable class="parameter">mode</replaceable></option></arg>
|
||||
<arg><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg><option>-T <replaceable class="parameter">mode</replaceable></option></arg>
|
||||
<arg><option>-w <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg><option>-D</option></arg>
|
||||
<arg><option>-W <replaceable class="parameter">mode</replaceable></option></arg>
|
||||
@@ -100,7 +98,6 @@
|
||||
<arg><option>-r <replaceable class="parameter">mode</replaceable></option></arg>
|
||||
<arg><option>-s <replaceable class="parameter">style</replaceable></option></arg>
|
||||
<arg><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg><option>-T <replaceable class="parameter">mode</replaceable></option></arg>
|
||||
<arg><option>-w <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg><option>-D</option></arg>
|
||||
<arg><option>-W <replaceable class="parameter">mode</replaceable></option></arg>
|
||||
@@ -382,18 +379,6 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-T <replaceable class="parameter">mode</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Check if Sender Policy Framework records (TXT and SPF)
|
||||
both exist or both don't exist. A warning is issued
|
||||
if they don't match. Possible modes are
|
||||
<command>"warn"</command> (default), <command>"ignore"</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-w <replaceable class="parameter">directory</replaceable></term>
|
||||
<listitem>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
- Copyright (C) 2004-2007, 2009, 2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -29,11 +29,11 @@
|
||||
</div>
|
||||
<div class="refsynopsisdiv">
|
||||
<h2>Synopsis</h2>
|
||||
<div class="cmdsynopsis"><p><code class="command">named-checkzone</code> [<code class="option">-d</code>] [<code class="option">-h</code>] [<code class="option">-j</code>] [<code class="option">-q</code>] [<code class="option">-v</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-f <em class="replaceable"><code>format</code></em></code>] [<code class="option">-F <em class="replaceable"><code>format</code></em></code>] [<code class="option">-i <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-k <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-m <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-M <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-n <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-o <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-r <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-s <em class="replaceable"><code>style</code></em></code>] [<code class="option">-S <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-T <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-w <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-D</code>] [<code class="option">-W <em class="replaceable"><code>mode</code></em></code>] {zonename} {filename}</p></div>
|
||||
<div class="cmdsynopsis"><p><code class="command">named-compilezone</code> [<code class="option">-d</code>] [<code class="option">-j</code>] [<code class="option">-q</code>] [<code class="option">-v</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-C <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-f <em class="replaceable"><code>format</code></em></code>] [<code class="option">-F <em class="replaceable"><code>format</code></em></code>] [<code class="option">-i <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-k <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-m <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-n <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-r <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-s <em class="replaceable"><code>style</code></em></code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-T <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-w <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-D</code>] [<code class="option">-W <em class="replaceable"><code>mode</code></em></code>] {<code class="option">-o <em class="replaceable"><code>filename</code></em></code>} {zonename} {filename}</p></div>
|
||||
<div class="cmdsynopsis"><p><code class="command">named-checkzone</code> [<code class="option">-d</code>] [<code class="option">-h</code>] [<code class="option">-j</code>] [<code class="option">-q</code>] [<code class="option">-v</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-f <em class="replaceable"><code>format</code></em></code>] [<code class="option">-F <em class="replaceable"><code>format</code></em></code>] [<code class="option">-i <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-k <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-m <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-M <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-n <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-o <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-r <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-s <em class="replaceable"><code>style</code></em></code>] [<code class="option">-S <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-w <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-D</code>] [<code class="option">-W <em class="replaceable"><code>mode</code></em></code>] {zonename} {filename}</p></div>
|
||||
<div class="cmdsynopsis"><p><code class="command">named-compilezone</code> [<code class="option">-d</code>] [<code class="option">-j</code>] [<code class="option">-q</code>] [<code class="option">-v</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-C <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-f <em class="replaceable"><code>format</code></em></code>] [<code class="option">-F <em class="replaceable"><code>format</code></em></code>] [<code class="option">-i <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-k <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-m <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-n <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-r <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-s <em class="replaceable"><code>style</code></em></code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-w <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-D</code>] [<code class="option">-W <em class="replaceable"><code>mode</code></em></code>] {<code class="option">-o <em class="replaceable"><code>filename</code></em></code>} {zonename} {filename}</p></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543716"></a><h2>DESCRIPTION</h2>
|
||||
<a name="id2543696"></a><h2>DESCRIPTION</h2>
|
||||
<p><span><strong class="command">named-checkzone</strong></span>
|
||||
checks the syntax and integrity of a zone file. It performs the
|
||||
same checks as <span><strong class="command">named</strong></span> does when loading a
|
||||
@@ -53,7 +53,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543751"></a><h2>OPTIONS</h2>
|
||||
<a name="id2543731"></a><h2>OPTIONS</h2>
|
||||
<div class="variablelist"><dl>
|
||||
<dt><span class="term">-d</span></dt>
|
||||
<dd><p>
|
||||
@@ -214,13 +214,6 @@
|
||||
directives in the configuration file are processed as if
|
||||
run by a similarly chrooted named.
|
||||
</p></dd>
|
||||
<dt><span class="term">-T <em class="replaceable"><code>mode</code></em></span></dt>
|
||||
<dd><p>
|
||||
Check if Sender Policy Framework records (TXT and SPF)
|
||||
both exist or both don't exist. A warning is issued
|
||||
if they don't match. Possible modes are
|
||||
<span><strong class="command">"warn"</strong></span> (default), <span><strong class="command">"ignore"</strong></span>.
|
||||
</p></dd>
|
||||
<dt><span class="term">-w <em class="replaceable"><code>directory</code></em></span></dt>
|
||||
<dd><p>
|
||||
chdir to <code class="filename">directory</code> so that
|
||||
@@ -254,14 +247,14 @@
|
||||
</dl></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2544422"></a><h2>RETURN VALUES</h2>
|
||||
<a name="id2544446"></a><h2>RETURN VALUES</h2>
|
||||
<p><span><strong class="command">named-checkzone</strong></span>
|
||||
returns an exit status of 1 if
|
||||
errors were detected and 0 otherwise.
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2544434"></a><h2>SEE ALSO</h2>
|
||||
<a name="id2544458"></a><h2>SEE ALSO</h2>
|
||||
<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">named-checkconf</span>(8)</span>,
|
||||
<em class="citetitle">RFC 1035</em>,
|
||||
@@ -269,7 +262,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2544603"></a><h2>AUTHOR</h2>
|
||||
<a name="id2544491"></a><h2>AUTHOR</h2>
|
||||
<p><span class="corpauthor">Internet Systems Consortium</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009, 2011, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2009, 2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -101,7 +101,7 @@ main(int argc, char **argv) {
|
||||
|
||||
result = isc_file_progname(*argv, program, sizeof(program));
|
||||
if (result != ISC_R_SUCCESS)
|
||||
memmove(program, "ddns-confgen", 13);
|
||||
memcpy(program, "ddns-confgen", 13);
|
||||
progname = program;
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009, 2012, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -126,17 +126,13 @@ generate_key(isc_mem_t *mctx, const char *randomfile, dns_secalg_t alg,
|
||||
|
||||
switch (alg) {
|
||||
case DST_ALG_HMACMD5:
|
||||
case DST_ALG_HMACSHA1:
|
||||
case DST_ALG_HMACSHA224:
|
||||
case DST_ALG_HMACSHA256:
|
||||
if (keysize < 1 || keysize > 512)
|
||||
fatal("keysize %d out of range (must be 1-512)\n",
|
||||
keysize);
|
||||
break;
|
||||
case DST_ALG_HMACSHA384:
|
||||
case DST_ALG_HMACSHA512:
|
||||
if (keysize < 1 || keysize > 1024)
|
||||
fatal("keysize %d out of range (must be 1-1024)\n",
|
||||
case DST_ALG_HMACSHA256:
|
||||
if (keysize < 1 || keysize > 256)
|
||||
fatal("keysize %d out of range (must be 1-256)\n",
|
||||
keysize);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2005, 2007-2009, 2011, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004, 2005, 2007-2009, 2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2001, 2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -120,7 +120,7 @@ main(int argc, char **argv) {
|
||||
|
||||
result = isc_file_progname(*argv, program, sizeof(program));
|
||||
if (result != ISC_R_SUCCESS)
|
||||
memmove(program, "rndc-confgen", 13);
|
||||
memcpy(program, "rndc-confgen", 13);
|
||||
progname = program;
|
||||
|
||||
keyname = DEFAULT_KEYNAME;
|
||||
@@ -140,6 +140,8 @@ main(int argc, char **argv) {
|
||||
keysize = strtol(isc_commandline_argument, &p, 10);
|
||||
if (*p != '\0' || keysize < 0)
|
||||
fatal("-b requires a non-negative number");
|
||||
if (keysize < 1 || keysize > 512)
|
||||
fatal("-b must be in the range 1 through 512");
|
||||
break;
|
||||
case 'c':
|
||||
keyfile = isc_commandline_argument;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2004-2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -20,11 +20,11 @@
|
||||
.\" Title: dig
|
||||
.\" Author:
|
||||
.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
|
||||
.\" Date: June 30, 2000
|
||||
.\" Date: Jun 30, 2000
|
||||
.\" Manual: BIND9
|
||||
.\" Source: BIND9
|
||||
.\"
|
||||
.TH "DIG" "1" "June 30, 2000" "BIND9" "BIND9"
|
||||
.TH "DIG" "1" "Jun 30, 2000" "BIND9" "BIND9"
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
@@ -57,9 +57,7 @@ allows multiple lookups to be issued from the command line.
|
||||
Unless it is told to query a specific name server,
|
||||
\fBdig\fR
|
||||
will try each of the servers listed in
|
||||
\fI/etc/resolv.conf\fR. If no usable server addresses are found,
|
||||
\fBdig\fR
|
||||
will send the query to the local host.
|
||||
\fI/etc/resolv.conf\fR.
|
||||
.PP
|
||||
When no command line arguments or options are given,
|
||||
\fBdig\fR
|
||||
@@ -97,20 +95,13 @@ is the name or IP address of the name server to query. This can be an IPv4 addre
|
||||
\fIserver\fR
|
||||
argument is a hostname,
|
||||
\fBdig\fR
|
||||
resolves that name before querying that name server.
|
||||
.sp
|
||||
If no
|
||||
resolves that name before querying that name server. If no
|
||||
\fIserver\fR
|
||||
argument is provided,
|
||||
\fBdig\fR
|
||||
consults
|
||||
\fI/etc/resolv.conf\fR; if an address is found there, it queries the name server at that address. If either of the
|
||||
\fB\-4\fR
|
||||
or
|
||||
\fB\-6\fR
|
||||
options are in use, then only addresses for the corresponding transport will be tried. If no usable addresses are found,
|
||||
\fBdig\fR
|
||||
will send the query to the local host. The reply from the name server that responds is displayed.
|
||||
\fI/etc/resolv.conf\fR
|
||||
and queries the name servers listed there. The reply from the name server that responds is displayed.
|
||||
.RE
|
||||
.PP
|
||||
\fBname\fR
|
||||
@@ -514,12 +505,6 @@ When chasing DNSSEC signature chains perform a top\-down validation. Requires di
|
||||
.RS 4
|
||||
Include an EDNS name server ID request when sending a query.
|
||||
.RE
|
||||
.PP
|
||||
\fB+[no]keepopen\fR
|
||||
.RS 4
|
||||
Keep the TCP socket open between queries and reuse it rather than creating a new TCP socket for each lookup. The default is
|
||||
\fB+nokeepopen\fR.
|
||||
.RE
|
||||
.SH "MULTIPLE QUERIES"
|
||||
.PP
|
||||
The BIND 9 implementation of
|
||||
@@ -582,7 +567,7 @@ RFC1035.
|
||||
.PP
|
||||
There are probably too many query options.
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 2004\-2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright \(co 2004\-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
.br
|
||||
Copyright \(co 2000\-2003 Internet Software Consortium.
|
||||
.br
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -186,7 +186,7 @@ help(void) {
|
||||
" +domain=### (Set default domainname)\n"
|
||||
" +bufsize=### (Set EDNS0 Max UDP packet size)\n"
|
||||
" +ndots=### (Set NDOTS value)\n"
|
||||
" +[no]edns[=###] (Set EDNS version) [0]\n"
|
||||
" +edns=### (Set EDNS version)\n"
|
||||
" +[no]search (Set whether to use searchlist)\n"
|
||||
" +[no]showsearch (Search with intermediate results)\n"
|
||||
" +[no]defname (Ditto)\n"
|
||||
@@ -225,7 +225,6 @@ help(void) {
|
||||
#endif
|
||||
" +[no]multiline (Print records in an expanded format)\n"
|
||||
" +[no]onesoa (AXFR prints only one soa record)\n"
|
||||
" +[no]keepopen (Keep the TCP socket open between queries)\n"
|
||||
" global d-opts and servers (before host name) affect all queries.\n"
|
||||
" local d-opts and servers (after host name) affect only that lookup.\n"
|
||||
" -h (print help and exit)\n"
|
||||
@@ -241,8 +240,6 @@ received(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
|
||||
isc_uint64_t diff;
|
||||
isc_time_t now;
|
||||
time_t tnow;
|
||||
struct tm tmnow;
|
||||
char time_str[100];
|
||||
char fromtext[ISC_SOCKADDR_FORMATSIZE];
|
||||
|
||||
isc_sockaddr_format(from, fromtext, sizeof(fromtext));
|
||||
@@ -254,10 +251,7 @@ received(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
|
||||
printf(";; Query time: %ld msec\n", (long int)diff/1000);
|
||||
printf(";; SERVER: %s(%s)\n", fromtext, query->servname);
|
||||
time(&tnow);
|
||||
tmnow = *localtime(&tnow);
|
||||
if (strftime(time_str, sizeof(time_str),
|
||||
"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
|
||||
printf(";; WHEN: %s\n", time_str);
|
||||
printf(";; WHEN: %s", ctime(&tnow));
|
||||
if (query->lookup->doing_xfr) {
|
||||
printf(";; XFR size: %u records (messages %u, "
|
||||
"bytes %" ISC_PRINT_QUADFORMAT "u)\n",
|
||||
@@ -265,6 +259,7 @@ received(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
|
||||
query->byte_count);
|
||||
} else {
|
||||
printf(";; MSG SIZE rcvd: %u\n", bytes);
|
||||
|
||||
}
|
||||
if (key != NULL) {
|
||||
if (!validated)
|
||||
@@ -281,7 +276,7 @@ received(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
|
||||
"from %s(%s) in %d ms\n\n",
|
||||
query->lookup->doing_xfr ?
|
||||
query->byte_count : (isc_uint64_t)bytes,
|
||||
fromtext, query->userarg,
|
||||
fromtext, query->servname,
|
||||
(int)diff/1000);
|
||||
}
|
||||
}
|
||||
@@ -530,16 +525,8 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
printf(";; WARNING: recursion requested "
|
||||
"but not available\n");
|
||||
}
|
||||
if (msg != query->lookup->sendmsg &&
|
||||
query->lookup->edns != -1 && msg->opt == NULL &&
|
||||
(msg->rcode == dns_rcode_formerr ||
|
||||
msg->rcode == dns_rcode_notimp))
|
||||
printf("\n;; WARNING: EDNS query returned status "
|
||||
"%s - retry with '%s+noedns'\n",
|
||||
rcode_totext(msg->rcode),
|
||||
query->lookup->dnssec ? "+nodnssec ": "");
|
||||
if (msg != query->lookup->sendmsg && extrabytes != 0U)
|
||||
printf(";; WARNING: Message has %u extra byte%s at "
|
||||
printf(";; WARNING: Messages has %u extra byte%s at "
|
||||
"end\n", extrabytes, extrabytes != 0 ? "s" : "");
|
||||
}
|
||||
|
||||
@@ -868,10 +855,8 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
lookup->edns = -1;
|
||||
break;
|
||||
}
|
||||
if (value == NULL) {
|
||||
lookup->edns = 0;
|
||||
break;
|
||||
}
|
||||
if (value == NULL)
|
||||
goto need_value;
|
||||
result = parse_uint(&num, value, 255, "edns");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Couldn't parse edns");
|
||||
@@ -893,10 +878,6 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
lookup->ignore = ISC_TRUE;
|
||||
}
|
||||
break;
|
||||
case 'k':
|
||||
FULLCHECK("keepopen");
|
||||
keep_open = state;
|
||||
break;
|
||||
case 'm': /* multiline */
|
||||
FULLCHECK("multiline");
|
||||
multiline = state;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY mdash "—">]>
|
||||
<!--
|
||||
- Copyright (C) 2004-2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -22,7 +22,7 @@
|
||||
<refentry id="man.dig">
|
||||
|
||||
<refentryinfo>
|
||||
<date>June 30, 2000</date>
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
@@ -45,7 +45,6 @@
|
||||
<year>2008</year>
|
||||
<year>2009</year>
|
||||
<year>2010</year>
|
||||
<year>2013</year>
|
||||
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
|
||||
</copyright>
|
||||
<copyright>
|
||||
@@ -117,10 +116,9 @@
|
||||
|
||||
<para>
|
||||
Unless it is told to query a specific name server,
|
||||
<command>dig</command> will try each of the servers listed in
|
||||
<filename>/etc/resolv.conf</filename>. If no usable server addresses
|
||||
are found, <command>dig</command> will send the query to the local
|
||||
host.
|
||||
<command>dig</command> will try each of the servers listed
|
||||
in
|
||||
<filename>/etc/resolv.conf</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -159,25 +157,20 @@
|
||||
<term><constant>server</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
is the name or IP address of the name server to query. This
|
||||
can be an IPv4 address in dotted-decimal notation or an IPv6
|
||||
is the name or IP address of the name server to query. This can
|
||||
be an IPv4
|
||||
address in dotted-decimal notation or an IPv6
|
||||
address in colon-delimited notation. When the supplied
|
||||
<parameter>server</parameter> argument is a hostname,
|
||||
<command>dig</command> resolves that name before querying
|
||||
that name server.
|
||||
</para>
|
||||
<para>
|
||||
If no <parameter>server</parameter> argument is
|
||||
provided, <command>dig</command> consults
|
||||
<filename>/etc/resolv.conf</filename>; if an
|
||||
address is found there, it queries the name server at
|
||||
that address. If either of the <option>-4</option> or
|
||||
<option>-6</option> options are in use, then
|
||||
only addresses for the corresponding transport
|
||||
will be tried. If no usable addresses are found,
|
||||
<command>dig</command> will send the query to the
|
||||
local host. The reply from the name server that
|
||||
responds is displayed.
|
||||
<parameter>server</parameter> argument is a
|
||||
hostname,
|
||||
<command>dig</command> resolves that name before
|
||||
querying that name
|
||||
server. If no <parameter>server</parameter>
|
||||
argument is provided,
|
||||
<command>dig</command> consults <filename>/etc/resolv.conf</filename>
|
||||
and queries the name servers listed there. The reply from the
|
||||
name
|
||||
server that responds is displayed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -868,16 +861,6 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>+[no]keepopen</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Keep the TCP socket open between queries and reuse it rather
|
||||
than creating a new TCP socket for each lookup. The default
|
||||
is <option>+nokeepopen</option>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
- Copyright (C) 2004-2010, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543527"></a><h2>DESCRIPTION</h2>
|
||||
<a name="id2543524"></a><h2>DESCRIPTION</h2>
|
||||
<p><span><strong class="command">dig</strong></span>
|
||||
(domain information groper) is a flexible tool
|
||||
for interrogating DNS name servers. It performs DNS lookups and
|
||||
@@ -57,10 +57,9 @@
|
||||
</p>
|
||||
<p>
|
||||
Unless it is told to query a specific name server,
|
||||
<span><strong class="command">dig</strong></span> will try each of the servers listed in
|
||||
<code class="filename">/etc/resolv.conf</code>. If no usable server addresses
|
||||
are found, <span><strong class="command">dig</strong></span> will send the query to the local
|
||||
host.
|
||||
<span><strong class="command">dig</strong></span> will try each of the servers listed
|
||||
in
|
||||
<code class="filename">/etc/resolv.conf</code>.
|
||||
</p>
|
||||
<p>
|
||||
When no command line arguments or options are given,
|
||||
@@ -81,7 +80,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543606"></a><h2>SIMPLE USAGE</h2>
|
||||
<a name="id2543597"></a><h2>SIMPLE USAGE</h2>
|
||||
<p>
|
||||
A typical invocation of <span><strong class="command">dig</strong></span> looks like:
|
||||
</p>
|
||||
@@ -92,29 +91,22 @@
|
||||
</p>
|
||||
<div class="variablelist"><dl>
|
||||
<dt><span class="term"><code class="constant">server</code></span></dt>
|
||||
<dd>
|
||||
<p>
|
||||
is the name or IP address of the name server to query. This
|
||||
can be an IPv4 address in dotted-decimal notation or an IPv6
|
||||
<dd><p>
|
||||
is the name or IP address of the name server to query. This can
|
||||
be an IPv4
|
||||
address in dotted-decimal notation or an IPv6
|
||||
address in colon-delimited notation. When the supplied
|
||||
<em class="parameter"><code>server</code></em> argument is a hostname,
|
||||
<span><strong class="command">dig</strong></span> resolves that name before querying
|
||||
that name server.
|
||||
</p>
|
||||
<p>
|
||||
If no <em class="parameter"><code>server</code></em> argument is
|
||||
provided, <span><strong class="command">dig</strong></span> consults
|
||||
<code class="filename">/etc/resolv.conf</code>; if an
|
||||
address is found there, it queries the name server at
|
||||
that address. If either of the <code class="option">-4</code> or
|
||||
<code class="option">-6</code> options are in use, then
|
||||
only addresses for the corresponding transport
|
||||
will be tried. If no usable addresses are found,
|
||||
<span><strong class="command">dig</strong></span> will send the query to the
|
||||
local host. The reply from the name server that
|
||||
responds is displayed.
|
||||
</p>
|
||||
</dd>
|
||||
<em class="parameter"><code>server</code></em> argument is a
|
||||
hostname,
|
||||
<span><strong class="command">dig</strong></span> resolves that name before
|
||||
querying that name
|
||||
server. If no <em class="parameter"><code>server</code></em>
|
||||
argument is provided,
|
||||
<span><strong class="command">dig</strong></span> consults <code class="filename">/etc/resolv.conf</code>
|
||||
and queries the name servers listed there. The reply from the
|
||||
name
|
||||
server that responds is displayed.
|
||||
</p></dd>
|
||||
<dt><span class="term"><code class="constant">name</code></span></dt>
|
||||
<dd><p>
|
||||
is the name of the resource record that is to be looked up.
|
||||
@@ -134,7 +126,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543709"></a><h2>OPTIONS</h2>
|
||||
<a name="id2543688"></a><h2>OPTIONS</h2>
|
||||
<p>
|
||||
The <code class="option">-b</code> option sets the source IP address of the query
|
||||
to <em class="parameter"><code>address</code></em>. This must be a valid
|
||||
@@ -238,7 +230,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2544058"></a><h2>QUERY OPTIONS</h2>
|
||||
<a name="id2544037"></a><h2>QUERY OPTIONS</h2>
|
||||
<p><span><strong class="command">dig</strong></span>
|
||||
provides a number of query options which affect
|
||||
the way in which lookups are made and the results displayed. Some of
|
||||
@@ -563,19 +555,13 @@
|
||||
<dd><p>
|
||||
Include an EDNS name server ID request when sending a query.
|
||||
</p></dd>
|
||||
<dt><span class="term"><code class="option">+[no]keepopen</code></span></dt>
|
||||
<dd><p>
|
||||
Keep the TCP socket open between queries and reuse it rather
|
||||
than creating a new TCP socket for each lookup. The default
|
||||
is <code class="option">+nokeepopen</code>.
|
||||
</p></dd>
|
||||
</dl></div>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2545224"></a><h2>MULTIPLE QUERIES</h2>
|
||||
<a name="id2545186"></a><h2>MULTIPLE QUERIES</h2>
|
||||
<p>
|
||||
The BIND 9 implementation of <span><strong class="command">dig </strong></span>
|
||||
supports
|
||||
@@ -621,7 +607,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2545354"></a><h2>IDN SUPPORT</h2>
|
||||
<a name="id2545248"></a><h2>IDN SUPPORT</h2>
|
||||
<p>
|
||||
If <span><strong class="command">dig</strong></span> has been built with IDN (internationalized
|
||||
domain name) support, it can accept and display non-ASCII domain names.
|
||||
@@ -635,14 +621,14 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2545377"></a><h2>FILES</h2>
|
||||
<a name="id2545338"></a><h2>FILES</h2>
|
||||
<p><code class="filename">/etc/resolv.conf</code>
|
||||
</p>
|
||||
<p><code class="filename">${HOME}/.digrc</code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2545462"></a><h2>SEE ALSO</h2>
|
||||
<a name="id2545355"></a><h2>SEE ALSO</h2>
|
||||
<p><span class="citerefentry"><span class="refentrytitle">host</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>,
|
||||
@@ -650,7 +636,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2545499"></a><h2>BUGS</h2>
|
||||
<a name="id2545393"></a><h2>BUGS</h2>
|
||||
<p>
|
||||
There are probably too many query options.
|
||||
</p>
|
||||
|
||||
+179
-202
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -46,10 +46,8 @@
|
||||
|
||||
#include <dns/byaddr.h>
|
||||
#ifdef DIG_SIGCHASE
|
||||
#include <dns/callbacks.h>
|
||||
#include <dns/dnssec.h>
|
||||
#include <dns/ds.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/nsec.h>
|
||||
#include <isc/random.h>
|
||||
#include <ctype.h>
|
||||
@@ -125,8 +123,7 @@ isc_boolean_t
|
||||
usesearch = ISC_FALSE,
|
||||
showsearch = ISC_FALSE,
|
||||
qr = ISC_FALSE,
|
||||
is_dst_up = ISC_FALSE,
|
||||
keep_open = ISC_FALSE;
|
||||
is_dst_up = ISC_FALSE;
|
||||
in_port_t port = 53;
|
||||
unsigned int timeout = 0;
|
||||
unsigned int extrabytes;
|
||||
@@ -158,9 +155,6 @@ static void idn_check_result(idn_result_t r, const char *msg);
|
||||
int idnoptions = 0;
|
||||
#endif
|
||||
|
||||
isc_socket_t *keep = NULL;
|
||||
isc_sockaddr_t keepaddr;
|
||||
|
||||
/*%
|
||||
* Exit Codes:
|
||||
*
|
||||
@@ -184,7 +178,6 @@ isc_boolean_t validated = ISC_TRUE;
|
||||
isc_entropy_t *entp = NULL;
|
||||
isc_mempool_t *commctx = NULL;
|
||||
isc_boolean_t debugging = ISC_FALSE;
|
||||
isc_boolean_t debugtiming = ISC_FALSE;
|
||||
isc_boolean_t memdebugging = ISC_FALSE;
|
||||
char *progname = NULL;
|
||||
isc_mutex_t lookup_lock;
|
||||
@@ -257,10 +250,11 @@ isc_result_t prove_nx(dns_message_t * msg, dns_name_t * name,
|
||||
dns_rdataset_t ** sigrdataset);
|
||||
static void nameFromString(const char *str, dns_name_t *p_ret);
|
||||
int inf_name(dns_name_t * name1, dns_name_t * name2);
|
||||
isc_result_t opentmpkey(isc_mem_t *mctx, const char *file,
|
||||
char **tempp, FILE **fp);
|
||||
isc_result_t removetmpkey(isc_mem_t *mctx, const char *file);
|
||||
void clean_trustedkey(void);
|
||||
isc_result_t insert_trustedkey(void *arg, dns_name_t *name,
|
||||
dns_rdataset_t *rdataset);
|
||||
void insert_trustedkey(dst_key_t **key);
|
||||
#if DIG_SIGCHASE_BU
|
||||
isc_result_t getneededrr(dns_message_t *msg);
|
||||
void sigchase_bottom_up(dns_message_t *msg);
|
||||
@@ -450,7 +444,7 @@ static isc_result_t
|
||||
append(const char *text, int len, char **p, char *end) {
|
||||
if (len > end - *p)
|
||||
return (ISC_R_NOSPACE);
|
||||
memmove(*p, text, len);
|
||||
memcpy(*p, text, len);
|
||||
*p += len;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
@@ -467,7 +461,7 @@ reverse_octets(const char *in, char **p, char *end) {
|
||||
result = append(".", 1, p, end);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
len = (int)(dot - in);
|
||||
len = dot - in;
|
||||
} else {
|
||||
len = strlen(in);
|
||||
}
|
||||
@@ -497,7 +491,7 @@ get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
|
||||
result = dns_byaddr_createptrname2(&addr, options, name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_name_format(name, reverse, (unsigned int)len);
|
||||
dns_name_format(name, reverse, len);
|
||||
return (ISC_R_SUCCESS);
|
||||
} else {
|
||||
/*
|
||||
@@ -543,15 +537,9 @@ fatal(const char *format, ...) {
|
||||
void
|
||||
debug(const char *format, ...) {
|
||||
va_list args;
|
||||
isc_time_t t;
|
||||
|
||||
if (debugging) {
|
||||
fflush(stdout);
|
||||
if (debugtiming) {
|
||||
TIME_NOW(&t);
|
||||
fprintf(stderr, "%d.%06d: ", isc_time_seconds(&t),
|
||||
isc_time_nanoseconds(&t) / 1000);
|
||||
}
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
@@ -806,7 +794,6 @@ make_empty_lookup(void) {
|
||||
dns_fixedname_init(&looknew->fdomain);
|
||||
ISC_LINK_INIT(looknew, link);
|
||||
ISC_LIST_INIT(looknew->q);
|
||||
ISC_LIST_INIT(looknew->connecting);
|
||||
ISC_LIST_INIT(looknew->my_server_list);
|
||||
return (looknew);
|
||||
}
|
||||
@@ -828,11 +815,11 @@ clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
|
||||
|
||||
looknew = make_empty_lookup();
|
||||
INSIST(looknew != NULL);
|
||||
strlcpy(looknew->textname, lookold->textname, MXNAME);
|
||||
strncpy(looknew->textname, lookold->textname, MXNAME);
|
||||
#if DIG_SIGCHASE_TD
|
||||
strlcpy(looknew->textnamesigchase, lookold->textnamesigchase, MXNAME);
|
||||
strncpy(looknew->textnamesigchase, lookold->textnamesigchase, MXNAME);
|
||||
#endif
|
||||
strlcpy(looknew->cmdline, lookold->cmdline, MXNAME);
|
||||
strncpy(looknew->cmdline, lookold->cmdline, MXNAME);
|
||||
looknew->textname[MXNAME-1] = 0;
|
||||
looknew->rdtype = lookold->rdtype;
|
||||
looknew->qrdtype = lookold->qrdtype;
|
||||
@@ -1011,7 +998,7 @@ parse_hmac(const char *hmac) {
|
||||
len = strlen(hmac);
|
||||
if (len >= (int) sizeof(buf))
|
||||
fatal("unknown key type '%.*s'", len, hmac);
|
||||
strlcpy(buf, hmac, sizeof(buf));
|
||||
strncpy(buf, hmac, sizeof(buf));
|
||||
|
||||
digestbits = 0;
|
||||
|
||||
@@ -1093,8 +1080,8 @@ read_confkey(void) {
|
||||
secretstr = cfg_obj_asstring(secretobj);
|
||||
algorithm = cfg_obj_asstring(algorithmobj);
|
||||
|
||||
strlcpy(keynametext, keyname, sizeof(keynametext));
|
||||
strlcpy(keysecret, secretstr, sizeof(keysecret));
|
||||
strncpy(keynametext, keyname, sizeof(keynametext));
|
||||
strncpy(keysecret, secretstr, sizeof(keysecret));
|
||||
parse_hmac(algorithm);
|
||||
setup_text_key();
|
||||
|
||||
@@ -1177,7 +1164,7 @@ make_searchlist_entry(char *domain) {
|
||||
if (search == NULL)
|
||||
fatal("memory allocation failure in %s:%d",
|
||||
__FILE__, __LINE__);
|
||||
strlcpy(search->origin, domain, MXNAME);
|
||||
strncpy(search->origin, domain, MXNAME);
|
||||
search->origin[MXNAME-1] = 0;
|
||||
ISC_LINK_INIT(search, link);
|
||||
return (search);
|
||||
@@ -1330,7 +1317,6 @@ setup_libs(void) {
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
check_result(result, "isc_mem_create");
|
||||
isc_mem_setname(mctx, "dig", NULL);
|
||||
|
||||
result = isc_log_create(mctx, &lctx, &logconfig);
|
||||
check_result(result, "isc_log_create");
|
||||
@@ -1349,7 +1335,6 @@ setup_libs(void) {
|
||||
|
||||
result = isc_task_create(taskmgr, 0, &global_task);
|
||||
check_result(result, "isc_task_create");
|
||||
isc_task_setname(global_task, "dig", NULL);
|
||||
|
||||
result = isc_timermgr_create(mctx, &timermgr);
|
||||
check_result(result, "isc_timermgr_create");
|
||||
@@ -1488,10 +1473,7 @@ clear_query(dig_query_t *query) {
|
||||
if (lookup->current_query == query)
|
||||
lookup->current_query = NULL;
|
||||
|
||||
if (ISC_LINK_LINKED(query, link))
|
||||
ISC_LIST_UNLINK(lookup->q, query, link);
|
||||
if (ISC_LINK_LINKED(query, clink))
|
||||
ISC_LIST_UNLINK(lookup->connecting, query, clink);
|
||||
ISC_LIST_UNLINK(lookup->q, query, link);
|
||||
if (ISC_LINK_LINKED(&query->recvbuf, link))
|
||||
ISC_LIST_DEQUEUE(query->recvlist, &query->recvbuf,
|
||||
link);
|
||||
@@ -1499,7 +1481,6 @@ clear_query(dig_query_t *query) {
|
||||
ISC_LIST_DEQUEUE(query->lengthlist, &query->lengthbuf,
|
||||
link);
|
||||
INSIST(query->recvspace != NULL);
|
||||
|
||||
if (query->sock != NULL) {
|
||||
isc_socket_detach(&query->sock);
|
||||
sockcount--;
|
||||
@@ -1527,22 +1508,13 @@ try_clear_lookup(dig_lookup_t *lookup) {
|
||||
|
||||
debug("try_clear_lookup(%p)", lookup);
|
||||
|
||||
if (ISC_LIST_HEAD(lookup->q) != NULL ||
|
||||
ISC_LIST_HEAD(lookup->connecting) != NULL)
|
||||
{
|
||||
if (ISC_LIST_HEAD(lookup->q) != NULL) {
|
||||
if (debugging) {
|
||||
q = ISC_LIST_HEAD(lookup->q);
|
||||
while (q != NULL) {
|
||||
debug("query to %s still pending", q->servname);
|
||||
q = ISC_LIST_NEXT(q, link);
|
||||
}
|
||||
|
||||
q = ISC_LIST_HEAD(lookup->connecting);
|
||||
while (q != NULL) {
|
||||
debug("query to %s still connecting",
|
||||
q->servname);
|
||||
q = ISC_LIST_NEXT(q, clink);
|
||||
}
|
||||
}
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
@@ -1670,7 +1642,7 @@ start_lookup(void) {
|
||||
= current_lookup->rdclassset;
|
||||
current_lookup->rdclass = dns_rdataclass_in;
|
||||
|
||||
strlcpy(current_lookup->textnamesigchase,
|
||||
strncpy(current_lookup->textnamesigchase,
|
||||
current_lookup->textname, MXNAME);
|
||||
|
||||
current_lookup->trace_root_sigchase = ISC_TRUE;
|
||||
@@ -1682,7 +1654,7 @@ start_lookup(void) {
|
||||
check_result(result, "dns_name_totext");
|
||||
isc_buffer_usedregion(b, &r);
|
||||
r.base[r.length] = '\0';
|
||||
strlcpy(current_lookup->textname, (char*)r.base,
|
||||
strncpy(current_lookup->textname, (char*)r.base,
|
||||
MXNAME);
|
||||
isc_buffer_free(&b);
|
||||
|
||||
@@ -1898,9 +1870,6 @@ static isc_boolean_t
|
||||
next_origin(dig_query_t *query) {
|
||||
dig_lookup_t *lookup;
|
||||
dig_searchlist_t *search;
|
||||
dns_fixedname_t fixed;
|
||||
dns_name_t *name;
|
||||
isc_result_t result;
|
||||
|
||||
INSIST(!free_now);
|
||||
|
||||
@@ -1913,19 +1882,6 @@ next_origin(dig_query_t *query) {
|
||||
* about finding the next entry.
|
||||
*/
|
||||
return (ISC_FALSE);
|
||||
|
||||
/*
|
||||
* Check for a absolute name or ndots being met.
|
||||
*/
|
||||
dns_fixedname_init(&fixed);
|
||||
name = dns_fixedname_name(&fixed);
|
||||
result = dns_name_fromstring2(name, query->lookup->textname, NULL,
|
||||
0, NULL);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
(dns_name_isabsolute(name) ||
|
||||
(int)dns_name_countlabels(name) > ndots))
|
||||
return (ISC_FALSE);
|
||||
|
||||
if (query->lookup->origin == NULL && !query->lookup->need_search)
|
||||
/*
|
||||
* Then we just did rootorg; there's nothing left.
|
||||
@@ -2334,7 +2290,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
query->rr_count = 0;
|
||||
query->msg_count = 0;
|
||||
query->byte_count = 0;
|
||||
query->ixfr_axfr = ISC_FALSE;
|
||||
ISC_LINK_INIT(query, link);
|
||||
ISC_LIST_INIT(query->recvlist);
|
||||
ISC_LIST_INIT(query->lengthlist);
|
||||
query->sock = NULL;
|
||||
@@ -2347,7 +2303,6 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
isc_buffer_init(&query->slbuf, query->slspace, 2);
|
||||
query->sendbuf = lookup->renderbuf;
|
||||
|
||||
ISC_LINK_INIT(query, clink);
|
||||
ISC_LINK_INIT(query, link);
|
||||
ISC_LIST_ENQUEUE(lookup->q, query, link);
|
||||
}
|
||||
@@ -2383,10 +2338,8 @@ send_done(isc_task_t *_task, isc_event_t *event) {
|
||||
|
||||
for (b = ISC_LIST_HEAD(sevent->bufferlist);
|
||||
b != NULL;
|
||||
b = ISC_LIST_HEAD(sevent->bufferlist)) {
|
||||
b = ISC_LIST_HEAD(sevent->bufferlist))
|
||||
ISC_LIST_DEQUEUE(sevent->bufferlist, b, link);
|
||||
isc_mem_free(mctx, b);
|
||||
}
|
||||
|
||||
query = event->ev_arg;
|
||||
query->waiting_senddone = ISC_FALSE;
|
||||
@@ -2471,7 +2424,6 @@ static void
|
||||
force_timeout(dig_lookup_t *l, dig_query_t *query) {
|
||||
isc_event_t *event;
|
||||
|
||||
debug("force_timeout ()");
|
||||
event = isc_event_allocate(mctx, query, ISC_TIMEREVENT_IDLE,
|
||||
connect_timeout, l,
|
||||
sizeof(isc_event_t));
|
||||
@@ -2539,17 +2491,7 @@ send_tcp_connect(dig_query_t *query) {
|
||||
send_tcp_connect(next);
|
||||
return;
|
||||
}
|
||||
|
||||
INSIST(query->sock == NULL);
|
||||
|
||||
if (keep != NULL && isc_sockaddr_equal(&keepaddr, &query->sockaddr)) {
|
||||
sockcount++;
|
||||
isc_socket_attach(keep, &query->sock);
|
||||
query->waiting_connect = ISC_FALSE;
|
||||
launch_next_query(query, ISC_TRUE);
|
||||
goto search;
|
||||
}
|
||||
|
||||
result = isc_socket_create(socketmgr,
|
||||
isc_sockaddr_pf(&query->sockaddr),
|
||||
isc_sockettype_tcp, &query->sock);
|
||||
@@ -2572,7 +2514,6 @@ send_tcp_connect(dig_query_t *query) {
|
||||
result = isc_socket_connect(query->sock, &query->sockaddr,
|
||||
global_task, connect_done, query);
|
||||
check_result(result, "isc_socket_connect");
|
||||
search:
|
||||
/*
|
||||
* If we're at the endgame of a nameserver search, we need to
|
||||
* immediately bring up all the queries. Do it here.
|
||||
@@ -2580,25 +2521,11 @@ send_tcp_connect(dig_query_t *query) {
|
||||
if (l->ns_search_only && !l->trace_root) {
|
||||
debug("sending next, since searching");
|
||||
next = ISC_LIST_NEXT(query, link);
|
||||
if (ISC_LINK_LINKED(query, link))
|
||||
ISC_LIST_DEQUEUE(l->q, query, link);
|
||||
ISC_LIST_ENQUEUE(l->connecting, query, clink);
|
||||
if (next != NULL)
|
||||
send_tcp_connect(next);
|
||||
}
|
||||
}
|
||||
|
||||
static isc_buffer_t *
|
||||
clone_buffer(isc_buffer_t *source) {
|
||||
isc_buffer_t *buffer;
|
||||
buffer = isc_mem_allocate(mctx, sizeof(*buffer));
|
||||
if (buffer == NULL)
|
||||
fatal("memory allocation failure in %s:%d",
|
||||
__FILE__, __LINE__);
|
||||
*buffer = *source;
|
||||
return (buffer);
|
||||
}
|
||||
|
||||
/*%
|
||||
* Send a UDP packet to the remote nameserver, possible starting the
|
||||
* recv action as well. Also make sure that the timer is running and
|
||||
@@ -2608,7 +2535,6 @@ static void
|
||||
send_udp(dig_query_t *query) {
|
||||
dig_lookup_t *l = NULL;
|
||||
isc_result_t result;
|
||||
isc_buffer_t *sendbuf;
|
||||
|
||||
debug("send_udp(%p)", query);
|
||||
|
||||
@@ -2655,16 +2581,14 @@ send_udp(dig_query_t *query) {
|
||||
debug("recvcount=%d", recvcount);
|
||||
}
|
||||
ISC_LIST_INIT(query->sendlist);
|
||||
sendbuf = clone_buffer(&query->sendbuf);
|
||||
ISC_LIST_ENQUEUE(query->sendlist, sendbuf, link);
|
||||
ISC_LIST_ENQUEUE(query->sendlist, &query->sendbuf, link);
|
||||
debug("sending a request");
|
||||
TIME_NOW(&query->time_sent);
|
||||
INSIST(query->sock != NULL);
|
||||
query->waiting_senddone = ISC_TRUE;
|
||||
result = isc_socket_sendtov2(query->sock, &query->sendlist,
|
||||
global_task, send_done, query,
|
||||
&query->sockaddr, NULL,
|
||||
ISC_SOCKFLAG_NORETRY);
|
||||
result = isc_socket_sendtov(query->sock, &query->sendlist,
|
||||
global_task, send_done, query,
|
||||
&query->sockaddr, NULL);
|
||||
check_result(result, "isc_socket_sendtov");
|
||||
sendcount++;
|
||||
}
|
||||
@@ -2677,7 +2601,7 @@ send_udp(dig_query_t *query) {
|
||||
static void
|
||||
connect_timeout(isc_task_t *task, isc_event_t *event) {
|
||||
dig_lookup_t *l = NULL;
|
||||
dig_query_t *query = NULL, *next, *cq;
|
||||
dig_query_t *query = NULL, *cq;
|
||||
|
||||
UNUSED(task);
|
||||
REQUIRE(event->ev_type == ISC_TIMEREVENT_IDLE);
|
||||
@@ -2701,9 +2625,7 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
|
||||
if (query->sock != NULL)
|
||||
isc_socket_cancel(query->sock, NULL,
|
||||
ISC_SOCKCANCEL_ALL);
|
||||
next = ISC_LIST_NEXT(cq, link);
|
||||
if (next != NULL)
|
||||
send_tcp_connect(next);
|
||||
send_tcp_connect(ISC_LIST_NEXT(cq, link));
|
||||
}
|
||||
UNLOCK_LOOKUP;
|
||||
return;
|
||||
@@ -2826,7 +2748,6 @@ static void
|
||||
launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
|
||||
isc_result_t result;
|
||||
dig_lookup_t *l;
|
||||
isc_buffer_t *buffer;
|
||||
|
||||
INSIST(!free_now);
|
||||
|
||||
@@ -2850,15 +2771,9 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
|
||||
isc_buffer_putuint16(&query->slbuf, (isc_uint16_t) query->sendbuf.used);
|
||||
ISC_LIST_INIT(query->sendlist);
|
||||
ISC_LINK_INIT(&query->slbuf, link);
|
||||
if (!query->first_soa_rcvd) {
|
||||
buffer = clone_buffer(&query->slbuf);
|
||||
ISC_LIST_ENQUEUE(query->sendlist, buffer, link);
|
||||
if (include_question) {
|
||||
buffer = clone_buffer(&query->sendbuf);
|
||||
ISC_LIST_ENQUEUE(query->sendlist, buffer, link);
|
||||
}
|
||||
}
|
||||
|
||||
ISC_LIST_ENQUEUE(query->sendlist, &query->slbuf, link);
|
||||
if (include_question)
|
||||
ISC_LIST_ENQUEUE(query->sendlist, &query->sendbuf, link);
|
||||
ISC_LINK_INIT(&query->lengthbuf, link);
|
||||
ISC_LIST_ENQUEUE(query->lengthlist, &query->lengthbuf, link);
|
||||
|
||||
@@ -2953,17 +2868,12 @@ connect_done(isc_task_t *task, isc_event_t *event) {
|
||||
if (next != NULL) {
|
||||
bringup_timer(next, TCP_TIMEOUT);
|
||||
send_tcp_connect(next);
|
||||
} else
|
||||
} else {
|
||||
check_next_lookup(l);
|
||||
}
|
||||
UNLOCK_LOOKUP;
|
||||
return;
|
||||
}
|
||||
if (keep_open) {
|
||||
if (keep != NULL)
|
||||
isc_socket_detach(&keep);
|
||||
isc_socket_attach(query->sock, &keep);
|
||||
keepaddr = query->sockaddr;
|
||||
}
|
||||
launch_next_query(query, ISC_TRUE);
|
||||
isc_event_free(&event);
|
||||
UNLOCK_LOOKUP;
|
||||
@@ -2987,9 +2897,6 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg,
|
||||
isc_boolean_t ixfr = query->lookup->rdtype == dns_rdatatype_ixfr;
|
||||
isc_boolean_t axfr = query->lookup->rdtype == dns_rdatatype_axfr;
|
||||
|
||||
if (ixfr)
|
||||
axfr = query->ixfr_axfr;
|
||||
|
||||
debug("check_for_more_data()");
|
||||
|
||||
/*
|
||||
@@ -3038,7 +2945,7 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg,
|
||||
query->second_rr_rcvd = ISC_TRUE;
|
||||
query->second_rr_serial = 0;
|
||||
debug("got the second rr as nonsoa");
|
||||
axfr = query->ixfr_axfr = ISC_TRUE;
|
||||
axfr = ISC_TRUE;
|
||||
goto next_rdata;
|
||||
}
|
||||
|
||||
@@ -3474,7 +3381,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
||||
}
|
||||
|
||||
if (!l->doing_xfr || l->xfr_q == query) {
|
||||
if (msg->rcode == dns_rcode_nxdomain &&
|
||||
if (msg->rcode != dns_rcode_noerror &&
|
||||
(l->origin != NULL || l->need_search)) {
|
||||
if (!next_origin(query) || showsearch) {
|
||||
printmessage(query, msg, ISC_TRUE);
|
||||
@@ -3520,7 +3427,6 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
||||
if (n == 0)
|
||||
docancel = ISC_TRUE;
|
||||
l->trace_root = ISC_FALSE;
|
||||
usesearch = ISC_FALSE;
|
||||
} else
|
||||
#ifdef DIG_SIGCHASE
|
||||
if (!do_sigchase)
|
||||
@@ -3697,19 +3603,15 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp) {
|
||||
*/
|
||||
void
|
||||
do_lookup(dig_lookup_t *lookup) {
|
||||
dig_query_t *query;
|
||||
|
||||
REQUIRE(lookup != NULL);
|
||||
|
||||
debug("do_lookup()");
|
||||
lookup->pending = ISC_TRUE;
|
||||
query = ISC_LIST_HEAD(lookup->q);
|
||||
if (query != NULL) {
|
||||
if (lookup->tcp_mode)
|
||||
send_tcp_connect(query);
|
||||
else
|
||||
send_udp(query);
|
||||
}
|
||||
if (lookup->tcp_mode)
|
||||
send_tcp_connect(ISC_LIST_HEAD(lookup->q));
|
||||
else
|
||||
send_udp(ISC_LIST_HEAD(lookup->q));
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -3745,31 +3647,18 @@ cancel_all(void) {
|
||||
if (current_lookup != NULL) {
|
||||
if (current_lookup->timer != NULL)
|
||||
isc_timer_detach(¤t_lookup->timer);
|
||||
for (q = ISC_LIST_HEAD(current_lookup->q);
|
||||
q != NULL;
|
||||
q = nq)
|
||||
{
|
||||
q = ISC_LIST_HEAD(current_lookup->q);
|
||||
while (q != NULL) {
|
||||
debug("canceling query %p, belonging to %p",
|
||||
q, current_lookup);
|
||||
nq = ISC_LIST_NEXT(q, link);
|
||||
debug("canceling pending query %p, belonging to %p",
|
||||
q, current_lookup);
|
||||
if (q->sock != NULL)
|
||||
if (q->sock != NULL) {
|
||||
isc_socket_cancel(q->sock, NULL,
|
||||
ISC_SOCKCANCEL_ALL);
|
||||
else
|
||||
clear_query(q);
|
||||
}
|
||||
for (q = ISC_LIST_HEAD(current_lookup->connecting);
|
||||
q != NULL;
|
||||
q = nq)
|
||||
{
|
||||
nq = ISC_LIST_NEXT(q, clink);
|
||||
debug("canceling connecting query %p, belonging to %p",
|
||||
q, current_lookup);
|
||||
if (q->sock != NULL)
|
||||
isc_socket_cancel(q->sock, NULL,
|
||||
ISC_SOCKCANCEL_ALL);
|
||||
else
|
||||
} else {
|
||||
clear_query(q);
|
||||
}
|
||||
q = nq;
|
||||
}
|
||||
}
|
||||
l = ISC_LIST_HEAD(lookup_list);
|
||||
@@ -3796,8 +3685,6 @@ destroy_libs(void) {
|
||||
isc_result_t result;
|
||||
#endif
|
||||
|
||||
if (keep != NULL)
|
||||
isc_socket_detach(&keep);
|
||||
debug("destroy_libs()");
|
||||
if (global_task != NULL) {
|
||||
debug("freeing task");
|
||||
@@ -3949,7 +3836,7 @@ output_filter(isc_buffer_t *buffer, unsigned int used_org,
|
||||
fromlen = isc_buffer_usedlength(buffer) - used_org;
|
||||
if (fromlen >= MAXDLEN)
|
||||
return (ISC_R_SUCCESS);
|
||||
memmove(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
|
||||
memcpy(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
|
||||
end_with_dot = (tmp1[fromlen - 1] == '.') ? ISC_TRUE : ISC_FALSE;
|
||||
if (absolute && !end_with_dot) {
|
||||
fromlen++;
|
||||
@@ -3978,8 +3865,8 @@ output_filter(isc_buffer_t *buffer, unsigned int used_org,
|
||||
return (ISC_R_NOSPACE);
|
||||
|
||||
isc_buffer_subtract(buffer, isc_buffer_usedlength(buffer) - used_org);
|
||||
memmove(isc_buffer_used(buffer), tmp1, tolen);
|
||||
isc_buffer_add(buffer, (unsigned int)tolen);
|
||||
memcpy(isc_buffer_used(buffer), tmp1, tolen);
|
||||
isc_buffer_add(buffer, tolen);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
@@ -3998,8 +3885,7 @@ append_textname(char *name, const char *origin, size_t namesize) {
|
||||
if (namelen + 1 + originlen >= namesize)
|
||||
return idn_buffer_overflow;
|
||||
|
||||
if (*origin != '.')
|
||||
name[namelen++] = '.';
|
||||
name[namelen++] = '.';
|
||||
(void)strcpy(name + namelen, origin);
|
||||
return idn_success;
|
||||
}
|
||||
@@ -4197,7 +4083,7 @@ sigchase_scanname(dns_rdatatype_t type, dns_rdatatype_t covers,
|
||||
check_result(result, "dns_name_totext");
|
||||
isc_buffer_usedregion(b, &r);
|
||||
r.base[r.length] = '\0';
|
||||
strlcpy(lookup->textname, (char*)r.base, sizeof(lookup->textname));
|
||||
strcpy(lookup->textname, (char*)r.base);
|
||||
isc_buffer_free(&b);
|
||||
|
||||
if (type == dns_rdatatype_rrsig)
|
||||
@@ -4222,35 +4108,17 @@ sigchase_scanname(dns_rdatatype_t type, dns_rdatatype_t covers,
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
insert_trustedkey(void *arg, dns_name_t *name, dns_rdataset_t *rdataset)
|
||||
void
|
||||
insert_trustedkey(dst_key_t **keyp)
|
||||
{
|
||||
isc_result_t result;
|
||||
dst_key_t *key;
|
||||
if (*keyp == NULL)
|
||||
return;
|
||||
if (tk_list.nb_tk >= MAX_TRUSTED_KEY)
|
||||
return;
|
||||
|
||||
UNUSED(arg);
|
||||
|
||||
if (rdataset == NULL || rdataset->type != dns_rdatatype_dnskey)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
for (result = dns_rdataset_first(rdataset);
|
||||
result == ISC_R_SUCCESS;
|
||||
result = dns_rdataset_next(rdataset)) {
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
isc_buffer_t b;
|
||||
|
||||
dns_rdataset_current(rdataset, &rdata);
|
||||
isc_buffer_init(&b, rdata.data, rdata.length);
|
||||
isc_buffer_add(&b, rdata.length);
|
||||
if (tk_list.nb_tk >= MAX_TRUSTED_KEY)
|
||||
return (ISC_R_SUCCESS);
|
||||
key = NULL;
|
||||
result = dst_key_fromdns(name, rdata.rdclass, &b, mctx, &key);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
continue;
|
||||
tk_list.key[tk_list.nb_tk++] = key;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
tk_list.key[tk_list.nb_tk++] = *keyp;
|
||||
*keyp = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -4296,12 +4164,87 @@ removetmpkey(isc_mem_t *mctx, const char *file)
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
opentmpkey(isc_mem_t *mctx, const char *file, char **tempp, FILE **fp) {
|
||||
FILE *f = NULL;
|
||||
isc_result_t result;
|
||||
char *tempname = NULL;
|
||||
char *tempnamekey = NULL;
|
||||
int tempnamelen;
|
||||
int tempnamekeylen;
|
||||
char *x;
|
||||
char *cp;
|
||||
isc_uint32_t which;
|
||||
|
||||
while (1) {
|
||||
tempnamelen = strlen(file) + 20;
|
||||
tempname = isc_mem_allocate(mctx, tempnamelen);
|
||||
if (tempname == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
memset(tempname, 0, tempnamelen);
|
||||
|
||||
result = isc_file_mktemplate(file, tempname, tempnamelen);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
cp = tempname;
|
||||
while (*cp != '\0')
|
||||
cp++;
|
||||
if (cp == tempname) {
|
||||
isc_mem_free(mctx, tempname);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
x = cp--;
|
||||
while (cp >= tempname && *cp == 'X') {
|
||||
isc_random_get(&which);
|
||||
*cp = alphnum[which % (sizeof(alphnum) - 1)];
|
||||
x = cp--;
|
||||
}
|
||||
|
||||
tempnamekeylen = tempnamelen+5;
|
||||
tempnamekey = isc_mem_allocate(mctx, tempnamekeylen);
|
||||
if (tempnamekey == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
||||
memset(tempnamekey, 0, tempnamekeylen);
|
||||
strncpy(tempnamekey, tempname, tempnamelen);
|
||||
strcat(tempnamekey ,".key");
|
||||
|
||||
|
||||
if (isc_file_exists(tempnamekey)) {
|
||||
isc_mem_free(mctx, tempnamekey);
|
||||
isc_mem_free(mctx, tempname);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((f = fopen(tempnamekey, "w")) == NULL) {
|
||||
printf("get_trusted_key(): trusted key not found %s\n",
|
||||
tempnamekey);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
isc_mem_free(mctx, tempnamekey);
|
||||
*tempp = tempname;
|
||||
*fp = f;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
cleanup:
|
||||
isc_mem_free(mctx, tempname);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
get_trusted_key(isc_mem_t *mctx)
|
||||
{
|
||||
isc_result_t result;
|
||||
const char *filename = NULL;
|
||||
dns_rdatacallbacks_t callbacks;
|
||||
char *filetemp = NULL;
|
||||
char buf[1500];
|
||||
FILE *fp, *fptemp;
|
||||
dst_key_t *key = NULL;
|
||||
|
||||
result = isc_file_exists(trustedkey);
|
||||
if (result != ISC_TRUE) {
|
||||
@@ -4322,11 +4265,40 @@ get_trusted_key(isc_mem_t *mctx)
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
dns_rdatacallbacks_init_stdio(&callbacks);
|
||||
callbacks.add = insert_trustedkey;
|
||||
return (dns_master_loadfile(filename, dns_rootname, dns_rootname,
|
||||
current_lookup->rdclass, 0, &callbacks,
|
||||
mctx));
|
||||
if ((fp = fopen(filename, "r")) == NULL) {
|
||||
printf("get_trusted_key(): trusted key not found %s\n",
|
||||
filename);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
result = opentmpkey(mctx,"tmp_file", &filetemp, &fptemp);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fclose(fp);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
if (fputs(buf, fptemp) < 0) {
|
||||
fclose(fp);
|
||||
fclose(fptemp);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
fclose(fptemp);
|
||||
result = dst_key_fromnamedfile(filetemp, NULL, DST_TYPE_PUBLIC,
|
||||
mctx, &key);
|
||||
removetmpkey(mctx, filetemp);
|
||||
isc_mem_free(mctx, filetemp);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fclose(fp);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
#if 0
|
||||
dst_key_tofile(key, DST_TYPE_PUBLIC,"/tmp");
|
||||
#endif
|
||||
insert_trustedkey(&key);
|
||||
if (key != NULL)
|
||||
dst_key_free(&key);
|
||||
}
|
||||
fclose(fp);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -4340,7 +4312,7 @@ nameFromString(const char *str, dns_name_t *p_ret) {
|
||||
REQUIRE(p_ret != NULL);
|
||||
REQUIRE(str != NULL);
|
||||
|
||||
isc_buffer_constinit(&buffer, str, len);
|
||||
isc_buffer_init(&buffer, str, len);
|
||||
isc_buffer_add(&buffer, len);
|
||||
|
||||
dns_fixedname_init(&fixedname);
|
||||
@@ -4370,7 +4342,7 @@ prepare_lookup(dns_name_t *name)
|
||||
lookup->new_search = ISC_TRUE;
|
||||
lookup->trace_root_sigchase = ISC_FALSE;
|
||||
|
||||
strlcpy(lookup->textname, lookup->textnamesigchase, MXNAME);
|
||||
strncpy(lookup->textname, lookup->textnamesigchase, MXNAME);
|
||||
|
||||
lookup->rdtype = lookup->rdtype_sigchase;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
@@ -4429,7 +4401,7 @@ prepare_lookup(dns_name_t *name)
|
||||
dns_rdata_totext(&aaaa, &ns.name, b);
|
||||
isc_buffer_usedregion(b, &r);
|
||||
r.base[r.length] = '\0';
|
||||
strlcpy(namestr, (char*)r.base,
|
||||
strncpy(namestr, (char*)r.base,
|
||||
DNS_NAME_FORMATSIZE);
|
||||
isc_buffer_free(&b);
|
||||
dns_rdata_reset(&aaaa);
|
||||
@@ -4458,7 +4430,7 @@ prepare_lookup(dns_name_t *name)
|
||||
dns_rdata_totext(&a, &ns.name, b);
|
||||
isc_buffer_usedregion(b, &r);
|
||||
r.base[r.length] = '\0';
|
||||
strlcpy(namestr, (char*)r.base,
|
||||
strncpy(namestr, (char*)r.base,
|
||||
DNS_NAME_FORMATSIZE);
|
||||
isc_buffer_free(&b);
|
||||
dns_rdata_reset(&a);
|
||||
@@ -4637,6 +4609,7 @@ contains_trusted_key(dns_name_t *name, dns_rdataset_t *rdataset,
|
||||
{
|
||||
isc_result_t result;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
dst_key_t *trustedKey = NULL;
|
||||
dst_key_t *dnsseckey = NULL;
|
||||
int i;
|
||||
|
||||
@@ -4680,6 +4653,10 @@ contains_trusted_key(dns_name_t *name, dns_rdataset_t *rdataset,
|
||||
dst_key_free(&dnsseckey);
|
||||
} while (dns_rdataset_next(rdataset) == ISC_R_SUCCESS);
|
||||
|
||||
if (trustedKey != NULL)
|
||||
dst_key_free(&trustedKey);
|
||||
trustedKey = NULL;
|
||||
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2007, 2009-2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2007, 2009-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -446,18 +446,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
if (msg->rcode != 0) {
|
||||
char namestr[DNS_NAME_FORMATSIZE];
|
||||
dns_name_format(query->lookup->name, namestr, sizeof(namestr));
|
||||
|
||||
if (query->lookup->identify_previous_line)
|
||||
printf("Nameserver %s:\n\t%s not found: %d(%s)\n",
|
||||
query->servname,
|
||||
(msg->rcode != dns_rcode_nxdomain) ? namestr :
|
||||
query->lookup->textname, msg->rcode,
|
||||
rcode_totext(msg->rcode));
|
||||
else
|
||||
printf("Host %s not found: %d(%s)\n",
|
||||
(msg->rcode != dns_rcode_nxdomain) ? namestr :
|
||||
query->lookup->textname, msg->rcode,
|
||||
rcode_totext(msg->rcode));
|
||||
printf("Host %s not found: %d(%s)\n",
|
||||
(msg->rcode != dns_rcode_nxdomain) ? namestr :
|
||||
query->lookup->textname, msg->rcode,
|
||||
rcode_totext(msg->rcode));
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -638,8 +630,6 @@ pre_parse_args(int argc, char **argv) {
|
||||
case 'w': break;
|
||||
case 'C': break;
|
||||
case 'D':
|
||||
if (debugging)
|
||||
debugtiming = ISC_TRUE;
|
||||
debugging = ISC_TRUE;
|
||||
break;
|
||||
case 'N': break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2009, 2011-2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2009, 2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -168,7 +168,6 @@ isc_boolean_t sigchase;
|
||||
dns_name_t *oname;
|
||||
ISC_LINK(dig_lookup_t) link;
|
||||
ISC_LIST(dig_query_t) q;
|
||||
ISC_LIST(dig_query_t) connecting;
|
||||
dig_query_t *current_query;
|
||||
dig_serverlist_t my_server_list;
|
||||
dig_searchlist_t *origin;
|
||||
@@ -202,7 +201,6 @@ struct dig_query {
|
||||
isc_uint32_t second_rr_serial;
|
||||
isc_uint32_t msg_count;
|
||||
isc_uint32_t rr_count;
|
||||
isc_boolean_t ixfr_axfr;
|
||||
char *servname;
|
||||
char *userarg;
|
||||
isc_bufferlist_t sendlist,
|
||||
@@ -216,7 +214,6 @@ struct dig_query {
|
||||
slspace[4];
|
||||
isc_socket_t *sock;
|
||||
ISC_LINK(dig_query_t) link;
|
||||
ISC_LINK(dig_query_t) clink;
|
||||
isc_sockaddr_t sockaddr;
|
||||
isc_time_t time_sent;
|
||||
isc_uint64_t byte_count;
|
||||
@@ -276,8 +273,7 @@ extern isc_boolean_t validated;
|
||||
extern isc_taskmgr_t *taskmgr;
|
||||
extern isc_task_t *global_task;
|
||||
extern isc_boolean_t free_now;
|
||||
extern isc_boolean_t debugging, debugtiming, memdebugging;
|
||||
extern isc_boolean_t keep_open;
|
||||
extern isc_boolean_t debugging, memdebugging;
|
||||
|
||||
extern char *progname;
|
||||
extern int tries;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2004-2007, 2010, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and/or distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -216,11 +216,6 @@ Tell the name server to query other servers if it does not have the information.
|
||||
(Default = recurse; abbreviation = [no]rec)
|
||||
.RE
|
||||
.PP
|
||||
\fBndots=\fR\fInumber\fR
|
||||
.RS 4
|
||||
Set the number of dots (label separators) in a domain that will disable searching. Absolute names always stop searching.
|
||||
.RE
|
||||
.PP
|
||||
\fBretry=\fR\fInumber\fR
|
||||
.RS 4
|
||||
Set the number of retries to number.
|
||||
@@ -259,5 +254,5 @@ Try the next nameserver if a nameserver responds with SERVFAIL or a referral (no
|
||||
.PP
|
||||
Andrew Cherenson
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 2004\-2007, 2010, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright \(co 2004\-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
.br
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -434,7 +434,8 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
dns_name_format(query->lookup->name,
|
||||
nametext, sizeof(nametext));
|
||||
printf("** server can't find %s: %s\n",
|
||||
nametext, rcode_totext(msg->rcode));
|
||||
(msg->rcode != dns_rcode_nxdomain) ? nametext :
|
||||
query->lookup->textname, rcode_totext(msg->rcode));
|
||||
debug("returning with rcode == 0");
|
||||
|
||||
/* the lookup failed */
|
||||
@@ -493,8 +494,8 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
|
||||
printf(" %s\t\t%s\n",
|
||||
usesearch ? "search" : "nosearch",
|
||||
recurse ? "recurse" : "norecurse");
|
||||
printf(" timeout = %d\t\tretry = %d\tport = %d\tndots = %d\n",
|
||||
timeout, tries, port, ndots);
|
||||
printf(" timeout = %d\t\tretry = %d\tport = %d\n",
|
||||
timeout, tries, port);
|
||||
printf(" querytype = %-8s\tclass = %s\n", deftype, defclass);
|
||||
printf(" srchlist = ");
|
||||
for (listent = ISC_LIST_HEAD(search_list);
|
||||
@@ -565,14 +566,6 @@ set_tries(const char *value) {
|
||||
tries = n;
|
||||
}
|
||||
|
||||
static void
|
||||
set_ndots(const char *value) {
|
||||
isc_uint32_t n;
|
||||
isc_result_t result = parse_uint(&n, value, 128, "ndots");
|
||||
if (result == ISC_R_SUCCESS)
|
||||
ndots = n;
|
||||
}
|
||||
|
||||
static void
|
||||
setoption(char *opt) {
|
||||
if (strncasecmp(opt, "all", 4) == 0) {
|
||||
@@ -653,8 +646,6 @@ setoption(char *opt) {
|
||||
nofail=ISC_FALSE;
|
||||
} else if (strncasecmp(opt, "nofail", 3) == 0) {
|
||||
nofail=ISC_TRUE;
|
||||
} else if (strncasecmp(opt, "ndots=", 6) == 0) {
|
||||
set_ndots(&opt[6]);
|
||||
} else {
|
||||
printf("*** Invalid option: %s\n", opt);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY mdash "—">]>
|
||||
<!--
|
||||
- Copyright (C) 2004-2007, 2010, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
- purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -30,7 +30,11 @@
|
||||
- 2. Redistributions in binary form must reproduce the above copyright
|
||||
- notice, this list of conditions and the following disclaimer in the
|
||||
- documentation and/or other materials provided with the distribution.
|
||||
- 3. Neither the name of the University nor the names of its contributors
|
||||
- 3. All advertising materials mentioning features or use of this software
|
||||
- must display the following acknowledgement:
|
||||
- This product includes software developed by the University of
|
||||
- California, Berkeley and its contributors.
|
||||
- 4. Neither the name of the University nor the names of its contributors
|
||||
- may be used to endorse or promote products derived from this software
|
||||
- without specific prior written permission.
|
||||
-
|
||||
@@ -70,8 +74,6 @@
|
||||
<year>2006</year>
|
||||
<year>2007</year>
|
||||
<year>2010</year>
|
||||
<year>2013</year>
|
||||
<year>2014</year>
|
||||
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
|
||||
</copyright>
|
||||
</docinfo>
|
||||
@@ -407,17 +409,6 @@ nslookup -query=hinfo -timeout=10
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><constant>ndots=</constant><replaceable>number</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set the number of dots (label separators) in a domain
|
||||
that will disable searching. Absolute names always
|
||||
stop searching.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><constant>retry=</constant><replaceable>number</replaceable></term>
|
||||
<listitem>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
- Copyright (C) 2004-2007, 2010, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
- Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
|
||||
-
|
||||
- Permission to use, copy, modify, and/or distribute this software for any
|
||||
- purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="cmdsynopsis"><p><code class="command">nslookup</code> [<code class="option">-option</code>] [name | -] [server]</p></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543435"></a><h2>DESCRIPTION</h2>
|
||||
<a name="id2543361"></a><h2>DESCRIPTION</h2>
|
||||
<p><span><strong class="command">Nslookup</strong></span>
|
||||
is a program to query Internet domain name servers. <span><strong class="command">Nslookup</strong></span>
|
||||
has two modes: interactive and non-interactive. Interactive mode allows
|
||||
@@ -43,7 +43,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543451"></a><h2>ARGUMENTS</h2>
|
||||
<a name="id2543377"></a><h2>ARGUMENTS</h2>
|
||||
<p>
|
||||
Interactive mode is entered in the following cases:
|
||||
</p>
|
||||
@@ -78,7 +78,7 @@ nslookup -query=hinfo -timeout=10
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2543495"></a><h2>INTERACTIVE COMMANDS</h2>
|
||||
<a name="id2543420"></a><h2>INTERACTIVE COMMANDS</h2>
|
||||
<div class="variablelist"><dl>
|
||||
<dt><span class="term"><code class="constant">host</code> [<span class="optional">server</span>]</span></dt>
|
||||
<dd>
|
||||
@@ -249,12 +249,6 @@ nslookup -query=hinfo -timeout=10
|
||||
(Default = recurse; abbreviation = [no]rec)
|
||||
</p>
|
||||
</dd>
|
||||
<dt><span class="term"><code class="constant">ndots=</code><em class="replaceable"><code>number</code></em></span></dt>
|
||||
<dd><p>
|
||||
Set the number of dots (label separators) in a domain
|
||||
that will disable searching. Absolute names always
|
||||
stop searching.
|
||||
</p></dd>
|
||||
<dt><span class="term"><code class="constant">retry=</code><em class="replaceable"><code>number</code></em></span></dt>
|
||||
<dd><p>
|
||||
Set the number of retries to number.
|
||||
@@ -294,19 +288,19 @@ nslookup -query=hinfo -timeout=10
|
||||
</dl></div>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2546309"></a><h2>FILES</h2>
|
||||
<a name="id2546286"></a><h2>FILES</h2>
|
||||
<p><code class="filename">/etc/resolv.conf</code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2546321"></a><h2>SEE ALSO</h2>
|
||||
<a name="id2546298"></a><h2>SEE ALSO</h2>
|
||||
<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">host</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<a name="id2546355"></a><h2>Author</h2>
|
||||
<a name="id2546332"></a><h2>Author</h2>
|
||||
<p>
|
||||
Andrew Cherenson
|
||||
</p>
|
||||
|
||||
@@ -356,8 +356,6 @@ main(int argc, char **argv) {
|
||||
fprintf(stderr, "The use of RSA (RSAMD5) is not recommended.\n"
|
||||
"If you still wish to use RSA (RSAMD5) please "
|
||||
"specify \"-a RSAMD5\"\n");
|
||||
if (freeit != NULL)
|
||||
free(freeit);
|
||||
return (1);
|
||||
} else {
|
||||
r.base = algname;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Portions Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -526,7 +526,6 @@ main(int argc, char **argv) {
|
||||
"recommended.\nIf you still wish to "
|
||||
"use RSA (RSAMD5) please specify "
|
||||
"\"-a RSAMD5\"\n");
|
||||
INSIST(freeit == NULL);
|
||||
return (1);
|
||||
} else if (strcasecmp(algname, "HMAC-MD5") == 0)
|
||||
alg = DST_ALG_HMACMD5;
|
||||
@@ -646,9 +645,9 @@ main(int argc, char **argv) {
|
||||
mctx, &prevkey);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
fatal("Invalid keyfile %s: %s",
|
||||
predecessor, isc_result_totext(ret));
|
||||
filename, isc_result_totext(ret));
|
||||
if (!dst_key_isprivate(prevkey))
|
||||
fatal("%s is not a private key", predecessor);
|
||||
fatal("%s is not a private key", filename);
|
||||
|
||||
name = dst_key_name(prevkey);
|
||||
alg = dst_key_alg(prevkey);
|
||||
@@ -961,15 +960,8 @@ main(int argc, char **argv) {
|
||||
dst_key_settime(key, DST_TIME_INACTIVE,
|
||||
inactive);
|
||||
|
||||
if (setdel) {
|
||||
if (setinact && delete < inactive)
|
||||
fprintf(stderr, "%s: warning: Key is "
|
||||
"scheduled to be deleted "
|
||||
"before it is scheduled to be "
|
||||
"made inactive.\n",
|
||||
program);
|
||||
if (setdel)
|
||||
dst_key_settime(key, DST_TIME_DELETE, delete);
|
||||
}
|
||||
} else {
|
||||
if (setpub || setact || setrev || setinact ||
|
||||
setdel || unsetpub || unsetact ||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2009-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libgen.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libgen.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
@@ -139,7 +140,6 @@ main(int argc, char **argv) {
|
||||
int prepub = -1;
|
||||
isc_stdtime_t now;
|
||||
isc_stdtime_t pub = 0, act = 0, rev = 0, inact = 0, del = 0;
|
||||
isc_stdtime_t prevact = 0, previnact = 0, prevdel = 0;
|
||||
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
|
||||
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
|
||||
isc_boolean_t setdel = ISC_FALSE;
|
||||
@@ -344,6 +344,7 @@ main(int argc, char **argv) {
|
||||
|
||||
if (predecessor != NULL) {
|
||||
char keystr[DST_KEY_FORMATSIZE];
|
||||
isc_stdtime_t when;
|
||||
int major, minor;
|
||||
|
||||
if (prepub == -1)
|
||||
@@ -375,20 +376,19 @@ main(int argc, char **argv) {
|
||||
fatal("Predecessor has incompatible format "
|
||||
"version %d.%d\n\t", major, minor);
|
||||
|
||||
result = dst_key_gettime(prevkey, DST_TIME_ACTIVATE, &prevact);
|
||||
result = dst_key_gettime(prevkey, DST_TIME_ACTIVATE, &when);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Predecessor has no activation date. "
|
||||
"You must set one before\n\t"
|
||||
"generating a successor.");
|
||||
|
||||
result = dst_key_gettime(prevkey, DST_TIME_INACTIVE,
|
||||
&previnact);
|
||||
result = dst_key_gettime(prevkey, DST_TIME_INACTIVE, &act);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Predecessor has no inactivation date. "
|
||||
"You must set one before\n\t"
|
||||
"generating a successor.");
|
||||
|
||||
pub = prevact - prepub;
|
||||
pub = act - prepub;
|
||||
if (pub < now && prepub != 0)
|
||||
fatal("Predecessor will become inactive before the\n\t"
|
||||
"prepublication period ends. Either change "
|
||||
@@ -396,18 +396,13 @@ main(int argc, char **argv) {
|
||||
"or use the -i option to set a shorter "
|
||||
"prepublication interval.");
|
||||
|
||||
result = dst_key_gettime(prevkey, DST_TIME_DELETE, &prevdel);
|
||||
result = dst_key_gettime(prevkey, DST_TIME_DELETE, &when);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fprintf(stderr, "%s: warning: Predecessor has no "
|
||||
fprintf(stderr, "%s: WARNING: Predecessor has no "
|
||||
"removal date;\n\t"
|
||||
"it will remain in the zone "
|
||||
"indefinitely after rollover.\n",
|
||||
program);
|
||||
else if (prevdel < previnact)
|
||||
fprintf(stderr, "%s: warning: Predecessor is "
|
||||
"scheduled to be deleted\n\t"
|
||||
"before it is scheduled to be "
|
||||
"inactive.\n", program);
|
||||
|
||||
changed = setpub = setact = ISC_TRUE;
|
||||
dst_key_free(&prevkey);
|
||||
@@ -469,20 +464,6 @@ main(int argc, char **argv) {
|
||||
fatal("Key flags mismatch");
|
||||
}
|
||||
|
||||
prevdel = previnact = 0;
|
||||
if ((setdel && setinact && del < inact) ||
|
||||
(dst_key_gettime(key, DST_TIME_INACTIVE,
|
||||
&previnact) == ISC_R_SUCCESS &&
|
||||
setdel && !setinact && del < previnact) ||
|
||||
(dst_key_gettime(key, DST_TIME_DELETE,
|
||||
&prevdel) == ISC_R_SUCCESS &&
|
||||
setinact && !setdel && prevdel < inact) ||
|
||||
(!setdel && !setinact && prevdel < previnact))
|
||||
fprintf(stderr, "%s: warning: Key is scheduled to "
|
||||
"be deleted before it is\n\t"
|
||||
"scheduled to be inactive.\n",
|
||||
program);
|
||||
|
||||
if (force)
|
||||
set_keyversion(key);
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2004-2009, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (C) 2000-2003 Internet Software Consortium.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -309,7 +309,7 @@ Generate an NSEC3 chain with the given hex encoded salt. A dash (\fIsalt\fR) can
|
||||
.PP
|
||||
\-H \fIiterations\fR
|
||||
.RS 4
|
||||
When generating an NSEC3 chain, use this many iterations. The default is 10.
|
||||
When generating an NSEC3 chain, use this many interations. The default is 10.
|
||||
.RE
|
||||
.PP
|
||||
\-A
|
||||
@@ -378,7 +378,7 @@ RFC 4033.
|
||||
.PP
|
||||
Internet Systems Consortium
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 2004\-2009, 2013 Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright \(co 2004\-2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
.br
|
||||
Copyright \(co 2000\-2003 Internet Software Consortium.
|
||||
.br
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Portions Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -646,11 +646,9 @@ hashlist_add(hashlist_t *l, const unsigned char *hash, size_t len)
|
||||
if (l->entries == l->size) {
|
||||
l->size = l->size * 2 + 100;
|
||||
l->hashbuf = realloc(l->hashbuf, l->size * l->length);
|
||||
if (l->hashbuf == NULL)
|
||||
fatal("unable to grow hashlist: out of memory");
|
||||
}
|
||||
memset(l->hashbuf + l->entries * l->length, 0, l->length);
|
||||
memmove(l->hashbuf + l->entries * l->length, hash, len);
|
||||
memcpy(l->hashbuf + l->entries * l->length, hash, len);
|
||||
l->entries++;
|
||||
}
|
||||
|
||||
@@ -665,8 +663,7 @@ hashlist_add_dns_name(hashlist_t *l, /*const*/ dns_name_t *name,
|
||||
unsigned int len;
|
||||
size_t i;
|
||||
|
||||
len = isc_iterated_hash(hash, hashalg, iterations,
|
||||
salt, (int)salt_length,
|
||||
len = isc_iterated_hash(hash, hashalg, iterations, salt, salt_length,
|
||||
name->ndata, name->length);
|
||||
if (verbose) {
|
||||
dns_name_format(name, nametext, sizeof nametext);
|
||||
@@ -718,7 +715,7 @@ static const unsigned char *
|
||||
hashlist_findnext(const hashlist_t *l,
|
||||
const unsigned char hash[NSEC3_MAX_HASH_LENGTH])
|
||||
{
|
||||
size_t entries = l->entries;
|
||||
unsigned int entries = l->entries;
|
||||
const unsigned char *next = bsearch(hash, l->hashbuf, l->entries,
|
||||
l->length, hashlist_comp);
|
||||
INSIST(next != NULL);
|
||||
@@ -730,8 +727,8 @@ hashlist_findnext(const hashlist_t *l,
|
||||
next = l->hashbuf;
|
||||
if (next[l->length - 1] == 0)
|
||||
break;
|
||||
} while (entries-- > 1U);
|
||||
INSIST(entries != 0U);
|
||||
} while (entries-- > 1);
|
||||
INSIST(entries != 0);
|
||||
return (next);
|
||||
}
|
||||
|
||||
@@ -1615,8 +1612,7 @@ verifyzone(void) {
|
||||
fprintf(stderr, "No self signing KSK found. Using "
|
||||
"self signed ZSK's for active "
|
||||
"algorithm list.\n");
|
||||
memmove(ksk_algorithms, self_algorithms,
|
||||
sizeof(ksk_algorithms));
|
||||
memcpy(ksk_algorithms, self_algorithms, sizeof(ksk_algorithms));
|
||||
if (!allzsksigned)
|
||||
fprintf(stderr, "warning: not all ZSK's are self "
|
||||
"signed.\n");
|
||||
@@ -2031,9 +2027,7 @@ add_ds(dns_name_t *name, dns_dbnode_t *node, isc_uint32_t nsttl) {
|
||||
* Remove records of the given type and their signatures.
|
||||
*/
|
||||
static void
|
||||
remove_records(dns_dbnode_t *node, dns_rdatatype_t which,
|
||||
isc_boolean_t checknsec)
|
||||
{
|
||||
remove_records(dns_dbnode_t *node, dns_rdatatype_t which) {
|
||||
isc_result_t result;
|
||||
dns_rdatatype_t type, covers;
|
||||
dns_rdatasetiter_t *rdsiter = NULL;
|
||||
@@ -2054,12 +2048,10 @@ remove_records(dns_dbnode_t *node, dns_rdatatype_t which,
|
||||
covers = rdataset.covers;
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
if (type == which || covers == which) {
|
||||
if (which == dns_rdatatype_nsec &&
|
||||
checknsec && !update_chain)
|
||||
if (which == dns_rdatatype_nsec && !update_chain)
|
||||
fatal("Zone contains NSEC records. Use -u "
|
||||
"to update to NSEC3.");
|
||||
if (which == dns_rdatatype_nsec3param &&
|
||||
checknsec && !update_chain)
|
||||
if (which == dns_rdatatype_nsec3param && !update_chain)
|
||||
fatal("Zone contains NSEC3 chains. Use -u "
|
||||
"to update to NSEC.");
|
||||
result = dns_db_deleterdataset(gdb, node, gversion,
|
||||
@@ -2071,39 +2063,6 @@ remove_records(dns_dbnode_t *node, dns_rdatatype_t which,
|
||||
dns_rdatasetiter_destroy(&rdsiter);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove signatures covering the given type (0 == all signatures).
|
||||
*/
|
||||
static void
|
||||
remove_sigs(dns_dbnode_t *node, dns_rdatatype_t which) {
|
||||
isc_result_t result;
|
||||
dns_rdatatype_t type, covers;
|
||||
dns_rdatasetiter_t *rdsiter = NULL;
|
||||
dns_rdataset_t rdataset;
|
||||
|
||||
dns_rdataset_init(&rdataset);
|
||||
result = dns_db_allrdatasets(gdb, node, gversion, 0, &rdsiter);
|
||||
check_result(result, "dns_db_allrdatasets()");
|
||||
for (result = dns_rdatasetiter_first(rdsiter);
|
||||
result == ISC_R_SUCCESS;
|
||||
result = dns_rdatasetiter_next(rdsiter)) {
|
||||
dns_rdatasetiter_current(rdsiter, &rdataset);
|
||||
type = rdataset.type;
|
||||
covers = rdataset.covers;
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
|
||||
if (type == dns_rdatatype_rrsig &&
|
||||
(covers == which || which == 0))
|
||||
{
|
||||
result = dns_db_deleterdataset(gdb, node, gversion,
|
||||
type, covers);
|
||||
check_result(result, "dns_db_deleterdataset()");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
dns_rdatasetiter_destroy(&rdsiter);
|
||||
}
|
||||
|
||||
/*%
|
||||
* Generate NSEC records for the zone and remove NSEC3/NSEC3PARAM records.
|
||||
*/
|
||||
@@ -2180,17 +2139,14 @@ nsecify(void) {
|
||||
}
|
||||
|
||||
if (dns_name_equal(name, gorigin))
|
||||
remove_records(node, dns_rdatatype_nsec3param,
|
||||
ISC_TRUE);
|
||||
remove_records(node, dns_rdatatype_nsec3param);
|
||||
|
||||
if (delegation(name, node, &nsttl)) {
|
||||
zonecut = dns_fixedname_name(&fzonecut);
|
||||
dns_name_copy(name, zonecut, NULL);
|
||||
remove_sigs(node, 0);
|
||||
if (generateds)
|
||||
add_ds(name, node, nsttl);
|
||||
}
|
||||
|
||||
result = dns_dbiterator_next(dbiter);
|
||||
nextnode = NULL;
|
||||
while (result == ISC_R_SUCCESS) {
|
||||
@@ -2208,9 +2164,6 @@ nsecify(void) {
|
||||
(zonecut != NULL &&
|
||||
dns_name_issubdomain(nextname, zonecut)))
|
||||
{
|
||||
remove_sigs(nextnode, 0);
|
||||
remove_records(nextnode, dns_rdatatype_nsec,
|
||||
ISC_FALSE);
|
||||
dns_db_detachnode(gdb, &nextnode);
|
||||
result = dns_dbiterator_next(dbiter);
|
||||
continue;
|
||||
@@ -2236,7 +2189,7 @@ nsecify(void) {
|
||||
|
||||
static void
|
||||
addnsec3param(const unsigned char *salt, size_t salt_length,
|
||||
dns_iterations_t iterations)
|
||||
unsigned int iterations)
|
||||
{
|
||||
dns_dbnode_t *node = NULL;
|
||||
dns_rdata_nsec3param_t nsec3param;
|
||||
@@ -2256,7 +2209,7 @@ addnsec3param(const unsigned char *salt, size_t salt_length,
|
||||
nsec3param.flags = 0;
|
||||
nsec3param.hash = unknownalg ? DNS_NSEC3_UNKNOWNALG : dns_hash_sha1;
|
||||
nsec3param.iterations = iterations;
|
||||
nsec3param.salt_length = (unsigned char)salt_length;
|
||||
nsec3param.salt_length = salt_length;
|
||||
DE_CONST(salt, nsec3param.salt);
|
||||
|
||||
isc_buffer_init(&b, nsec3parambuf, sizeof(nsec3parambuf));
|
||||
@@ -2553,7 +2506,7 @@ remove_duplicates(void) {
|
||||
* Generate NSEC3 records for the zone.
|
||||
*/
|
||||
static void
|
||||
nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
||||
nsec3ify(unsigned int hashalg, unsigned int iterations,
|
||||
const unsigned char *salt, size_t salt_length, hashlist_t *hashlist)
|
||||
{
|
||||
dns_dbiterator_t *dbiter = NULL;
|
||||
@@ -2602,7 +2555,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
||||
}
|
||||
|
||||
if (dns_name_equal(name, gorigin))
|
||||
remove_records(node, dns_rdatatype_nsec, ISC_TRUE);
|
||||
remove_records(node, dns_rdatatype_nsec);
|
||||
|
||||
result = dns_dbiterator_next(dbiter);
|
||||
nextnode = NULL;
|
||||
@@ -2619,7 +2572,6 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
||||
if (!dns_name_issubdomain(nextname, gorigin) ||
|
||||
(zonecut != NULL &&
|
||||
dns_name_issubdomain(nextname, zonecut))) {
|
||||
remove_sigs(nextnode, 0);
|
||||
dns_db_detachnode(gdb, &nextnode);
|
||||
result = dns_dbiterator_next(dbiter);
|
||||
continue;
|
||||
@@ -2627,7 +2579,6 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
||||
if (delegation(nextname, nextnode, &nsttl)) {
|
||||
zonecut = dns_fixedname_name(&fzonecut);
|
||||
dns_name_copy(nextname, zonecut, NULL);
|
||||
remove_sigs(nextnode, 0);
|
||||
if (generateds)
|
||||
add_ds(nextname, nextnode, nsttl);
|
||||
if (OPTOUT(nsec3flags) &&
|
||||
@@ -3060,7 +3011,7 @@ set_nsec3params(isc_boolean_t update_chain, isc_boolean_t set_salt,
|
||||
dns_rdata_nsec3_t nsec3;
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *hashname;
|
||||
unsigned char orig_salt[255];
|
||||
unsigned char orig_salt[256];
|
||||
size_t orig_saltlen;
|
||||
dns_hash_t orig_hash;
|
||||
isc_uint16_t orig_iter;
|
||||
@@ -3084,7 +3035,7 @@ set_nsec3params(isc_boolean_t update_chain, isc_boolean_t set_salt,
|
||||
"Use -u to update it.");
|
||||
} else if (!set_salt) {
|
||||
salt_length = orig_saltlen;
|
||||
memmove(saltbuf, orig_salt, orig_saltlen);
|
||||
memcpy(saltbuf, orig_salt, orig_saltlen);
|
||||
salt = saltbuf;
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 4169 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user