When mounting a Windows local drive in DosBox-X, a DIR should display the same items you'd find with the Windows CMD prompt.
In fact, this does not happen.
Consider the following:
MOUNT C C:\
DIR /A C:\
DIR /A C:\Windows\Sys*
You'll find that the first DIR invocation omits directories like "Config.msi", "Recovery", "System Volume Information"; the second, directories like "System32", "SystemApps", "SyetemResources", "SystemTemp", "SysWOW64".
Having reviewed the sources, this seems related to the ht_temp call (wstat64) returning -1 instead of 0 with such directories.
In fact, those are directories with special NTFS access rights.
An Administrator user surely can call wstat successfully on them, but normal users can typically list them without invoking special privileges (i.e. with Explorer, or CMD itself).
Steps to reproduce the behaviour
See above.
Expected behavior
See above.
What operating system(s) this bug have occurred on?
Windows 11 x64 22H2
What version(s) of DOSBox-X have this bug?
latest commit
Used configuration
Vanilla
Output log
-
Additional information
My first attempt with AdjustTokenPrivileges WIN32 API didn't succeed, something was changed with privilege handling by normal users.
Have you checked that no similar bug report(s) exist?
[X] I have searched and didn't find any similar bug report.
Code of Conduct & Contributing Guidelines
[X] I agree to follow the code of conduct and the contributing guidelines.
Describe the bug
When mounting a Windows local drive in DosBox-X, a
DIR
should display the same items you'd find with the Windows CMD prompt. In fact, this does not happen.Consider the following:
You'll find that the first
DIR
invocation omits directories like "Config.msi", "Recovery", "System Volume Information"; the second, directories like "System32", "SystemApps", "SyetemResources", "SystemTemp", "SysWOW64".Having reviewed the sources, this seems related to the ht_temp call (wstat64) returning -1 instead of 0 with such directories.
In fact, those are directories with special NTFS access rights.
An Administrator user surely can call wstat successfully on them, but normal users can typically list them without invoking special privileges (i.e. with Explorer, or CMD itself).
Steps to reproduce the behaviour
See above.
Expected behavior
See above.
What operating system(s) this bug have occurred on?
Windows 11 x64 22H2
What version(s) of DOSBox-X have this bug?
latest commit
Used configuration
Output log
Additional information
My first attempt with AdjustTokenPrivileges WIN32 API didn't succeed, something was changed with privilege handling by normal users.
Have you checked that no similar bug report(s) exist?
Code of Conduct & Contributing Guidelines