Repository navigation
fs/fat: Report execute permission for files and directories. - #20754
Merged
Merged
Conversation
FAT has no execute permission. fat_stat() and fat_fstat() reported r--r--r-- or rw-rw-rw- for every file and directory, also for the root directory. So a program on a FAT volume had no execute bit, and no directory had the search bit. Report the execute bit for all files and directories, in the same way as the read bit. Other systems mount FAT with these bits by default. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
FAT now reports execute permission for files and directories, so the "ls -l" examples of FAT volumes in the NSH command page show rwx. Update the examples. Devices do not change. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
xiaoxiang781216
approved these changes
Oct 18, 2026
acassis
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FAT has no execute permission.
fat_stat()andfat_fstat()reportedr--r--r--orrw-rw-rw-for every file and directory, also for the root directory. So a program on a FAT volume had no execute bit, and no directory had the search bit.This PR reports the execute bit for all files and directories, in the same way as the read bit. Other systems mount FAT with these bits by default.
The second commit updates the
ls -lexamples of FAT volumes inDocumentation/applications/nsh/commands.rst.Impact
Only the mode that
stat()reports changes. WithCONFIG_SCHED_USER_IDENTITY,exec()checks the execute bit, so with this PR a program on a FAT volume can run instead of failing withEACCES.Testing
A test on
qemu-armv8a:nsh(QEMU 11 with HVF on an Apple M4) with FAT,mkfatfs,mkrdandCONFIG_PSEUDOFS_FILE: a FAT RAM disk with a file and a directory, a pseudo file, thenls -lof/fat,/,/procand the pseudo file, on master and with this PR.-rw-rw-rw--rwxrwxrwxdrw-rw-rw-drwxrwxrwxtools/checkpatch.sh -c -u -m -gpasses.