1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/examples
Douglas Bagnall b1173444ff examples:winexe: reproducible builds with zero timestamp
Windows Portable Executable files have a timestamp field and a
checksum field. By default the timestamp field is updated to the
current time, which consequently changes the checksum. This makes the
build nondeterministic. It looks like this:

  --- a/tmp/winexe-1/winexesvc64_exe_binary.c
  +++ b/tmp/winexe-2/winexesvc64_exe_binary.c
  @@ -23,7 +23,7 @@ const DATA_BLOB *winexesvc64_exe_binary(void)
                0x6D, 0x6F, 0x64, 0x65, 0x2E, 0x0D, 0x0D, 0x0A,
                0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x50, 0x45, 0x00, 0x00, 0x64, 0x86, 0x0A, 0x00,
  -             0xB2, 0x16, 0x55, 0x66, 0x00, 0x00, 0x00, 0x00,
  +             0xD3, 0x3B, 0x55, 0x66, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x2E, 0x02,
                0x0B, 0x02, 0x02, 0x26, 0x00, 0x86, 0x00, 0x00,
                0x00, 0xBA, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00,
  @@ -33,7 +33,7 @@ const DATA_BLOB *winexesvc64_exe_binary(void)
                0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x40, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00,
  -             0x73, 0xD7, 0x00, 0x00, 0x03, 0x00, 0x60, 0x01,
  +             0x94, 0xFC, 0x00, 0x00, 0x03, 0x00, 0x60, 0x01,
                0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,

https://learn.microsoft.com/en-us/windows/win32/debug/pe-format says
that a timestamp of zero can be used to represent a time that is not
"real or meaningful", so we do that.

As far as I can tell, the timestamp and checksum are only used in
DLLs, not directly executed .exe files.

Thanks to Freexian and the Debian LTS project for sponsoring this work.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13213

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e604f75751)
2024-06-10 13:24:16 +00:00
..
ad-bench examples: Reformat shell scripts 2022-02-22 16:20:58 +00:00
auth/crackcheck auth3: Remove auth_skel.c 2021-04-19 18:18:31 +00:00
autofs
dce-dfs examples: Make codespell happy 2023-07-13 05:41:36 +00:00
fuse examples: Expand IS_DOS_DIR() macros 2023-10-10 23:23:40 +00:00
LDAP examples: Fix spelling 2023-04-11 09:06:35 +00:00
libsmbclient examples: Enable posix for teststat 2023-10-12 16:55:34 +00:00
logon examples: Fix invalid escape sequences 2023-10-13 03:50:31 +00:00
misc misc: fix AD trust attributes in adssearch 2019-09-20 01:14:42 +00:00
nss
pam_winbind examples: Fix code spelling 2023-03-28 09:33:31 +00:00
pcap2nbench examples: Fix code spelling 2023-03-28 09:33:31 +00:00
pdb
perfcounter lib/replace: Do not typedef int bool 2022-03-23 12:31:47 +00:00
printer-accounting examples: Fix code spelling 2023-03-28 09:33:31 +00:00
printing examples: Fix shellcheck error in VampireDriversFunctions 2022-08-17 10:08:35 +00:00
scripts examples/scripts: add smbXsrvdump 2024-01-09 10:21:34 +00:00
systemtap examples: Update winbind.stp 2022-05-19 17:51:33 +00:00
VFS examples: Fix code spelling 2023-10-25 22:23:37 +00:00
winexe examples:winexe: reproducible builds with zero timestamp 2024-06-10 13:24:16 +00:00
README docs: Point to wiki Contribute page rather than samba-technical 2020-06-12 22:11:43 +00:00
smb.conf.default examples: Improve comment in smb.conf.default 2023-03-28 09:33:31 +00:00

Copyright(C) Samba-Team 1993-2001

This directory contains example config files and related material for
Samba. 

At a minimum please refer to the smb.conf.default file for current
information regarding global and share parameter settings.

To contribute to Samba see: https://wiki.samba.org/index.php/Contribute