The Samba-Bugzilla – Attachment 1623 Details for
Bug 3339
libsmbclient smbc_stat returns wrong mtime and atime
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
testprogram to reproduce the error
staterror.c (text/plain), 1.43 KB, created by
Henrik (dead mail address)
on 2005-12-19 07:06:42 UTC
(
hide
)
Description:
testprogram to reproduce the error
Filename:
MIME Type:
Creator:
Henrik (dead mail address)
Created:
2005-12-19 07:06:42 UTC
Size:
1.43 KB
patch
obsolete
>#include <libsmbclient.h> >#include <sys/stat.h> >#include <string.h> >#include <stdio.h> >#include <time.h> > >#define MAX_BUFF_SIZE 255 > >char g_workgroup[MAX_BUFF_SIZE]; >char g_username[MAX_BUFF_SIZE]; >char g_password[MAX_BUFF_SIZE]; > >void auth_fn(const char* server, const char* share, char* workgroup, int wgmaxlen, > char* username, int unmaxlen, char* password, int pwmaxlen) >{ > strncpy(workgroup, g_workgroup, wgmaxlen - 1); > strncpy(username, "admin", 6); > strncpy(password, "admin", 6); >} > > >int gettime(const char* _pszFilename) >{ > //char *pSmbPath = 0; > struct stat st; > char mtime[32]; > char ctime[32]; > char atime[32]; > > smbc_init(auth_fn, 0); > > if (smbc_stat(_pszFilename, &st) < 0) > { > perror("smbc_stat"); > return 1; > } > > printf("SAMBA\n mtime:%lu/%s ctime:%lu/%s atime:%lu/%s\n", > st.st_mtime, ctime_r(&st.st_mtime, mtime), > st.st_ctime, ctime_r(&st.st_ctime, ctime), > st.st_atime, ctime_r(&st.st_atime, atime)); > > > // check the stat on this file > if (stat("staterror.c", &st) < 0) > { > perror("stat"); > return 1; > } > > printf("LOCAL\n mtime:%lu/%s ctime:%lu/%s atime:%lu/%s\n", > st.st_mtime, ctime_r(&st.st_mtime, mtime), > st.st_ctime, ctime_r(&st.st_ctime, ctime), > st.st_atime, ctime_r(&st.st_atime, atime)); > > > return 0; >} > >int main(int argc, char* argv[]) >{ > if( 1 == argc ) > printf("usage: %s smb://<url-to-file>\n", argv[0]); > else > gettime(argv[1]); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 3339
: 1623 |
1624
|
1625
|
1626