[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: mount(8) unable to mount a device via symlink that contains ':'
From:       "Misha Gusarov" <misha () ridge ! co>
Date:       2020-12-03 14:36:22
Message-ID: 0D0A8254-D4E3-464A-BD89-2C31DD7DA1CF () ridge ! co
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On 2 Dec 2020, at 17:26, Denys Vlasenko wrote:

>> $ mount -o bind /dev/disk/by-path/pci-0000:13:00.0-scsi-0:0:3:0
>> /some/mount/point
>> mount: bad address '/dev/disk/by-path/pci-0000'
>> $
>>
>> The problem stems from the following check in mount.c:
>>
>> // Might this be an NFS filesystem?
>> if ((!mp->mnt_type || is_prefixed_with(mp->mnt_type, "nfs"))
>>   && strchr(mp->mnt_fsname, ':') != NULL
>> ) {
>
> Does this help?
>
>         // Might this be an NFS filesystem?
>         if ((!mp->mnt_type || is_prefixed_with(mp->mnt_type, "nfs"))
>          && strchr(mp->mnt_fsname, ':') != NULL
> +        && !(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))
>         ) {
>                 if (!mp->mnt_type)
>                         mp->mnt_type = (char*)"nfs";

Sure this helps in this particular scenario —  however for non-bind NFS
detection should probably see that the part before `:` is a valid DNS name
or IP address. A simple check for lack of `/` before `:` should suffice.

-- 
Misha

[Attachment #5 (text/html)]

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 2 Dec 2020, at 17:26, Denys Vlasenko wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; \
color:#777; margin:0 0 5px; padding-left:5px"><blockquote style="border-left:2px \
solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999"><p \
                dir="auto">$ mount -o bind \
                /dev/disk/by-path/pci-0000:13:00.0-scsi-0:0:3:0<br>
/some/mount/point<br>
mount: bad address '/dev/disk/by-path/pci-0000'<br>
$<br>
<br>
The problem stems from the following check in mount.c:<br>
<br>
// Might this be an NFS filesystem?<br>
if ((!mp-&gt;mnt_type || is_prefixed_with(mp-&gt;mnt_type, "nfs"))<br>
  &amp;&amp; strchr(mp-&gt;mnt_fsname, ':') != NULL<br>
) {</p>
</blockquote><p dir="auto">Does this help?<br>
<br>
        // Might this be an NFS filesystem?<br>
        if ((!mp-&gt;mnt_type || is_prefixed_with(mp-&gt;mnt_type, "nfs"))<br>
         &amp;&amp; strchr(mp-&gt;mnt_fsname, ':') != NULL<br>
+        &amp;&amp; !(vfsflags &amp; (MS_REMOUNT | MS_BIND | MS_MOVE))<br>
        ) {<br>
                if (!mp-&gt;mnt_type)<br>
                        mp-&gt;mnt_type = (char*)"nfs";</p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">Sure this helps in this particular scenario —  however for non-bind \
NFS<br> detection should probably see that the part before <code \
style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" \
bgcolor="#F7F7F7">:</code> is a valid DNS name<br> or IP address. A simple check for \
lack of <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 \
0.4em" bgcolor="#F7F7F7">/</code> before <code style="background-color:#F7F7F7; \
border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">:</code> should \
suffice.</p>

<p dir="auto">-- <br>
Misha</p>
</div>
</div>
</body>
</html>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic