mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
agent/
* command-ssh.c (stream_read_string): Initialize LENGTH to zero. (start_command_handler_ssh): Use es_fgetc/es_ungetc to check if EOF has been reached before trying to process another request.
This commit is contained in:
parent
b861561e47
commit
cde3f5e61f
@ -1,5 +1,13 @@
|
|||||||
|
2007-01-31 Moritz Schulte <moritz@g10code.com> (wk)
|
||||||
|
|
||||||
|
* command-ssh.c (stream_read_string): Initialize LENGTH to zero.
|
||||||
|
(start_command_handler_ssh): Use es_fgetc/es_ungetc to check if
|
||||||
|
EOF has been reached before trying to process another request.
|
||||||
|
|
||||||
2007-01-31 Werner Koch <wk@g10code.com>
|
2007-01-31 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* command-ssh.c (start_command_handler_ssh):
|
||||||
|
|
||||||
* Makefile.am (t_common_ldadd): Add LIBICONV.
|
* Makefile.am (t_common_ldadd): Add LIBICONV.
|
||||||
|
|
||||||
2007-01-25 Werner Koch <wk@g10code.com>
|
2007-01-25 Werner Koch <wk@g10code.com>
|
||||||
|
@ -421,10 +421,8 @@ stream_read_string (estream_t stream, unsigned int secure,
|
|||||||
unsigned char **string, u32 *string_size)
|
unsigned char **string, u32 *string_size)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
unsigned char *buffer;
|
unsigned char *buffer = NULL;
|
||||||
u32 length;
|
u32 length = 0;
|
||||||
|
|
||||||
buffer = NULL;
|
|
||||||
|
|
||||||
/* Read string length. */
|
/* Read string length. */
|
||||||
err = stream_read_uint32 (stream, &length);
|
err = stream_read_uint32 (stream, &length);
|
||||||
@ -796,7 +794,7 @@ add_control_entry (ctrl_t ctrl, const char *hexgrip, int ttl)
|
|||||||
struct tm *tp;
|
struct tm *tp;
|
||||||
time_t atime = time (NULL);
|
time_t atime = time (NULL);
|
||||||
|
|
||||||
/* Not yet in the file - add it. Becuase the file has been
|
/* Not yet in the file - add it. Because the file has been
|
||||||
opened in append mode, we simply need to write to it. */
|
opened in append mode, we simply need to write to it. */
|
||||||
tp = localtime (&atime);
|
tp = localtime (&atime);
|
||||||
fprintf (fp, "# Key added on %04d-%02d-%02d %02d:%02d:%02d\n%s %d\n",
|
fprintf (fp, "# Key added on %04d-%02d-%02d %02d:%02d:%02d\n%s %d\n",
|
||||||
@ -2646,7 +2644,8 @@ request_spec_lookup (int type)
|
|||||||
break;
|
break;
|
||||||
if (i == DIM (request_specs))
|
if (i == DIM (request_specs))
|
||||||
{
|
{
|
||||||
log_info ("ssh request %u is not supported\n", type);
|
if (opt.verbose)
|
||||||
|
log_info ("ssh request %u is not supported\n", type);
|
||||||
spec = NULL;
|
spec = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2867,7 +2866,16 @@ start_command_handler_ssh (ctrl_t ctrl, int sock_client)
|
|||||||
|
|
||||||
/* Main processing loop. */
|
/* Main processing loop. */
|
||||||
while ( !ssh_request_process (ctrl, stream_sock) )
|
while ( !ssh_request_process (ctrl, stream_sock) )
|
||||||
;
|
{
|
||||||
|
/* Check wether we have reached EOF before trying to read
|
||||||
|
another request. */
|
||||||
|
int c;
|
||||||
|
|
||||||
|
c = es_fgetc (stream_sock);
|
||||||
|
if (c == EOF)
|
||||||
|
break;
|
||||||
|
es_ungetc (c, stream_sock);
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset the SCD in case it has been used. */
|
/* Reset the SCD in case it has been used. */
|
||||||
agent_reset_scd (ctrl);
|
agent_reset_scd (ctrl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user