mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-25 23:05:21 +02:00
upstream: Use time_t for x11 timeout.
Use time_t instead of u_int for remaining x11 timeout checks for 64bit time_t safety. From Coverity CIDs 405197 and 405028, ok djm@ OpenBSD-Commit-ID: 356685bfa1fc3d81bd95722d3fc47101cc1a4972
This commit is contained in:
parent
4a3918f51b
commit
6c165c3624
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: channels.c,v 1.427 2023/01/18 02:00:10 djm Exp $ */
|
/* $OpenBSD: channels.c,v 1.428 2023/03/04 03:22:59 dtucker Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -198,7 +198,7 @@ struct ssh_channels {
|
|||||||
u_int x11_saved_data_len;
|
u_int x11_saved_data_len;
|
||||||
|
|
||||||
/* Deadline after which all X11 connections are refused */
|
/* Deadline after which all X11 connections are refused */
|
||||||
u_int x11_refuse_time;
|
time_t x11_refuse_time;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fake X11 authentication data. This is what the server will be
|
* Fake X11 authentication data. This is what the server will be
|
||||||
@ -1258,7 +1258,7 @@ x11_open_helper(struct ssh *ssh, struct sshbuf *b)
|
|||||||
|
|
||||||
/* Is this being called after the refusal deadline? */
|
/* Is this being called after the refusal deadline? */
|
||||||
if (sc->x11_refuse_time != 0 &&
|
if (sc->x11_refuse_time != 0 &&
|
||||||
(u_int)monotime() >= sc->x11_refuse_time) {
|
monotime() >= sc->x11_refuse_time) {
|
||||||
verbose("Rejected X11 connection after ForwardX11Timeout "
|
verbose("Rejected X11 connection after ForwardX11Timeout "
|
||||||
"expired");
|
"expired");
|
||||||
return -1;
|
return -1;
|
||||||
@ -1879,7 +1879,7 @@ port_open_helper(struct ssh *ssh, Channel *c, char *rtype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
channel_set_x11_refuse_time(struct ssh *ssh, u_int refuse_time)
|
channel_set_x11_refuse_time(struct ssh *ssh, time_t refuse_time)
|
||||||
{
|
{
|
||||||
ssh->chanctxt->x11_refuse_time = refuse_time;
|
ssh->chanctxt->x11_refuse_time = refuse_time;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: channels.h,v 1.148 2023/01/18 02:00:10 djm Exp $ */
|
/* $OpenBSD: channels.h,v 1.149 2023/03/04 03:22:59 dtucker Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
@ -375,7 +375,7 @@ int permitopen_port(const char *);
|
|||||||
|
|
||||||
/* x11 forwarding */
|
/* x11 forwarding */
|
||||||
|
|
||||||
void channel_set_x11_refuse_time(struct ssh *, u_int);
|
void channel_set_x11_refuse_time(struct ssh *, time_t);
|
||||||
int x11_connect_display(struct ssh *);
|
int x11_connect_display(struct ssh *);
|
||||||
int x11_create_display_inet(struct ssh *, int, int, int, u_int *, int **);
|
int x11_create_display_inet(struct ssh *, int, int, int, u_int *, int **);
|
||||||
void x11_request_forwarding_with_spoofing(struct ssh *, int,
|
void x11_request_forwarding_with_spoofing(struct ssh *, int,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user