From patchwork Tue Apr 2 23:24:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10882463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29A4B139A for ; Tue, 2 Apr 2019 23:24:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C90928991 for ; Tue, 2 Apr 2019 23:24:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F118728995; Tue, 2 Apr 2019 23:24:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B9AA28991 for ; Tue, 2 Apr 2019 23:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726155AbfDBXYT (ORCPT ); Tue, 2 Apr 2019 19:24:19 -0400 Received: from mail-pl1-f181.google.com ([209.85.214.181]:33307 "EHLO mail-pl1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbfDBXYT (ORCPT ); Tue, 2 Apr 2019 19:24:19 -0400 Received: by mail-pl1-f181.google.com with SMTP id t16so5147931plo.0 for ; Tue, 02 Apr 2019 16:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=BxTE3WRHMguJHa51Qy80AZAqon0o51wBbtLc8K4oSOo=; b=SdyV+Zj/loIgGa9KW4A6Ud6FgNuL98HyHxkTWSbOovZCboMax+pfuPniZBWuF7zIkY nhdqbv9GVfXzREfXdfAHmdClwGlt1oRU6yz7GgfiHZDOoM+DyMEdPorlrvi/AL+Pdcyk vRtOtgzvWx60k6iCG2FUOwfP5/CTgl4Chsy9jWYyS8B6qJrZ+xRp+rpQ7IXvt6o6puo2 TIg7e/3vdu/8T9cnV1kaoYx8LeL0LuY79rwtzZw1bOyv9EzBVgAt8pF1H81RWKuUONK1 m9SJAc1GVEMhS80T8d5p9G2en0Q/UAqsgHu37/jIphZs99uDh4nyU/FIfmv2E50XZH0y hmHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=BxTE3WRHMguJHa51Qy80AZAqon0o51wBbtLc8K4oSOo=; b=fnZs7k1dAziswbw1tqKuMsZEOD3BVnD6rB5O6GVvSlP2XdrMgJqCnwsURmN8FLtZbF a9hLY2ebwcEtDukm0yFqCN7GttnD4q2hQ4lXUr8o26/v3RKp5r2Mow8Tg5K1m6c6sa9y DC7uRF7r1UxuYb1WewHvr9x7CqnXsZmCUqsO6pzomnuHPevd4G7/hJhw+aO3fOM8gofg oagKx9KsxryId1sx6m36efrlUTufTVUpGEuYzqEXv3x7FbYlxLpbnJiVPzH3Dg7/rZ09 avFOxfP9rIZIG3Pm1e3s8TgjFueSr3efZ3hZtF+TqMMG5FetBUOzaw4vYfHUzX0Q2tyo qbTg== X-Gm-Message-State: APjAAAUt/ZHXTyU8rPAAWTJHXbNhhPIR7/0wAxELgnGXkclDeeUEv0bA igDCsy1xC5D+T/L8CYZjfNCtS3U3EoeblrMisVtp0IJl X-Google-Smtp-Source: APXvYqz+xGNNgBB8yy2DMsBVEJchj7mkDD5VVKWAchepN45BC3PYCxGLhelBj3oWKsn6IyWesBcfKbTxWjMkXPiL4Dk= X-Received: by 2002:a17:902:7841:: with SMTP id e1mr14186539pln.303.1554247457640; Tue, 02 Apr 2019 16:24:17 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 2 Apr 2019 18:24:05 -0500 Message-ID: Subject: [PATCH][CIFSUTILS SMBINFO] Do not convert snapshot time to local time zone To: CIFS , Pavel Shilovsky Cc: samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We get snapshot times in GMT time, but need to convert them to DCE time (SMB time format) without changing the time zone. From 64a2ba46f67c89356917cacde12443d0fa7901f6 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 2 Apr 2019 18:20:07 -0500 Subject: [PATCH] smbinfo: snapshots are returned in gmt time so don't convert timezone We display snapshot times in GMT time, but need to convert them to DCE time (SMB time format) without changing the time zone. Signed-off-by: Steve French --- smbinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smbinfo.c b/smbinfo.c index d7a6431..c00f89b 100644 --- a/smbinfo.c +++ b/smbinfo.c @@ -1009,7 +1009,7 @@ static void print_snapshots(struct smb_snapshot_array *psnap) unsigned long long dce_time; j = 0; strptime(gmt_token, GMT_FORMAT, &tm); - dce_time = mktime(&tm) * 10000000 + NTFS_TIME_OFFSET; + dce_time = timegm(&tm) * 10000000 + NTFS_TIME_OFFSET; printf("\n SMB3:%lld ", dce_time); } } -- 2.17.1