The Samba-Bugzilla – Attachment 4497 Details for
Bug 6273
Accessing a w2k8 server share from Windows or Linux is impossible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for fixing the problem
0001-Return-infinite-time-for-last-last-logoff-when-last.patch (text/plain), 2.48 KB, created by
Matthieu Patou
on 2009-08-01 05:07:18 UTC
(
hide
)
Description:
Patch for fixing the problem
Filename:
MIME Type:
Creator:
Matthieu Patou
Created:
2009-08-01 05:07:18 UTC
Size:
2.48 KB
patch
obsolete
>From fb8112b855da1d10135b7da9aecc12e2f8351ba4 Mon Sep 17 00:00:00 2001 >From: Matthieu Patou <mat@matws.net> >Date: Sat, 1 Aug 2009 14:02:58 +0400 >Subject: [PATCH] Return infinite time for last last logoff when last logoff = 0 > >--- > source4/auth/auth_sam_reply.c | 2 +- > source4/auth/sam.c | 2 +- > source4/dsdb/common/util.c | 16 ++++++++++++++++ > 3 files changed, 18 insertions(+), 2 deletions(-) > >diff --git a/source4/auth/auth_sam_reply.c b/source4/auth/auth_sam_reply.c >index dfa7623..88eb857 100644 >--- a/source4/auth/auth_sam_reply.c >+++ b/source4/auth/auth_sam_reply.c >@@ -38,7 +38,7 @@ NTSTATUS auth_convert_server_info_sambaseinfo(TALLOC_CTX *mem_ctx, > sam->domain_sid->num_auths--; > > sam->last_logon = server_info->last_logon; >- sam->last_logoff = server_info->last_logoff; >+ sam->last_logoff = server_info->last_logoff; > sam->acct_expiry = server_info->acct_expiry; > sam->last_password_change = server_info->last_password_change; > sam->allow_password_change = server_info->allow_password_change; >diff --git a/source4/auth/sam.c b/source4/auth/sam.c >index c396662..1c8418e 100644 >--- a/source4/auth/sam.c >+++ b/source4/auth/sam.c >@@ -358,7 +358,7 @@ _PUBLIC_ NTSTATUS authsam_make_server_info(TALLOC_CTX *mem_ctx, struct ldb_conte > NT_STATUS_HAVE_NO_MEMORY_AND_FREE(server_info->logon_server, tmp_ctx); > > server_info->last_logon = samdb_result_nttime(msg, "lastLogon", 0); >- server_info->last_logoff = samdb_result_nttime(msg, "lastLogoff", 0); >+ server_info->last_logoff = samdb_result_last_logoff(msg); > server_info->acct_expiry = samdb_result_account_expires(msg); > server_info->last_password_change = samdb_result_nttime(msg, "pwdLastSet", 0); > >diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c >index 313005b..3a7bbc5 100644 >--- a/source4/dsdb/common/util.c >+++ b/source4/dsdb/common/util.c >@@ -436,6 +436,22 @@ NTTIME samdb_result_nttime(struct ldb_message *msg, const char *attr, NTTIME def > } > > /* >+ * Windows stores 0 for lastLogoff. >+ * But when a MS DC return the lastLogoff (as Logoff Time) >+ * it returns 0x7FFFFFFFFFFFFFFF, not returning this value in this case >+ * cause windows 2008 and newer version to fail for SMB requests >+ */ >+NTTIME samdb_result_last_logoff(struct ldb_message *msg) >+{ >+ NTTIME ret = ldb_msg_find_attr_as_uint64(msg, "lastLogoff",0); >+ >+ if (ret == 0) >+ ret = 0x7FFFFFFFFFFFFFFFULL; >+ >+ return ret; >+} >+ >+/* > * Windows uses both 0 and 9223372036854775807 (0x7FFFFFFFFFFFFFFFULL) to > * indicate an account doesn't expire. > * >-- >1.5.6.3 >
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 6273
:
4368
| 4497