Skip to contentSkip to conversation

PROBLEM: /proc/mounts: \r not escaped

PATCH Christer Palm 1 participant 1 message Apr 22, 2002 VFS

lore
Share & tools
lore
#0 lore raw

Hi all!

Sorry to bother you all with a minor issue like this, but I didn't find a procfs or general filesystem maintainer on the MAINTAINERS list...

The mangle() function in fs/namespace.c used to escape certain characters in the /proc/mounts output should probably escape '\r' in addition to those already escaped. This is because '\r' is recognized as whitespace by some potential tokenization methods - most notably scanf("%s") - and because it can cause confusing output from 'cat /proc/mounts' or similar.

Not that your everyday mountpoints have names containing '\r'. OTOH, nor is the case with '\t', which, I guess, is on the list for the very same reason.

Cheers,
--
Christer Palm

fs/namespace.c.palm renamed from fs/namespace.c +1 -1
@@ -184,7 +184,7 @@
 
 static inline void mangle(struct seq_file *m, const char *s)
 {
- seq_escape(m, s, " \t\n\\");
+ seq_escape(m, s, " \t\n\r\\");
 }
 
 static int show_vfsmnt(struct seq_file *m, void *v)