summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2022-07-28 11:15:11 +0000
committerLaurent Bercot <ska@appnovation.com>2022-07-28 11:15:11 +0000
commita819ad514ecd12d93a93681c44835b2fbed8c3fc (patch)
tree705f9724887b631e7e75d24c974097f1f349034f
parentb79282b3746ff67c3c0df8aa32814b3688b91d4f (diff)
downloads6-rc-a819ad514ecd12d93a93681c44835b2fbed8c3fc.tar.xz
Allow opening the db on chattr +i
This is done by ignoring EPERM on open() just like we ignore EROFS. Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/libs6rc/s6rc_lock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs6rc/s6rc_lock.c b/src/libs6rc/s6rc_lock.c
index 9daaa34..912c640 100644
--- a/src/libs6rc/s6rc_lock.c
+++ b/src/libs6rc/s6rc_lock.c
@@ -34,7 +34,7 @@ int s6rc_lock (char const *live, int lwhat, int *llfd, char const *compiled, int
memcpy(cfn + clen, "/lock", 6) ;
cfd = open(cfn, O_RDWR | O_CREAT | O_TRUNC | O_NONBLOCK | O_CLOEXEC, 0644) ;
if (cfd < 0)
- if (cwhat > 1 || errno != EROFS) goto lerr ;
+ if (cwhat > 1 || (errno != EROFS || errno != EPERM)) goto lerr ;
else cfd = -errno ;
else
{