Live data from Hacker News

MS Teams channels cannot contain MS-DOS device names

learn.microsoft.com

11–20 of 364 posts

Re: MS Teams channels cannot contain MS-DOS device names

#11
post #5

Does this imply it's writing a file to the fs for its internal storage, with the name matching the channel's name instead of a channel ID?

I think it only implies they worry about people cutting and pasting channel names into other things like random powershell scripts.

Re: MS Teams channels cannot contain MS-DOS device names

#12
post #5

Does this imply it's writing a file to the fs for its internal storage, with the name matching the channel's name instead of a channel ID?

Not necessarily - it could mean that at some point they believe they'll need to create folder or file with the same name as a team, and they don't wanna have to deal with weird collisions.

It's been a while since I've used Teams+Sharepoint, but I vaguely remember being able to have a Sharepoint workspace per team channel, and then being able to mount those workspaces as a shared/network drive. Stuff that might end up in the workspace is like... shared/uploaded files or something?

Re: MS Teams channels cannot contain MS-DOS device names

#13
post #2

Words: forms, CON, CONIN$, CONOUT$, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9, desktop.ini, _vti_

I was about to say "Which is essentially leaking the existence of something terrible inside. They should be embarrassed to say something like this in public. Like saying you can't have %s or $PS1. Why the hell not? What are you doing with this user-supplied input?" But maybe it's more about what everyone else might do with a channel name. Ie they might cut & paste it anywhere, and I guess windows users aren't expecte…

I thought this as well but there's plenty of dangerous commands that aren't escaped here. I'm assuming it's a limitation of it actually writing something to the filesystem, hopefully your own (with the desktop app) and not one in Azure.

Re: MS Teams channels cannot contain MS-DOS device names

#15
post #5

Does this imply it's writing a file to the fs for its internal storage, with the name matching the channel's name instead of a channel ID?

Not necessarily - it could mean that at some point they believe they'll need to create folder or file with the same name as a team, and they don't wanna have to deal with weird collisions. It's been a while since I've used Teams+Sharepoint, but I vaguely remember being able to have a Sharepoint workspace per team channel, and then being able to mount those workspaces as a shared/network drive. Stuff that might end up…

  It's been a while since I've used Teams+Sharepoint, but I vaguely remember being able to have a Sharepoint workspace per team channel, and then being able to mount those workspaces as a shared/network drive. Stuff that might end up in the workspace is like... shared/uploaded files or something?
This is correct. Every channel is backed by a Sharepoint folder (maybe this is configurable?) that contains stuff like uploaded images, videos, recordings and transcripts of meetings, etc.

Re: MS Teams channels cannot contain MS-DOS device names

#16
post #2

Words: forms, CON, CONIN$, CONOUT$, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9, desktop.ini, _vti_

I was about to say "Which is essentially leaking the existence of something terrible inside. They should be embarrassed to say something like this in public. Like saying you can't have %s or $PS1. Why the hell not? What are you doing with this user-supplied input?" But maybe it's more about what everyone else might do with a channel name. Ie they might cut & paste it anywhere, and I guess windows users aren't expecte…

> What are you doing with this user-supplied input?

Creating Sharepoint shares which can be mounted as network shares in Windows where these filenames are not allowed?

Re: MS Teams channels cannot contain MS-DOS device names

#17
I was about to say "Which is essentially leaking the existence of something terrible inside. They should be embarrassed to say something like this in public. Like saying you can't have %s or $PS1. Why the hell not? What are you doing with this user-supplied input?"

But maybe it's more about what everyone else might do with a channel name. Ie they might cut & paste it anywhere, and I guess windows users aren't expected to escape their own strings when pasted into cmd or powershell or wsl.

The teams code itself can probably handle it just fine, but maybe not all the unknown janky random things out there that might handle channel names.

Other people have pointed out the SharePoint folders associated with the channels. Not sure I would excuse that myself since it's easy enough to just escape or modify or encode to create a safe version for the directory, but maybe it's important elsewhere for the channel name and the directory name to be identical. Within one app you could simply encode and decode both the channel name and directory name the same way and totally hide the encoding from the user, but if the directory is used outside of the app, then it would look bad with URL encoding or something that everything else will just display as it is, not decoded.

So the directory has to be safe for everything else, and so the channel name has to be the same.

Essentially choosing to have these limits rather than have directory names that look ugly sometimes. It's ultimately not even a safety or breakage thing, just a cosmetic thing. All directories will always look natural and good, because they don't allow anything that would have needed to be encoded.

Re: MS Teams channels cannot contain MS-DOS device names

#18
post #5

Does this imply it's writing a file to the fs for its internal storage, with the name matching the channel's name instead of a channel ID?

Not necessarily - it could mean that at some point they believe they'll need to create folder or file with the same name as a team, and they don't wanna have to deal with weird collisions. It's been a while since I've used Teams+Sharepoint, but I vaguely remember being able to have a Sharepoint workspace per team channel, and then being able to mount those workspaces as a shared/network drive. Stuff that might end up…

This%20is%20what%20escape%20sequences%20are%20for.

Re: MS Teams channels cannot contain MS-DOS device names

#19

Ahahaha, I love this! I love how this new fandango thing harkens back to the earliest days of MS-DOS when it ran on a 086 or 286, back in the early (very early) 90s. Have to respect MS' backwards compatibility fanaticism. Impossibly as if a native port of MS Teams would be created for MS-DOS 3.1 (hahahaha). When more plausibly the MS Teams servers run on an ancient crazy proprietary MS-DOS 3.1 mainframe (still implau…

Agree BC is a laundable goal and appreciate their efforts. Though I do wish it didn't include limiting passwords to obscenely short lengths or absurd subsets of characters.

Re: MS Teams channels cannot contain MS-DOS device names

#20
post #2

Words: forms, CON, CONIN$, CONOUT$, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9, desktop.ini, _vti_

I was about to say "Which is essentially leaking the existence of something terrible inside. They should be embarrassed to say something like this in public. Like saying you can't have %s or $PS1. Why the hell not? What are you doing with this user-supplied input?" But maybe it's more about what everyone else might do with a channel name. Ie they might cut & paste it anywhere, and I guess windows users aren't expecte…

The Something Terrible in this case is early DOS which did not have separate folders. So the device files were in the same namespace as the user's files, so the user couldn't name a file CON or LPT1. These are preserved for backwards compatibility. To this day you can write a program that writes to a CON file in any folder, and the program will print the write to console.
Post reply on HN