curl / Mailing Lists / curl-library / Single Mail

curl-library

smb.c and remote-time

From: Gisle Vanem via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 4 Jul 2017 15:32:05 +0200

Regarding added SMB-test in
https://github.com/curl/curl/pull/1630,

it's nice to see SMB is getting some focus (although I'm not able to run
these tests on my StrawberryPerl).

2 problems in smb.c AFAICS:

1) '_getpid()' is not a valid function in djgpp/MSDOS. Simple fix:

--- a/smb.c 2017-07-04 11:24:33
+++ b/smb.c 2017-07-04 12:42:10
@@ -31,12 +31,12 @@
    #define BUILDING_CURL_SMB_C

    #ifdef HAVE_PROCESS_H
-#include <process.h>
-#ifdef CURL_WINDOWS_APP
-#define getpid GetCurrentProcessId
-#else
-#define getpid _getpid
-#endif
+ #include <process.h>
+ #ifdef CURL_WINDOWS_APP
+ #define getpid GetCurrentProcessId
+ #elif !defined(MSDOS)
+ #define getpid _getpid
+ #endif
    #endif

    #include "smb.h"

2) A "curl --remote-time .." does nothing for smb://.
Seems to be a matter of using the 'smb_nt_create_response::last_change_time'
struct-member. The attached diff seems to work here.

A test like:
    curl --remote-time -o test-file --libcurl - smb://host/Users/Public/test-file
shows
   ...
   curl_easy_setopt(hnd, CURLOPT_FILETIME, 1L);

And the timestamp after the D/L seems okay.

-- 
--gv


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

Received on 2017-07-04