CIFS extensions for UNIX
John Newbigin
jn at it.swin.edu.au
Thu Jan 31 20:28:03 GMT 2002
I have implemented follow_link which makes symlinks work properly on the
client but it highligts a problem with SMB_QUERY_FILE_UNIX_BASIC.
There needs to be a version which always does an lstat
(SMB_QUERY_FILE_UNIX_LINK_BASIC?) (does_this_name_look_to_long?). This
needs to be the same as SMB_QUERY_FILE_UNIX_BASIC in all respects except
that it does an lstat.
There are also other stat v lstat problems with the current samba code.
SMB_QUERY_FILE_UNIX_LINK currently does no do an lstat.
In trans2.c call_trans2qfilepathinfo() there is some code which is
perhaps meant to address this but I can't see how/what it is attempting
to do:
==================
unix_convert(fname,conn,0,&bad_path,&sbuf);
if (!check_name(fname,conn) || (!VALID_STAT(sbuf) &&
(INFO_LEVEL_IS_UNIX(info_level) ? vfs_lstat(conn,fname,&sbuf) :
vfs_stat(conn,fname,&sbuf)))) {
DEBUG(3,("fileinfo of %s failed (%s)\n",fname,strerror(errno)));
if((errno == ENOENT) && bad_path) {
unix_ERR_class = ERRDOS;
unix_ERR_code = ERRbadpath;
}
return(UNIXERROR(ERRDOS,ERRbadpath));
}
==================
At any rate, the server needs to allow the client do request a stat or
an lstat when it does a query.
Another issue relating to links is that samba appears to not want to
create dangling symlinks. If symlinks are for the clients to resolve
then this will prevent the creation of symlinks. This needs to be
addressed. If it is a security issue then a config option to turn it on
and off is probably required.
John.
--
Information Technology Innovation Group
Swinburne University. Melbourne, Australia
http://uranus.it.swin.edu.au/~jn
More information about the samba-technical
mailing list