Mount failure caused by colon/comma characters in the path of lower/upper dirs
Hello,
Today I got a mount failure report from a docker developer about special characters in overlayfs lower/upper path. The root cause is quite straightforward because overlayfs uses colon/comma as seperator of lowerdir layers and module options. However, Colon/Comma characters are valid for directory name on linux so some people(especially container users) hope overlayfs could correctly recognize and handle those directories.
Strengthen option parsing seems a right solution for fixing the issue, what do think for this?
Thanks,
Chengguang Xu
Quoted 9 lines · Chengguang Xu
Hello,
Today I got a mount failure report from a docker developer about special characters in overlayfs lower/upper path. The root cause is quite straightforward because overlayfs uses colon/comma as seperator of lowerdir layers and module options. However, Colon/Comma characters are valid for directory name on linux so some people(especially container users) hope overlayfs could correctly recognize and handle those directories.
Strengthen option parsing seems a right solution for fixing the issue, what do think for this?
Use backslash as an escape character. E.g. lower directory named "ab,cd:ef" needs to be passed to mount as "-olowerdir=ab\,cd\:ef"
Thanks,
Miklos
---- 在 星期五, 2021-07-09 22:03:11 Miklos Szeredi <[email protected]> 撰写 ----
Quoted 9 lines · Chengguang Xu
Quoted 8 lines
Hello,
Today I got a mount failure report from a docker developer about special characters in overlayfs lower/upper path. The root cause is quite straightforward because overlayfs uses colon/comma as seperator of lowerdir layers and module options. However, Colon/Comma characters are valid for directory name on linux so some people(especially container users) hope overlayfs could correctly recognize and handle those directories.
Quoted 5 lines
Quoted 1 line
Strengthen option parsing seems a right solution for fixing the issue, what do think for this?
Use backslash as an escape character. E.g. lower directory named "ab,cd:ef" needs to be passed to mount as "-olowerdir=ab\,cd\:ef"
Hi Miklos,
Thanks for your advice, it worked well.
Minor fix is "ab,cd:ef" needs to be passed to mount as "-olowerdir=ab\\,cd\\:ef"
Thanks,
Chengguang