Use exact mask when calling umask(2)
Due to the previous negation the high bits of the mask were set, which at least some versions of the Android build system prevent with a compile-time check.
This commit is contained in:
@@ -121,7 +121,7 @@ ha_ctl_t *ha_ctl_create(ha_segments_t *segments, ha_cache_t *cache)
|
|||||||
|
|
||||||
if (access(HA_FIFO, R_OK|W_OK) != 0)
|
if (access(HA_FIFO, R_OK|W_OK) != 0)
|
||||||
{
|
{
|
||||||
old = umask(~(S_IRWXU | S_IRWXG));
|
old = umask(S_IRWXO);
|
||||||
if (mkfifo(HA_FIFO, S_IRUSR | S_IWUSR) != 0)
|
if (mkfifo(HA_FIFO, S_IRUSR | S_IWUSR) != 0)
|
||||||
{
|
{
|
||||||
DBG1(DBG_CFG, "creating HA FIFO %s failed: %s",
|
DBG1(DBG_CFG, "creating HA FIFO %s failed: %s",
|
||||||
|
|||||||
@@ -767,7 +767,7 @@ plugin_t *smp_plugin_create()
|
|||||||
}
|
}
|
||||||
|
|
||||||
unlink(unix_addr.sun_path);
|
unlink(unix_addr.sun_path);
|
||||||
old = umask(~(S_IRWXU | S_IRWXG));
|
old = umask(S_IRWXO);
|
||||||
if (bind(this->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)) < 0)
|
if (bind(this->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)) < 0)
|
||||||
{
|
{
|
||||||
DBG1(DBG_CFG, "could not bind XML socket: %s", strerror(errno));
|
DBG1(DBG_CFG, "could not bind XML socket: %s", strerror(errno));
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ stream_service_t *stream_service_create_unix(char *uri, int backlog)
|
|||||||
}
|
}
|
||||||
unlink(addr.sun_path);
|
unlink(addr.sun_path);
|
||||||
|
|
||||||
old = umask(~(S_IRWXU | S_IRWXG));
|
old = umask(S_IRWXO);
|
||||||
if (bind(fd, (struct sockaddr*)&addr, len) < 0)
|
if (bind(fd, (struct sockaddr*)&addr, len) < 0)
|
||||||
{
|
{
|
||||||
DBG1(DBG_NET, "binding socket '%s' failed: %s", uri, strerror(errno));
|
DBG1(DBG_NET, "binding socket '%s' failed: %s", uri, strerror(errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user