summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-04 20:54:03 +0200
committerFlorian Dold <florian@dold.me>2021-08-04 20:54:45 +0200
commit4baecd4856460a73eb2f0090dfbbe4719972f0c9 (patch)
tree591e8ee6d2e0ca9501ec5a5191043eda45b58932 /src
parent21f3412ac7347e1252a4bbf228d81b4b5753c6cc (diff)
downloadexchange-4baecd4856460a73eb2f0090dfbbe4719972f0c9.tar.gz
exchange-4baecd4856460a73eb2f0090dfbbe4719972f0c9.tar.bz2
exchange-4baecd4856460a73eb2f0090dfbbe4719972f0c9.zip
call chmod on path, not on whole sock addr
Diffstat (limited to 'src')
-rw-r--r--src/util/crypto_helper_denom.c19
-rw-r--r--src/util/crypto_helper_esign.c8
2 files changed, 18 insertions, 9 deletions
diff --git a/src/util/crypto_helper_denom.c b/src/util/crypto_helper_denom.c
index 243dd296..f154bd3e 100644
--- a/src/util/crypto_helper_denom.c
+++ b/src/util/crypto_helper_denom.c
@@ -152,12 +152,21 @@ try_connect (struct TALER_CRYPTO_DenominationHelper *dh)
sizeof (dh->my_sa));
path[sizeof (dh->my_sa)] = '\0';
- if (0 != chmod (path,
- S_IRUSR | S_IWUSR | S_IWGRP))
{
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
- "chmod",
- path);
+ char path[sizeof (dh->sa.sun_path) + 1];
+
+ strncpy (path,
+ dh->my_sa.sun_path,
+ sizeof (dh->my_sa.sun_path));
+ path[sizeof (dh->my_sa.sun_path)] = '\0';
+
+ if (0 != chmod (path,
+ S_IRUSR | S_IWUSR | S_IWGRP))
+ {
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
+ "chmod",
+ path);
+ }
}
}
GNUNET_free (tmpdir);
diff --git a/src/util/crypto_helper_esign.c b/src/util/crypto_helper_esign.c
index 1234ba4a..2c51187d 100644
--- a/src/util/crypto_helper_esign.c
+++ b/src/util/crypto_helper_esign.c
@@ -146,12 +146,12 @@ try_connect (struct TALER_CRYPTO_ExchangeSignHelper *esh)
/* Fix permissions on client UNIX domain socket,
just in case umask() is not set to enable group write */
{
- char path[sizeof (esh->my_sa) + 1];
+ char path[sizeof (esh->sa.sun_path) + 1];
strncpy (path,
- (const char *) &esh->my_sa,
- sizeof (esh->my_sa));
- path[sizeof (esh->my_sa)] = '\0';
+ esh->my_sa.sun_path,
+ sizeof (esh->my_sa.sun_path));
+ path[sizeof (esh->my_sa.sun_path)] = '\0';
if (0 != chmod (path,
S_IRUSR | S_IWUSR | S_IWGRP))