Skip to content

Commit c2d3898

Browse files
author
Jason Yellick
committed
[FAB-4373] Fix orderer system channel Admins
The default /Channel/Admins policy requires the MAJORITY of sub Admins policies to be satisfied, for the /Channel/Admins to be satisfied. Usually this means both of /Channel/Orderer/Admins and /Channel/Application/Admins. However, on the ordering system channel, this means both of /Channel/Orderer/Admins and /Channel/Consortiums/Admins. Because the Consortiums group does not have an Admins policy defined, the /Channel/Admins policy can never evaluate to true. This CR defines an Admins policy at the /Channel/Consortiums/Admins level which accepts all signature sets. This causes the /Channel/Admins policy to become equivalent to the /Channel/Orderer/Admins in the ordering system channel case. The /Channel/Consortiums/Admins policy is not used for any other purpose, so the accept all definition has no other implications. Change-Id: Ib8a247743f52d9d4bc5b5c80d8351a91647d3f6c Signed-off-by: Jason Yellick <[email protected]>
1 parent 1cdbfc0 commit c2d3898

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

common/configtx/tool/provisional/provisional.go

+16
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package provisional
1919
import (
2020
"fmt"
2121

22+
"github.com/hyperledger/fabric/common/cauthdsl"
2223
"github.com/hyperledger/fabric/common/config"
2324
configvaluesmsp "github.com/hyperledger/fabric/common/config/msp"
2425
"github.com/hyperledger/fabric/common/configtx"
@@ -31,6 +32,7 @@ import (
3132
cb "github.com/hyperledger/fabric/protos/common"
3233
ab "github.com/hyperledger/fabric/protos/orderer"
3334
pb "github.com/hyperledger/fabric/protos/peer"
35+
"github.com/hyperledger/fabric/protos/utils"
3436
logging "github.com/op/go-logging"
3537
)
3638

@@ -180,6 +182,20 @@ func New(conf *genesisconfig.Profile) Generator {
180182
if conf.Consortiums != nil {
181183
tcg := config.TemplateConsortiumsGroup()
182184
tcg.Groups[config.ConsortiumsGroupKey].ModPolicy = OrdererAdminsPolicy
185+
186+
// Fix for https://jira.hyperledger.org/browse/FAB-4373
187+
// Note, AcceptAllPolicy in this context, does not grant any unrestricted
188+
// access, but allows the /Channel/Admins policy to evaluate to true
189+
// for the ordering system channel while set to MAJORITY with the addition
190+
// to the successful evaluation of the /Channel/Orderer/Admins policy (which
191+
// is not AcceptAll
192+
tcg.Groups[config.ConsortiumsGroupKey].Policies[configvaluesmsp.AdminsPolicyKey] = &cb.ConfigPolicy{
193+
Policy: &cb.Policy{
194+
Type: int32(cb.Policy_SIGNATURE),
195+
Policy: utils.MarshalOrPanic(cauthdsl.AcceptAllPolicy),
196+
},
197+
}
198+
183199
bs.consortiumsGroups = append(bs.consortiumsGroups, tcg)
184200

185201
for consortiumName, consortium := range conf.Consortiums {

0 commit comments

Comments
 (0)