gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: call chmod on path, not on whole


From: gnunet
Subject: [taler-exchange] branch master updated: call chmod on path, not on whole sock addr
Date: Wed, 04 Aug 2021 20:54:49 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 4baecd48 call chmod on path, not on whole sock addr
4baecd48 is described below

commit 4baecd4856460a73eb2f0090dfbbe4719972f0c9
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Aug 4 20:54:03 2021 +0200

    call chmod on path, not on whole sock addr
---
 debian/changelog               |  6 ++++++
 src/util/crypto_helper_denom.c | 19 ++++++++++++++-----
 src/util/crypto_helper_esign.c |  8 ++++----
 3 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f828b4e6..6d7c2f3d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+taler-exchange (0.9.0-25) unstable; urgency=low
+
+  * Socket permissions
+
+ -- Florian Dold <dold@taler.net>  Wed, 04 Aug 2021 20:54:31 +0200
+
 taler-exchange (0.9.0-24) unstable; urgency=low
 
   * Service dependencies.
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))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]