summaryrefslogtreecommitdiff
path: root/source3/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
commitfb556e14f3b47d5a1f465589084e8b30d84af8ca (patch)
tree90efd6b2e60d40552f23b481f08e69b5e9e24178 /source3/libsmb
parent4140f2bfc141ee9a91723d274344769f8b11a5f9 (diff)
downloadsamba-fb556e14f3b47d5a1f465589084e8b30d84af8ca.tar.gz
samba-fb556e14f3b47d5a1f465589084e8b30d84af8ca.tar.bz2
samba-fb556e14f3b47d5a1f465589084e8b30d84af8ca.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. (This used to be commit 2565ccf9de9d5e80fdb5bcadbc7130faba386d95)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index d3233f59fd..6a0818d177 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/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);