aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_helper_denom.c
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/util/crypto_helper_denom.c
parent21f3412ac7347e1252a4bbf228d81b4b5753c6cc (diff)
call chmod on path, not on whole sock addr
Diffstat (limited to 'src/util/crypto_helper_denom.c')
-rw-r--r--src/util/crypto_helper_denom.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/util/crypto_helper_denom.c b/src/util/crypto_helper_denom.c
index 243dd2963..f154bd3e0 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);