mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-26 19:41:04 -05:00
Move private_type_record() to conf.sh.common
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.
(cherry picked from commit c92128eada)
This commit is contained in:
parent
efb92dd98c
commit
d02002321c
5 changed files with 16 additions and 42 deletions
|
|
@ -410,6 +410,22 @@ keyfile_to_key_id() {
|
|||
echo "$1" | sed "s/.*+0\{0,4\}//"
|
||||
}
|
||||
|
||||
# private_type_record: write a private type record recording the state of the
|
||||
# signing process
|
||||
#
|
||||
# For a given zone ($1), algorithm number ($2) and key file ($3), print the
|
||||
# private type record with default type value of 65534, indicating that the
|
||||
# signing process for this key is completed.
|
||||
private_type_record() {
|
||||
_zone=$1
|
||||
_algorithm=$2
|
||||
_keyfile=$3
|
||||
|
||||
_id=$(keyfile_to_key_id "$_keyfile")
|
||||
|
||||
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
|
||||
}
|
||||
|
||||
# nextpart*() - functions for reading files incrementally
|
||||
#
|
||||
# These functions aim to facilitate looking for (or waiting for)
|
||||
|
|
|
|||
|
|
@ -22,16 +22,6 @@ setup() {
|
|||
echo "$zone" >> zones
|
||||
}
|
||||
|
||||
private_type_record() {
|
||||
_zone=$1
|
||||
_algorithm=$2
|
||||
_keyfile=$3
|
||||
|
||||
_id=$(keyfile_to_key_id "$_keyfile")
|
||||
|
||||
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
|
||||
}
|
||||
|
||||
# Set in the key state files the Predecessor/Successor fields.
|
||||
# Key $1 is the predecessor of key $2.
|
||||
key_successor() {
|
||||
|
|
|
|||
|
|
@ -21,17 +21,6 @@ setup() {
|
|||
infile="${zone}.db.infile"
|
||||
}
|
||||
|
||||
private_type_record() {
|
||||
_zone=$1
|
||||
_algorithm=$2
|
||||
_keyfile=$3
|
||||
|
||||
_id=$(keyfile_to_key_id "$_keyfile")
|
||||
|
||||
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
|
||||
}
|
||||
|
||||
|
||||
# Make lines shorter by storing key states in environment variables.
|
||||
H="HIDDEN"
|
||||
R="RUMOURED"
|
||||
|
|
|
|||
|
|
@ -21,17 +21,6 @@ setup() {
|
|||
infile="${zone}.db.infile"
|
||||
}
|
||||
|
||||
private_type_record() {
|
||||
_zone=$1
|
||||
_algorithm=$2
|
||||
_keyfile=$3
|
||||
|
||||
_id=$(keyfile_to_key_id "$_keyfile")
|
||||
|
||||
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
|
||||
}
|
||||
|
||||
|
||||
# Make lines shorter by storing key states in environment variables.
|
||||
H="HIDDEN"
|
||||
R="RUMOURED"
|
||||
|
|
|
|||
|
|
@ -14,16 +14,6 @@
|
|||
|
||||
echo_i "ns4/setup.sh"
|
||||
|
||||
private_type_record() {
|
||||
_zone=$1
|
||||
_algorithm=$2
|
||||
_keyfile=$3
|
||||
|
||||
_id=$(keyfile_to_key_id "$_keyfile")
|
||||
|
||||
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
|
||||
}
|
||||
|
||||
# Make lines shorter by storing key states in environment variables.
|
||||
H="HIDDEN"
|
||||
R="RUMOURED"
|
||||
|
|
|
|||
Loading…
Reference in a new issue