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

Trever L. Adams trever at middleearth.sapphiresunday.org
Mon Nov 28 16:56:04 UTC 2016

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.

Thank you for any pointers.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161128/8626d990/signature.sig>

More information about the samba-technical mailing list