diff options
author | Jeremy Allison <jra@samba.org> | 1998-10-21 16:58:34 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-10-21 16:58:34 +0000 |
commit | 0b44d27d0b5cc3948a6c2d78370ccddf1a84cd80 (patch) | |
tree | df5af993c3cc497f3018f0e50f03c2bd092f68a0 /source/smbd/trans2.c | |
parent | 500e5536bee8ea8e58d5991bfab2cff923068926 (diff) | |
download | samba-0b44d27d0b5cc3948a6c2d78370ccddf1a84cd80.tar.gz |
Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode.
smbd/chgpasswd.c: Fixed (my) stupid bug where I was returning stack based variables. Doh !
smbd/trans2.c: Allows SETFILEINFO as well as QFILEINFO on directory handles.
Jeremy.
Diffstat (limited to 'source/smbd/trans2.c')
-rw-r--r-- | source/smbd/trans2.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 35bd10fb13d..5b057410cad 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -1500,15 +1500,37 @@ static int call_trans2setfilepathinfo(connection_struct *conn, files_struct *fsp = file_fsp(params,0); info_level = SVAL(params,2); - CHECK_FSP(fsp,conn); - CHECK_ERROR(fsp); + if(fsp && fsp->open && fsp->is_directory) { + /* + * This is actually a SETFILEINFO on a directory + * handle (returned from an NT SMB). NT5.0 seems + * to do this call. JRA. + */ + fname = fsp->fsp_name; + unix_convert(fname,conn,0,&bad_path,&st); + if (!check_name(fname,conn) || (!VALID_STAT(st) && dos_stat(fname,&st))) { + 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)); + } + } else { + /* + * Original code - this is an open file. + */ + CHECK_FSP(fsp,conn); + CHECK_ERROR(fsp); - fname = fsp->fsp_name; - fd = fsp->fd_ptr->fd; + fname = fsp->fsp_name; + fd = fsp->fd_ptr->fd; - if(sys_fstat(fd,&st)!=0) { - DEBUG(3,("fstat of %s failed (%s)\n", fname, strerror(errno))); - return(UNIXERROR(ERRDOS,ERRbadpath)); + if (sys_fstat(fd,&st) != 0) { + DEBUG(3,("fstat of fnum %d failed (%s)\n",fsp->fnum, strerror(errno))); + return(UNIXERROR(ERRDOS,ERRbadfid)); + } } } else { /* set path info */ |