From: "Mike Gilbert" <floppym@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sandbox:master commit in: tests/, libsandbox/
Date: Tue, 13 Jun 2023 17:34:24 +0000 (UTC) [thread overview]
Message-ID: <1686585604.cdc89a00ac0bc3170d4ca7bfc77bc2572ce076b0.floppym@gentoo> (raw)
commit: cdc89a00ac0bc3170d4ca7bfc77bc2572ce076b0
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 12 14:58:39 2023 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jun 12 16:00:04 2023 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=cdc89a00
libsandbox: add lutimes to symlink_func
lutimes operates on symlinks, so we should not check for access against
the symlink target.
Bug: https://bugs.gentoo.org/908105
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
libsandbox/libsandbox.c | 1 +
tests/lutimes-1.sh | 9 +++++++++
tests/lutimes.at | 1 +
3 files changed, 11 insertions(+)
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
index 0ca2bc9..b9ef52e 100644
--- a/libsandbox/libsandbox.c
+++ b/libsandbox/libsandbox.c
@@ -679,6 +679,7 @@ static bool symlink_func(int sb_nr, int flags)
sb_nr == SB_NR_LCHOWN ||
sb_nr == SB_NR_LREMOVEXATTR ||
sb_nr == SB_NR_LSETXATTR ||
+ sb_nr == SB_NR_LUTIMES ||
sb_nr == SB_NR_REMOVE ||
sb_nr == SB_NR_RENAME ||
sb_nr == SB_NR_RENAMEAT ||
diff --git a/tests/lutimes-1.sh b/tests/lutimes-1.sh
new file mode 100755
index 0000000..8638bb2
--- /dev/null
+++ b/tests/lutimes-1.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+addwrite "${PWD}"
+
+sym="lutimes-1.sym"
+ln -s /bad/path "${sym}"
+
+lutimes-0 0 "${sym}" NULL || exit 1
+lutimes-0 -1,EACCES /bin/sh NULL || exit 1
diff --git a/tests/lutimes.at b/tests/lutimes.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/lutimes.at
@@ -0,0 +1 @@
+SB_CHECK(1)
next reply other threads:[~2023-06-13 17:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 17:34 Mike Gilbert [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-22 3:49 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, tests/ Mike Gilbert
2025-01-14 4:38 ` [gentoo-commits] proj/sandbox:master commit in: tests/, libsandbox/ Mike Gilbert
2024-12-22 3:41 Mike Gilbert
2024-06-27 15:25 Mike Gilbert
2015-09-28 20:17 Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1686585604.cdc89a00ac0bc3170d4ca7bfc77bc2572ce076b0.floppym@gentoo \
--to=floppym@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox