patacongo opened a new pull request #1554:
URL: https://github.com/apache/incubator-nuttx/pull/1554
## Summary
This will resolve numerous problems with the way that hard links, in
particular "." and ".." are handled. Instead of trying to fudge the stat
flags, the correct implementation is to follow the hard link to the final link
target node. That is what must determine the attributes of the directory entry.
See Issue #1540
## Impact
Affects the CROMFS file system.
## Testing
Tested using sim:nshcromfs
Current state:
NuttShell (NSH) NuttX-9.1.0
nsh> mount -t cromfs stuff
nsh> ls -Rl stuff
/stuff:
dr-xr-xr-x 0 .
-r-xr--r-- 171 BaaBaaBlackSheep.txt
-r-xr--r-- 118 JackSprat.txt
dr-xr-xr-x 0 testdir1/
dr-xr-xr-x 0 testdir2/
dr-xr-xr-x 0 testdir3/
/stuff/testdir1:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr--r-- 248 DingDongDell.txt
-r-xr--r-- 247 SeeSawMargorieDaw.txt
/stuff/testdir2:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr--r-- 118 HickoryDickoryDock.txt
-r-xr--r-- 2082 TheThreeLittlePigs.txt
/stuff/testdir3:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr--r-- 137 JackBeNimble.txt
nsh> ls -l stuff/testdir3
/stuff/testdir3:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr--r-- 137 JackBeNimble.txt
nsh> ls -l stuff/testdir3/.
/stuff/testdir3/.:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr--r-- 137 JackBeNimble.txt
nsh> ls -l stuff/testdir3/..
/stuff/testdir3/..:
dr-xr-xr-x 0 .
-r-xr--r-- 171 BaaBaaBlackSheep.txt
-r-xr--r-- 118 JackSprat.txt
dr-xr-xr-x 0 testdir1/
dr-xr-xr-x 0 testdir2/
dr-xr-xr-x 0 testdir3/
nsh> ls -l stuff/testdir3/../.
/stuff/testdir3/../.:
dr-xr-xr-x 0 .
-r-xr--r-- 171 BaaBaaBlackSheep.txt
-r-xr--r-- 118 JackSprat.txt
dr-xr-xr-x 0 testdir1/
dr-xr-xr-x 0 testdir2/
dr-xr-xr-x 0 testdir3/
nsh> ls -l stuff/testdir1/../testdir3/.
/stuff/testdir1/../testdir3/.:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr--r-- 137 JackBeNimble.txt
nsh>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]