agent: Fix homedir check wrt --disable-check-own-socket option.

* agent/gpg-agent.c (handle_connections): Don't disable use of inotify
when it has the --disable-check-own-socket option.

--

Before the fix, it checks the homedir using the gnupg_stat function
when --disable-check-own-socket is enabled, without trying use of
inotify.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-12-20 16:13:49 +09:00
parent 4e94b004a6
commit 4dd4e9d2f1
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
1 changed files with 3 additions and 5 deletions

View File

@ -345,7 +345,7 @@ static struct debug_flags_s debug_flags [] =
* in standard socket mode. If that value is 0 we don't check at all.
* Values is in seconds. */
#define CHECK_OWN_SOCKET_INTERVAL (60)
/* CHECK_PROBLEMS_INTERFAL defines how often we check the existence of
/* CHECK_PROBLEMS_INTERVAL defines how often we check the existence of
* parent process and homedir. Value is in seconds. */
#define CHECK_PROBLEMS_INTERVAL (4)
@ -3042,10 +3042,8 @@ handle_connections (gnupg_fd_t listen_fd,
gpg_strerror (err));
}
if (disable_check_own_socket)
home_inotify_fd = -1;
else if ((err = gnupg_inotify_watch_delete_self (&home_inotify_fd,
gnupg_homedir ())))
if ((err = gnupg_inotify_watch_delete_self (&home_inotify_fd,
gnupg_homedir ())))
{
if (gpg_err_code (err) != GPG_ERR_NOT_SUPPORTED)
log_info ("error enabling daemon termination by homedir removal: %s\n",