mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s3-spoolss: handle NTTIME(0) as "01/01/1601" REG_SZ in driver dates.
Guenther
This commit is contained in:
parent
a204c45e59
commit
d0e164458d
@ -1219,10 +1219,14 @@ static WERROR winreg_printer_write_date(TALLOC_CTX *mem_ctx,
|
||||
struct tm *tm;
|
||||
time_t t;
|
||||
|
||||
t = nt_time_to_unix(data);
|
||||
tm = localtime(&t);
|
||||
str = talloc_asprintf(mem_ctx, "%02d/%02d/%04d",
|
||||
tm->tm_mon + 1, tm->tm_mday, tm->tm_year + 1900);
|
||||
if (data == 0) {
|
||||
str = talloc_strdup(mem_ctx, "01/01/1601");
|
||||
} else {
|
||||
t = nt_time_to_unix(data);
|
||||
tm = localtime(&t);
|
||||
str = talloc_asprintf(mem_ctx, "%02d/%02d/%04d",
|
||||
tm->tm_mon + 1, tm->tm_mday, tm->tm_year + 1900);
|
||||
}
|
||||
if (!str) {
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
@ -1255,6 +1259,11 @@ static WERROR winreg_printer_date_to_NTTIME(const char *str, NTTIME *data)
|
||||
struct tm tm;
|
||||
time_t t;
|
||||
|
||||
if (strequal(str, "01/01/1601")) {
|
||||
*data = 0;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
ZERO_STRUCT(tm);
|
||||
|
||||
if (sscanf(str, "%d/%d/%d",
|
||||
|
Loading…
x
Reference in New Issue
Block a user