Way to tell if smb_fname->base_name is a fully qualified path

Jeremy Allison jra at samba.org
Wed Nov 30 17:14:37 UTC 2016


On Mon, Nov 28, 2016 at 09:56:04AM -0700, Trever L. Adams wrote:
> In relation to the clean up work for Samba VirusFilter, a question of
> supporting streams has come up. I have a solution, but the way of not
> adding vfs_h->conn->connectpath as a prefix in the case of streams could
> be buggy and the code is ugly.
> 
> Is there a flag or some other cheap/clean way to check if the base_name
> is fully qualified and not relative to the connectpath?
> 
>     if (strncmp(connectpath, fname, strlen(connectpath)) == 0) {
>         ...
>     }
> 
> is the way I am doing it, but that is very ugly. If some administrator
> has path names that contain the same prefixes in multiple places, this
> may also be buggy.

Can you explain more what the exact problem is ? What pathnames
are you seeing that are fully qualified ?



More information about the samba-technical mailing list