[jcifs] Re: SMB URL encoding/decoding

James Nord teilo at teilo.net
Sun Feb 24 14:01:24 EST 2002


Michael B Allen wrote:

>On Sun, 24 Feb 2002 03:28:55 +0100
>James Nord <teilo at teilo.net> wrote:
>
>>Neither / nor @ have precedence over anything.  It is just that is the 
>>only legal combination.
>>
>>it is not legal to have ftp://user:pass@foo@foo:21/some/thing/else@/here
>>
>>As we are only allowed zero or one @'s between the first 2 /'s and the 
>>next /
>>and if that @appears we are only alowed zero or 1 ':' between the 
>>second  / and the first @
>>
>>Maybe it is my interpritation of the word precedence (to mean rank 
>>higher) which is getting in my way, but I would not say that / comes 
>>before @
>>to say that implies (to me at least) you could have 
>>ftp://user:pass@foo@foo:21/some/thing/else@/here
>>
>
>I'm not sure what you mean by "we are only allowed" but none of the
>above is true (which may be your point). You cannot count certain
>characters. The password field could have three ':' or fifteen '@'s in
>it. It can have anything. *That's* the real problem.
>
No it can not.

again password != password field

the password field cannot contain any of,

      reserved      = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                      "$" | ","

(note that is not an exhaustive list we also have öäåÖÄÅ....)

      smb_net_path  = smb_server [ smb_abs_path [ "#" fragment ] ]

      smb_server    = [ [ smb_userinfo "@" ] smb_srv_name [ ":" port ] ]

      smb_srv_name  = nbtname | hostname | IPv4address
      nbtname       = netbiosname scope
      netbiosname   = 1*( netbiosnamec ) *( netbiosnamec | "*" )
      netbiosnamec  = ( alphanum | escaped  | ":" | "=" | "+" | "$" |
                        "," | "-" | "_" | "!" | "~" | "'" | "(" | ")" )
      scope         = *( "." domainlabel ) [ "." ]

      smb_userinfo  = [ ntdomain ";" ] username [ ":" password ]
      ntdomain      = *( unreserved | escaped |
                         "&" | "=" | "+" | "$" | "," )
      username      = *( unreserved | escaped |
                         "&" | "=" | "+" | "$" | "," )
      password      = *( unreserved | escaped |
                         "&" | "=" | "+" | "$" | "," )

      unreserved    = alphanum | mark
      alphanum      = alpha | digit
      alpha         = lowalpha | upalpha

      lowalpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |
                 "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
                 "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
      upalpha  = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
                 "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
                 "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
      digit    = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
                 "8" | "9"

      mark          = "-" | "_" | "." | "!" | "~" | "*" | "'" |
                      "(" | ")"


/James







More information about the jcifs mailing list