Skip to content

Commit 889cdfe

Browse files
committed
session_rpcserver: priv flags only to be set if privacy map active
Error out if an AddAutopilotSession call has privacy map flags specified but does not activate the privacy mapper.
1 parent aa8080d commit 889cdfe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

session_rpcserver.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,11 @@ func (s *sessionRpcServer) AddAutopilotSession(ctx context.Context,
911911
// Determine privacy flags to use for session registration.
912912
var privacyFlags session.PrivacyFlags
913913
if req.PrivacyFlagsSet {
914+
if !privacy {
915+
return nil, fmt.Errorf("privacy flags can only be " +
916+
"set when the privacy mapper is enabled")
917+
}
918+
914919
// We apply privacy flags from the session request in order to
915920
// to be able to set flags resulting from non-standard feature
916921
// configurations.

0 commit comments

Comments
 (0)