*/
#include "includes.h"
-#include "wrapper.h"
extern int DEBUGLEVEL;
void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode)
{
ZERO_STRUCTP(st);
+
+ st->st_mode = 0;
if (IS_DOS_DIR(mode)) {
st->st_mode = SMBW_DIR_MODE;
st->st_mode = SMBW_FILE_MODE;
}
+ if (IS_DOS_ARCHIVE(mode)) st->st_mode |= S_IXUSR;
+ if (IS_DOS_SYSTEM(mode)) st->st_mode |= S_IXGRP;
+ if (IS_DOS_HIDDEN(mode)) st->st_mode |= S_IXOTH;
+ if (!IS_DOS_READONLY(mode)) st->st_mode |= S_IWUSR;
+
st->st_size = size;
st->st_blksize = 512;
st->st_blocks = (size+511)/512;
uint32 *mode, size_t *size,
time_t *c_time, time_t *a_time, time_t *m_time)
{
- DEBUG(5,("sending qpathinfo\n"));
-
- if (cli_qpathinfo(&srv->cli, path, c_time, a_time, m_time,
- size, mode)) return True;
+ DEBUG(4,("sending qpathinfo\n"));
- DEBUG(5,("qpathinfo OK\n"));
+ if (!srv->no_pathinfo2 &&
+ cli_qpathinfo2(&srv->cli, path, c_time, a_time, m_time, NULL,
+ size, mode)) return True;
/* if this is NT then don't bother with the getatr */
if (srv->cli.capabilities & CAP_NT_SMBS) return False;
if (cli_getatr(&srv->cli, path, mode, size, m_time)) {
a_time = c_time = m_time;
+ srv->no_pathinfo2 = True;
return True;
}
return False;
{
struct smbw_file *file;
time_t c_time, a_time, m_time;
- uint32 size;
- int mode;
+ size_t size;
+ uint32 mode;
smbw_busy++;
return ret;
}
+ DEBUG(4,("sending qfileinfo\n"));
+
if (!cli_qfileinfo(&file->srv->cli, file->f->cli_fd,
&mode, &size, &c_time, &a_time, &m_time) &&
!cli_getattrE(&file->srv->cli, file->f->cli_fd,
return -1;
}
+ DEBUG(4,("stat(%s)\n", fname));
+
smbw_init();
smbw_busy++;
goto failed;
}
+ DEBUG(4,("smbw_stat\n"));
+
if (strncmp(srv->cli.dev,"IPC",3) == 0) {
mode = aDIR | aRONLY;
} else if (strncmp(srv->cli.dev,"LPT",3) == 0) {
smbw_busy--;
return -1;
}
-
-