diff options
author | Florian Dold <florian@dold.me> | 2021-08-04 20:54:03 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-04 20:54:45 +0200 |
commit | 4baecd4856460a73eb2f0090dfbbe4719972f0c9 (patch) | |
tree | 591e8ee6d2e0ca9501ec5a5191043eda45b58932 /src/util/crypto_helper_denom.c | |
parent | 21f3412ac7347e1252a4bbf228d81b4b5753c6cc (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.c | 19 |
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); |