change rpcclient dfsgetinfo path syntax ?

Pavel Filipenský pfilipensky at samba.org
Fri Jun 9 15:24:57 UTC 2023


Hi,

with samba 4.17.5 following syntax was fine (consider that all 
backslashes are escaped, so every backslash appears twice at the command 
line)

$ rpcclient localhost -U% -c 
'dfsgetinfo**\\\\localhost\\samba-share\\pointA localhost pointA'

with samba 4.18.2 only this works:

$ rpcclient localhost -U% -c 'dfsgetinfo \\localhost\samba-share\pointA 
localhost point'

Looking into /var/log/samba/log.rpcd_classic shows that:
- 4.17 is using parse_dfs_path() with trim_char(p, '/', '/')
- 4.18 is using parse_dfs_path_strict() that does not trim anything and 
assumes single '\'

/var/log/samba/log.rpcd_classic for samba-4.18.2 shows for WORKING case 
("\localhost\samba-share\pointA")

[2023/06/09 11:12:17, 10, pid=55152, effective(65534, 65534), 
real(65534, 0), class=msdfs] 
../../source3/smbd/msdfs.c:117(parse_dfs_path_strict)
   parse_dfs_path_strict: path = |\localhost\samba-share\pointA|
[2023/06/09 11:12:17, 10, pid=55152, effective(65534, 65534), 
real(65534, 0), class=msdfs] 
../../source3/smbd/msdfs.c:153(parse_dfs_path_strict)
   parse_dfs_path_strict: hostname: localhost
[2023/06/09 11:12:17, 10, pid=55152, effective(65534, 65534), 
real(65534, 0)] ../../source3/lib/util.c:998(is_myname)
   is_myname: is_myname("localhost") returns 0

and FAILING case ("\\localhost\samba-share\pointA"):


[2023/06/09 11:15:12, 10, pid=55188, effective(65534, 65534), 
real(65534, 0), class=msdfs] 
../../source3/smbd/msdfs.c:117(parse_dfs_path_strict)
   parse_dfs_path_strict: path = |\\localhost\samba-share\pointA|
[2023/06/09 11:15:12, 10, pid=55188, effective(65534, 65534), 
real(65534, 0), class=msdfs] 
../../source3/smbd/msdfs.c:153(parse_dfs_path_strict)
   parse_dfs_path_strict: hostname:
[2023/06/09 11:15:12, 10, pid=55188, effective(65534, 65534), 
real(65534, 0)] ../../source3/lib/util.c:998(is_myname)
   is_myname: is_myname("") returns 0
[2023/06/09 11:11:45,  3, pid=55152, effective(65534, 65534), 
real(65534, 0)] 
../../lib/util/util_net.c:255(interpret_string_addr_internal)
   interpret_string_addr_internal: getaddrinfo failed for name (flags 
32) [Name or service not known]



Is this change intentional? How is defined the path syntax? Do we 
support something like UNC path syntax with two leading backslashes?


Thank you,

Pavel


More information about the samba-technical mailing list