summaryrefslogtreecommitdiffstats
path: root/source/libsmb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-24 08:08:05 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-24 08:08:05 +0000
commit2565ccf9de9d5e80fdb5bcadbc7130faba386d95 (patch)
tree5b5846e0b28aa29db5c410336f8e258994d85423 /source/libsmb
parent9d863fb1681a5b03696552e1d93fe339b4bae455 (diff)
downloadsamba-2565ccf9de9d5e80fdb5bcadbc7130faba386d95.tar.gz
samba-2565ccf9de9d5e80fdb5bcadbc7130faba386d95.tar.xz
samba-2565ccf9de9d5e80fdb5bcadbc7130faba386d95.zip
volker was concerned about unique inode numbers and smbsh. This set of
changes uses the unique index number from a SMB_QUERY_FILE_ALL_INFO to try to provide inode numbers. If it is 0 then use the hash of the filename as before.
Diffstat (limited to 'source/libsmb')
-rw-r--r--source/libsmb/clientgen.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c
index d3233f59fd9..6a0818d1775 100644
--- a/source/libsmb/clientgen.c
+++ b/source/libsmb/clientgen.c
@@ -1669,7 +1669,8 @@ send a qpathinfo call with the SMB_QUERY_FILE_ALL_INFO info level
****************************************************************************/
BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
time_t *c_time, time_t *a_time, time_t *m_time,
- time_t *w_time, size_t *size, uint32 *mode)
+ time_t *w_time, size_t *size, uint32 *mode,
+ SMB_INO_T *ino)
{
int data_len = 0;
int param_len = 0;
@@ -1721,6 +1722,9 @@ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
if (mode) {
*mode = IVAL(rdata, 32);
}
+ if (ino) {
+ *ino = IVAL(rdata, 64);
+ }
if (rdata) free(rdata);
if (rparam) free(rparam);
@@ -1733,7 +1737,8 @@ send a qfileinfo call
****************************************************************************/
BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
uint32 *mode, size_t *size,
- time_t *c_time, time_t *a_time, time_t *m_time)
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ time_t *w_time, SMB_INO_T *ino)
{
int data_len = 0;
int param_len = 0;
@@ -1745,7 +1750,7 @@ BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
memset(param, 0, param_len);
SSVAL(param, 0, fnum);
- SSVAL(param, 2, SMB_INFO_STANDARD);
+ SSVAL(param, 2, SMB_QUERY_FILE_ALL_INFO);
if (!cli_send_trans(cli, SMBtrans2,
NULL, 0, /* name, length */
@@ -1768,19 +1773,25 @@ BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
}
if (c_time) {
- *c_time = make_unix_date2(rdata+0);
+ *c_time = interpret_long_date(rdata+0) - cli->serverzone;
}
if (a_time) {
- *a_time = make_unix_date2(rdata+4);
+ *a_time = interpret_long_date(rdata+8) - cli->serverzone;
}
if (m_time) {
- *m_time = make_unix_date2(rdata+8);
+ *m_time = interpret_long_date(rdata+16) - cli->serverzone;
+ }
+ if (w_time) {
+ *w_time = interpret_long_date(rdata+24) - cli->serverzone;
}
if (size) {
- *size = IVAL(rdata, 12);
+ *size = IVAL(rdata, 40);
}
if (mode) {
- *mode = SVAL(rdata,l1_attrFile);
+ *mode = IVAL(rdata, 32);
+ }
+ if (ino) {
+ *ino = IVAL(rdata, 64);
}
if (rdata) free(rdata);