aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlbr <aaoth@aaoth.xyz>2026-02-08 08:46:46 +0100
committerlbr <aaoth@aaoth.xyz>2026-02-08 08:46:46 +0100
commit63903b9c46ad30e5007b689dc68867ae3aa13a5b (patch)
tree28a8d95af286eca7803789d5348375b4ddd5fb8d
parent1c2e3032e76e55883b4ea0add35ba805e16aa7ea (diff)
data: use lstat() instead of stat()
this disallows snac to serve a static file which is a symlink.
-rw-r--r--data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/data.c b/data.c
index 31eafeb..762d0fd 100644
--- a/data.c
+++ b/data.c
@@ -2668,7 +2668,7 @@ static int _load_raw_file(const char *fn, xs_val **data, int *size,
struct stat sb;
FILE *f;
- if (stat(fn, &sb) == 0 && (sb.st_mode&S_IFMT) == S_IFREG) {
+ if (lstat(fn, &sb) == 0 && (sb.st_mode&S_IFMT) == S_IFREG) {
if ((f = fopen(fn, "rb")) != NULL) {
*size = XS_ALL;
*data = xs_read(f, size);