call chmod on path, not on whole sock addr
This commit is contained in:
parent
21f3412ac7
commit
4baecd4856
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -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
|
taler-exchange (0.9.0-24) unstable; urgency=low
|
||||||
|
|
||||||
* Service dependencies.
|
* Service dependencies.
|
||||||
|
@ -152,12 +152,21 @@ try_connect (struct TALER_CRYPTO_DenominationHelper *dh)
|
|||||||
sizeof (dh->my_sa));
|
sizeof (dh->my_sa));
|
||||||
path[sizeof (dh->my_sa)] = '\0';
|
path[sizeof (dh->my_sa)] = '\0';
|
||||||
|
|
||||||
if (0 != chmod (path,
|
|
||||||
S_IRUSR | S_IWUSR | S_IWGRP))
|
|
||||||
{
|
{
|
||||||
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
char path[sizeof (dh->sa.sun_path) + 1];
|
||||||
"chmod",
|
|
||||||
path);
|
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);
|
GNUNET_free (tmpdir);
|
||||||
|
@ -146,12 +146,12 @@ try_connect (struct TALER_CRYPTO_ExchangeSignHelper *esh)
|
|||||||
/* Fix permissions on client UNIX domain socket,
|
/* Fix permissions on client UNIX domain socket,
|
||||||
just in case umask() is not set to enable group write */
|
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,
|
strncpy (path,
|
||||||
(const char *) &esh->my_sa,
|
esh->my_sa.sun_path,
|
||||||
sizeof (esh->my_sa));
|
sizeof (esh->my_sa.sun_path));
|
||||||
path[sizeof (esh->my_sa)] = '\0';
|
path[sizeof (esh->my_sa.sun_path)] = '\0';
|
||||||
|
|
||||||
if (0 != chmod (path,
|
if (0 != chmod (path,
|
||||||
S_IRUSR | S_IWUSR | S_IWGRP))
|
S_IRUSR | S_IWUSR | S_IWGRP))
|
||||||
|
Loading…
Reference in New Issue
Block a user