diff options
author | Florian Dold <florian@dold.me> | 2021-08-04 20:00:31 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-04 20:01:28 +0200 |
commit | 07bcff123f7ee750bb0fc6d0008467f51d7e3b0d (patch) | |
tree | 3648272fc99101ff39a987808323dd063e6cf69c /src/util/crypto_helper_esign.c | |
parent | 99cbc5fbe260b921e8aa47e4c5e6941bf6e49b87 (diff) | |
download | exchange-07bcff123f7ee750bb0fc6d0008467f51d7e3b0d.tar.gz exchange-07bcff123f7ee750bb0fc6d0008467f51d7e3b0d.tar.bz2 exchange-07bcff123f7ee750bb0fc6d0008467f51d7e3b0d.zip |
call chmod on client socket path, not client socket directory
Diffstat (limited to 'src/util/crypto_helper_esign.c')
-rw-r--r-- | src/util/crypto_helper_esign.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/util/crypto_helper_esign.c b/src/util/crypto_helper_esign.c index d5baa9348..1234ba4a5 100644 --- a/src/util/crypto_helper_esign.c +++ b/src/util/crypto_helper_esign.c @@ -143,15 +143,25 @@ try_connect (struct TALER_CRYPTO_ExchangeSignHelper *esh) GNUNET_free (tmpdir); return; } - /* Fix permissions on UNIX domain socket, just - in case umask() is not set to enable group write */ - if (0 != chmod (tmpdir, - S_IRUSR | S_IWUSR | S_IWGRP)) + /* Fix permissions on client UNIX domain socket, + just in case umask() is not set to enable group write */ { - GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, - "chmod", - tmpdir); + char path[sizeof (esh->my_sa) + 1]; + + strncpy (path, + (const char *) &esh->my_sa, + sizeof (esh->my_sa)); + path[sizeof (esh->my_sa)] = '\0'; + + if (0 != chmod (path, + S_IRUSR | S_IWUSR | S_IWGRP)) + { + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, + "chmod", + path); + } } + GNUNET_free (tmpdir); { struct GNUNET_MessageHeader hdr = { |