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.
This commit is contained in:
Elle Mouton 2025-02-27 07:23:28 +02:00
parent aa8080da24
commit 889cdfea71
No known key found for this signature in database
GPG key ID: D7D916376026F177

View file

@ -911,6 +911,11 @@ func (s *sessionRpcServer) AddAutopilotSession(ctx context.Context,
// Determine privacy flags to use for session registration.
var privacyFlags session.PrivacyFlags
if req.PrivacyFlagsSet {
if !privacy {
return nil, fmt.Errorf("privacy flags can only be " +
"set when the privacy mapper is enabled")
}
// We apply privacy flags from the session request in order to
// to be able to set flags resulting from non-standard feature
// configurations.