@@ -1083,29 +1083,30 @@ func removeProtectorAction(c *cli.Context) error {
10831083 return err
10841084 }
10851085
1086- // We do not need to unlock anything for this operation
1087- protector , err := getProtectorFromFlag (protectorFlag .Value , nil )
1086+ // We only need the protector descriptor, not the protector itself.
1087+ ctx , protectorDescriptor , err := parseMetadataFlag (protectorFlag .Value , nil )
10881088 if err != nil {
10891089 return newExitError (c , err )
10901090 }
1091- policy , err := getPolicyFromFlag (policyFlag .Value , protector .Context .TargetUser )
1091+ // We don't need to unlock the policy for this operation.
1092+ policy , err := getPolicyFromFlag (policyFlag .Value , ctx .TargetUser )
10921093 if err != nil {
10931094 return newExitError (c , err )
10941095 }
10951096
10961097 prompt := fmt .Sprintf ("Stop protecting policy %s with protector %s?" ,
1097- policy .Descriptor (), protector . Descriptor () )
1098+ policy .Descriptor (), protectorDescriptor )
10981099 warning := "All files using this policy will NO LONGER be accessible with this protector!!"
10991100 if err := askConfirmation (prompt , false , warning ); err != nil {
11001101 return newExitError (c , err )
11011102 }
11021103
1103- if err := policy .RemoveProtector (protector ); err != nil {
1104+ if err := policy .RemoveProtector (protectorDescriptor ); err != nil {
11041105 return newExitError (c , err )
11051106 }
11061107
11071108 fmt .Fprintf (c .App .Writer , "Protector %s no longer protecting policy %s.\n " ,
1108- protector . Descriptor () , policy .Descriptor ())
1109+ protectorDescriptor , policy .Descriptor ())
11091110 return nil
11101111}
11111112
0 commit comments