diff options
author | Ron Yorston <rmy@pobox.com> | 2021-07-25 10:52:55 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-07-25 10:52:55 +0100 |
commit | 15fcbd19c84df418017880af7514ea5cc64ba39d (patch) | |
tree | 64b39edb02854f582d529835a4aa50e5048015c2 /libbb | |
parent | bc8ebe551a2407b5e29c7f98bee4b470c1093947 (diff) | |
download | busybox-w32-15fcbd19c84df418017880af7514ea5cc64ba39d.tar.gz busybox-w32-15fcbd19c84df418017880af7514ea5cc64ba39d.tar.bz2 busybox-w32-15fcbd19c84df418017880af7514ea5cc64ba39d.zip |
win32: special case for devices files in stat(2)
The diff applet calls stat(2) on the files it's asked to process.
This includes /dev/null when the -N flag is used and /dev/fd/*
files when process substitution is used.
Treat device files as a special case in get_file_attr(), returning
a fake set of attributes with FILE_ATTRIBUTE_DEVICE set. This
value is unused elsewhere in busybox-w32. Ensure it's unset in
other cases.
When FILE_ATTRIBUTE_DEVICE is set:
- adjust some permissions;
- avoid calling has_exec_format() as this opens/closes the file
which breaks process substitution.
These changes improve the behaviour of diff but they also have other
effects. For example, the stat and ls applets now report details of
device files. There may be unintended consequences.
Diffstat (limited to 'libbb')
0 files changed, 0 insertions, 0 deletions