mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-16 10:51:37 -04:00
Merge pull request #132 from giuseppe/fixes
main.c: reload the directory on stat
This commit is contained in:
commit
3bc0aa6427
4
NEWS
4
NEWS
@ -1,3 +1,7 @@
|
||||
* fuse-overlayfs-0.6.5
|
||||
|
||||
- stat reports correctly the number of links for a directory.
|
||||
|
||||
* fuse-overlayfs-0.6.4
|
||||
|
||||
- do not lose the setuid bit after a write when the writeback cache is used.
|
||||
|
@ -1,5 +1,5 @@
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([fuse-overlayfs], [0.6.4], [giuseppe@scrivano.org])
|
||||
AC_INIT([fuse-overlayfs], [0.6.5], [giuseppe@scrivano.org])
|
||||
AC_CONFIG_SRCDIR([main.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
|
20
main.c
20
main.c
@ -1862,6 +1862,16 @@ ovl_lookup (fuse_req_t req, fuse_ino_t parent, const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
if (node_dirp (node))
|
||||
{
|
||||
node = reload_dir (lo, node);
|
||||
if (node == NULL)
|
||||
{
|
||||
fuse_reply_err (req, errno);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
err = rpl_stat (req, node, -1, NULL, NULL, &e.attr);
|
||||
if (err)
|
||||
{
|
||||
@ -2108,6 +2118,16 @@ ovl_do_readdir (fuse_req_t req, fuse_ino_t ino, size_t size,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node_dirp (node))
|
||||
{
|
||||
node = reload_dir (lo, node);
|
||||
if (node == NULL)
|
||||
{
|
||||
fuse_reply_err (req, errno);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
memset (&e, 0, sizeof (e));
|
||||
ret = rpl_stat (req, node, -1, NULL, NULL, st);
|
||||
if (ret < 0)
|
||||
|
@ -21,6 +21,11 @@ fuse-overlayfs -o sync=0,threaded=1,lowerdir=lower,upperdir=upper,workdir=workdi
|
||||
SUID_TEST=$(pwd)/suid-test
|
||||
(cd merged; $SUID_TEST)
|
||||
|
||||
# Test the number of hard links for populated directories is > 2
|
||||
test $(stat -c %h merged/etc) -gt 2
|
||||
ls merged/usr
|
||||
test $(stat -c %h merged/usr) -gt 2
|
||||
|
||||
stat -c %A upper/suid | grep s
|
||||
stat -c %a upper/nosuid | grep -v s
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user