4 ms·
Are ADS used for anything useful anywhere? It is kinda interesting how long MS has been carrying that feature around, especially as it is not really highly adve
by zokier 8y ago
Are ADS used for anything useful anywhere? It is kinda interesting how long MS has been carrying that feature around, especially as it is not really highly advertised feature; is it really even supported? ADS does constantly pop up in these sorts of (semi-)malicious contexts, simply dropping them seems like sensible thing.
- MikusR 8y agoAll the new compression methods use them. Also windows Subsystem for Linux.
- mehrdadn 8y agoAFAIK the Windows subsystem for Linux only uses extended attributes, not alternate data streams. But yes, :WofCompressedData is used for the (awesome) transparent read-only LZX compression.
- MikusR 8y agohttps://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support/ https://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-sys... says that something is also kept in ads
- mehrdadn 8y agoOh wow, interesting, thanks for sharing! So it says: > In addition, if a file has any file capabilities, these are stored in an alternate data stream for the file. Note that WSL currently does not allow users to modify file capabilities for a file. I've never actually seen this used... I wonder what commands would trigger it?
- orf 8y agoThey are used extensively in SQL server, as well as Windows itself. It's a pretty fundamental part of the NTFS design and you can't just drop it. ADS underpins pretty much every FS operation on windows, including listing directories. MacOS has something similar.
- mehrdadn 8y ago> They are used extensively in [...] Windows itself. ADS underpins pretty much every FS operation on windows, including listing directories. I think you might be confusing alternate data streams with NTFS attributes (not to be confused with file attributes or extended attributes). i.e. Paths are formatted as \PARENT\NAME:STREAM:$ATTRIBUTE and I think you're thinking about the :$ATTRIBUTE portion (like $DATA, $INDEX_ALLOCATION, etc.) rather than the :ADS portion, because as far as I know Windows does not use ADS extensively by any means. I've only seen a handful of uses in the OS. Or maybe you mean the fact that directory $INDEX_ROOT and $INDEX_ALLOCATION attributes are used with a stream called $I30, but I don't see why that's "underpinning" anything in any way... they could just drop the ability to create any other streams and it wouldn't affect this.
- londons_explore 8y agoYou could drop it from being accessible to usermode applications, and have only the kernel/whitelisted binaries able to use them. Existing usecases could be replaced with new attributes or syscalls where they can't be avoided.
- mehrdadn 8y agoThe current uses in Windows I'm aware of (not including external programs) are: - :$I30, :$Bad, $Info, $SDH, and a number of others, internally used to name the stream that stores the children of directories. But the stream names seem pretty unnecessary to me; they aren't exposed to external code so they could well be different files and it wouldn't affect any user. - :Zone.Identifier, for denoting whether a file is from an untrusted origin (so you can get that annoying pop-up every time you run a downloaded file) - :WofCompressedData, for the newer transparent file compression mechanism (older ones were different) - :Win32App_1, used for I'm-not-sure-what - :encryptable, used along with Thumbs.db, also for I'm-not-sure-what - I think there was one more regarding extended properties or something, but I can't think of it right now. Aside from breaking :WofCompressedData I don't think anyone outside Microsoft would shed any tears if it was removed.
- voltagex_ 8y agoHow are the current placeholders for OneDrive implemented?
- mehrdadn 8y agoNo clue! I don't use it and I uninstall it wherever possible, so I haven't really considered it part of the OS. :P But yeah, it's totally possible sync programs use it too.
- hug 8y agoDoesn't look like it's via ADS -- synced items on my desktop have only the single stream. Except for one item I just created to test that has a stream called "magic".
- voltagex_ 8y agoSeems like it's done via a filesystem filter driver - calls to open files from OneDrive-unaware applications block until the file is downloaded.
- 8y ago
- deleted 8y ago[deleted]
- cryptonector 8y agoBoth, ADS and xattrs are extremely useful. Let's say you need to associate some metadata with a file, but you can't change its contents' format. You could use some separate file that goes with it, but now you can't atomically rename(2) the thing... But with ADS/xattrs you just attach those to the file, and then when you rename(2) the file the ADS/xattrs go with it atomically. (Yes, you could rename a directory, but it doesn't quite have the same semantics as renaming a file. In particular, rename(2) of a directory won't rm -rf the target if it exists.) POSIX-ish systems that support ADS use openat(2), not open(2) naming conventions, to get at ADS. POSIX-ish systems that support xattrs use other system calls specifically for that purpose. It's NOT ADS that causes these problems but the naming conventions used to make them accessible without having to write programs that use new system calls instead of open(2) (POSIX) or CreateFile() (WIN32).