mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd,tpm2d: Fix for consistent use of socket FD.
* scd/command.c (scd_command_handler): Use gnupg_fd_t for the argument but no INT2FD to listen. Use GNUPG_INVALID_FD. * tpm2d/command.c (tpm2d_command_handler): Likewise. * scd/scdaemon.c (start_connection_thread): Follow the change. * tpm2d/tpm2daemon.c (start_connection_thread): Likewise. * scd/scdaemon.h (scd_command_handler): Use gnupg_fd_t. * tpm2d/tpm2daemon.h (tpm2d_command_handler): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
01ade6945d
commit
f584ad9504
@ -2454,7 +2454,7 @@ register_commands (assuan_context_t ctx)
|
|||||||
server, otherwise it is a regular server. Returns true if there
|
server, otherwise it is a regular server. Returns true if there
|
||||||
are no more active asessions. */
|
are no more active asessions. */
|
||||||
int
|
int
|
||||||
scd_command_handler (ctrl_t ctrl, int fd)
|
scd_command_handler (ctrl_t ctrl, gnupg_fd_t fd)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
assuan_context_t ctx = NULL;
|
assuan_context_t ctx = NULL;
|
||||||
@ -2468,7 +2468,7 @@ scd_command_handler (ctrl_t ctrl, int fd)
|
|||||||
scd_exit (2);
|
scd_exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == GNUPG_INVALID_FD)
|
||||||
{
|
{
|
||||||
assuan_fd_t filedes[2];
|
assuan_fd_t filedes[2];
|
||||||
|
|
||||||
@ -2478,7 +2478,7 @@ scd_command_handler (ctrl_t ctrl, int fd)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = assuan_init_socket_server (ctx, INT2FD(fd),
|
rc = assuan_init_socket_server (ctx, fd,
|
||||||
ASSUAN_SOCKET_SERVER_ACCEPTED);
|
ASSUAN_SOCKET_SERVER_ACCEPTED);
|
||||||
}
|
}
|
||||||
if (rc)
|
if (rc)
|
||||||
|
@ -1199,7 +1199,7 @@ start_connection_thread (void *arg)
|
|||||||
handler asked for it. With the next ticker event and given that
|
handler asked for it. With the next ticker event and given that
|
||||||
no other connections are running the shutdown will then
|
no other connections are running the shutdown will then
|
||||||
happen. */
|
happen. */
|
||||||
if (scd_command_handler (ctrl, FD2INT(ctrl->thread_startup.fd))
|
if (scd_command_handler (ctrl, ctrl->thread_startup.fd)
|
||||||
&& pipe_server)
|
&& pipe_server)
|
||||||
shutdown_pending = 1;
|
shutdown_pending = 1;
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ const char *scd_get_socket_name (void);
|
|||||||
|
|
||||||
/*-- command.c --*/
|
/*-- command.c --*/
|
||||||
gpg_error_t initialize_module_command (void);
|
gpg_error_t initialize_module_command (void);
|
||||||
int scd_command_handler (ctrl_t, int);
|
int scd_command_handler (ctrl_t, gnupg_fd_t);
|
||||||
void send_status_info (ctrl_t ctrl, const char *keyword, ...)
|
void send_status_info (ctrl_t ctrl, const char *keyword, ...)
|
||||||
GPGRT_ATTR_SENTINEL(1);
|
GPGRT_ATTR_SENTINEL(1);
|
||||||
gpg_error_t send_status_direct (ctrl_t ctrl,
|
gpg_error_t send_status_direct (ctrl_t ctrl,
|
||||||
|
@ -403,7 +403,7 @@ register_commands (assuan_context_t ctx)
|
|||||||
server, otherwise it is a regular server. Returns true if there
|
server, otherwise it is a regular server. Returns true if there
|
||||||
are no more active asessions. */
|
are no more active asessions. */
|
||||||
int
|
int
|
||||||
tpm2d_command_handler (ctrl_t ctrl, int fd)
|
tpm2d_command_handler (ctrl_t ctrl, gnupg_fd_t fd)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
assuan_context_t ctx = NULL;
|
assuan_context_t ctx = NULL;
|
||||||
@ -417,7 +417,7 @@ tpm2d_command_handler (ctrl_t ctrl, int fd)
|
|||||||
tpm2d_exit (2);
|
tpm2d_exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == GNUPG_INVALID_FD)
|
||||||
{
|
{
|
||||||
assuan_fd_t filedes[2];
|
assuan_fd_t filedes[2];
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ tpm2d_command_handler (ctrl_t ctrl, int fd)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = assuan_init_socket_server (ctx, INT2FD (fd),
|
rc = assuan_init_socket_server (ctx, fd,
|
||||||
ASSUAN_SOCKET_SERVER_ACCEPTED);
|
ASSUAN_SOCKET_SERVER_ACCEPTED);
|
||||||
}
|
}
|
||||||
if (rc)
|
if (rc)
|
||||||
|
@ -1029,7 +1029,7 @@ start_connection_thread (void *arg)
|
|||||||
handler asked for it. With the next ticker event and given that
|
handler asked for it. With the next ticker event and given that
|
||||||
no other connections are running the shutdown will then
|
no other connections are running the shutdown will then
|
||||||
happen. */
|
happen. */
|
||||||
if (tpm2d_command_handler (ctrl, FD2INT (ctrl->thread_startup.fd))
|
if (tpm2d_command_handler (ctrl, ctrl->thread_startup.fd)
|
||||||
&& pipe_server)
|
&& pipe_server)
|
||||||
shutdown_pending = 1;
|
shutdown_pending = 1;
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void tpm2d_exit (int rc);
|
|||||||
|
|
||||||
/*-- command.c --*/
|
/*-- command.c --*/
|
||||||
gpg_error_t initialize_module_command (void);
|
gpg_error_t initialize_module_command (void);
|
||||||
int tpm2d_command_handler (ctrl_t, int);
|
int tpm2d_command_handler (ctrl_t, gnupg_fd_t);
|
||||||
void send_client_notifications (app_t app, int removal);
|
void send_client_notifications (app_t app, int removal);
|
||||||
void tpm2d_kick_the_loop (void);
|
void tpm2d_kick_the_loop (void);
|
||||||
int get_active_connection_count (void);
|
int get_active_connection_count (void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user