mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
Divide seat_set_trust_status into query and update.
This complicates the API in one sense (more separate functions), but in another sense, simplifies it (each function does something simpler). When I start putting one Seat in front of another during SSH proxying, the latter will be more important - in particular, it means you can find out _whether_ a seat can support changing trust status without having to actually attempt a destructive modification.
This commit is contained in:
@ -187,7 +187,16 @@ bool is_interactive(void)
|
||||
}
|
||||
|
||||
bool console_antispoof_prompt = true;
|
||||
bool console_set_trust_status(Seat *seat, bool trusted)
|
||||
|
||||
void console_set_trust_status(Seat *seat, bool trusted)
|
||||
{
|
||||
/* Do nothing in response to a change of trust status, because
|
||||
* there's nothing we can do in a console environment. However,
|
||||
* the query function below will make a fiddly decision about
|
||||
* whether to tell the backend to enable fallback handling. */
|
||||
}
|
||||
|
||||
bool console_can_set_trust_status(Seat *seat)
|
||||
{
|
||||
if (console_batch_mode || !is_interactive() || !console_antispoof_prompt) {
|
||||
/*
|
||||
@ -200,8 +209,8 @@ bool console_set_trust_status(Seat *seat, bool trusted)
|
||||
* prompt, the user couldn't respond to it via the terminal
|
||||
* anyway.
|
||||
*
|
||||
* We also vacuously return success if the user has purposely
|
||||
* disabled the antispoof prompt.
|
||||
* We also return true without enabling any defences if the
|
||||
* user has purposely disabled the antispoof prompt.
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user