aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/tar-remove-wholesparse-check.patch
blob: 41f53e86aa805a79cb0d5b1363de8c3850b82f7e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
This patch is needed in order to build Guix on a Btrfs file system.


From da922703282b0d3b8837a99a9c7fdd32f1d20d49 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Tue, 9 Jan 2018 20:16:14 -0500
Subject: [PATCH] Remove nonportable check for files containing only zeroes.

This check benefitted only one unlikely case (large files containing
only zeroes, on systems that do not support SEEK_HOLE) and was based
on an assumption about file system behavior that is not mandated by
POSIX and no longer holds in practice, namely that for sufficiently
large files, (st_blocks == 0) implies that the file contains only
zeroes.  Examples of file systems that violate this assumption include
Linux's /proc file system and Btrfs.

* src/sparse.c (sparse_scan_file_wholesparse): Remove this function.
(sparse_scan_file_seek): Remove the initial check for files containing
only zeroes.
---
 src/sparse.c | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/src/sparse.c b/src/sparse.c
index d41c0ea..3de6560 100644
--- a/src/sparse.c
+++ b/src/sparse.c
@@ -261,26 +261,6 @@ sparse_scan_file_raw (struct tar_sparse_file *file)
   return tar_sparse_scan (file, scan_end, NULL);
 }
 
-static bool
-sparse_scan_file_wholesparse (struct tar_sparse_file *file)
-{
-  struct tar_stat_info *st = file->stat_info;
-  struct sp_array sp = {0, 0};
-
-  /* Note that this function is called only for truly sparse files of size >= 1
-     block size (checked via ST_IS_SPARSE before).  See the thread
-     http://www.mail-archive.com/bug-tar@gnu.org/msg04209.html for more info */
-  if (ST_NBLOCKS (st->stat) == 0)
-    {
-      st->archive_file_size = 0;
-      sp.offset = st->stat.st_size;
-      sparse_add_map (st, &sp);
-      return true;
-    }
-
-  return false;
-}
-
 #ifdef SEEK_HOLE
 /* Try to engage SEEK_HOLE/SEEK_DATA feature. */
 static bool
@@ -343,10 +323,6 @@ sparse_scan_file_seek (struct tar_sparse_file *file)
 static bool
 sparse_scan_file (struct tar_sparse_file *file)
 {
-  /* always check for completely sparse files */
-  if (sparse_scan_file_wholesparse (file))
-    return true;
-
   switch (hole_detection)
     {
     case HOLE_DETECTION_DEFAULT:
-- 
2.15.1

ces/avahi.scm (avahi-shepherd-service): Add 'actions' field. * gnu/services/base.scm (nscd-actions): Add call to 'shepherd-configuration-action'. * gnu/services/desktop.scm (upower-shepherd-service): Add 'actions' field. (elogind-shepherd-service): Likewise. * gnu/services/dict.scm (dicod-shepherd-service): Likewise. * gnu/services/networking.scm (openntpd-shepherd-service): Likewise. (tor-shepherd-service): Likewise. * gnu/services/ssh.scm (openssh-shepherd-service): Likewise. * gnu/services/web.scm (nginx-shepherd-service): Likewise. * gnu/services/xorg.scm (gdm-shepherd-service): Likewise. * gnu/tests/base.scm (run-basic-test)["nscd configuration action"]: New test. * doc/guix.texi (Services): Document it. Ludovic Courtès 2022-07-01services: openssh: Listen on IPv6 only when IPv6 is supported....Fixes <https://issues.guix.gnu.org/56327>. Reported by André Batista <nandre@riseup.net>. * gnu/services/ssh.scm (openssh-shepherd-service)[ipv6-support?]: New variable. Use it in 'start' method. Ludovic Courtès 2022-05-26services: openssh: Remove authorized_keys.d before copying the new one....Fixes <https://issues.guix.gnu.org/55661>. * gnu/services/ssh.scm (openssh-activation): Fix typo in 'delete-file-recursively' call. Ludovic Courtès 2022-05-26services: openssh: Fix computation of the authorized-key directory....Fixes a bug introduced in 1f29ed4a812f86c45e2d9c37fd9f80f6d0418293, whereby 'authorized-key-directory' would end up creating empty files for authorized keys passed as an extension. See <https://issues.guix.gnu.org/55359>. * gnu/services/ssh.scm (extend-openssh-authorized-keys): Call 'alist->vhash' on the alist resulting from the 'append' call. Ludovic Courtès 2022-05-26services: ssh: Fix extend-openssh-authorized-keys....Fixes #55359. * gnu/services/ssh.scm (extend-openssh-authorized-keys): Use KEYS argument. Oleg Pykhalov 2022-05-22services: openssh: Listen on both IPv4 and IPv6....Fixes <https://issues.guix.gnu.org/55335>. Reported by Christopher Baines <mail@cbaines.net>. * gnu/services/ssh.scm (openssh-shepherd-service)[inetd-style?]: New variable. <start>: Use it. When using 'make-inetd-constructor', pass a list of endpoints as is possible with the Shepherd 0.9.1. <stop>: Adjust accordingly. * gnu/tests/ssh.scm (run-ssh-test)["wait for port 22"]: Rename to... ["wait for port 22, IPv4"]: ... this. ["wait for port 22, IPv6"]: New test. Ludovic Courtès 2022-04-07services: openssh: Start as an inetd service....* gnu/services/ssh.scm (openssh-shepherd-service): Use 'make-inetd-constructor' when it is defined. (<openssh-configuration>)[max-connections]: New field. * gnu/tests/ssh.scm (run-ssh-test)["sshd PID"]: Adjust to cope with PID-FILE being #f. * gnu/tests/ssh.scm (%test-openssh): Pass #f as the 'pid-file' argument. * doc/guix.texi (Networking Services): Document 'max-connections'. Ludovic Courtès 2022-03-10services: openssh: Change 'authorized-keys' accessor name....* gnu/services/ssh.scm (<openssh-configuration>)[authorized-keys]: Rename accessor to 'openssh-configuration-authorized-keys'. (openssh-activation, extend-openssh-authorized-keys): Adjust accordingly. Ludovic Courtès 2022-03-10services: openssh: Add 'generate-host-keys?' field....* gnu/services/ssh.scm (<openssh-configuration>)[generate-host-keys?]: New field. (openssh-activation): Honor it. * doc/guix.texi (Networking Services): Document it. Ludovic Courtès 2021-11-30services: Accept <inferior-package>s in lieu of <package>s....* gnu/services/authentication.scm (fprintd-configuration) (nslcd-configuration): Substitute file-like objects for package ones. * gnu/services/cgit.scm (cgit-configuration, opaque-cgit-configuration): Likewise. * gnu/services/cups.scm (package-list?, cups-configuration): Likewise. * gnu/services/dns.scm (verify-knot-configuration) (ddclient-configuration): Likewise. * gnu/services/docker.scm (docker-configuration): Likewise. * gnu/services/file-sharing.scm (transmission-daemon-configuration): Likewise. * gnu/services/getmail.scm (getmail-configuration): Likewise. * gnu/services/mail.scm (dovecot-configuration) (opaque-dovecot-configuration): Likewise. * gnu/services/messaging.scm (prosody-configuration) (opaque-prosody-configuration): Likewise. * gnu/services/monitoring.scm (zabbix-server-configuration) (zabbix-agent-configuration): Likewise. * gnu/services/networking.scm (opendht-configuration): Likewise. * gnu/services/pm.scm (tlp-configuration): Likewise. * gnu/services/telephony.scm (jami-configuration): Likewise. * gnu/services/virtualization.scm (libvirt-configuration) (qemu-guest-agent-configuration): Likewise. * gnu/services/vpn.scm (openvpn-client-configuration): Likewise. Tobias Geerinckx-Rice 2021-11-16services: openssh: Collect all keys for all users....Fixes <https://issues.guix.gnu.org/51487> * gnu/services/ssh.scm (extend-openssh-authorized-keys): ensure that no key is forgotten. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Vivien Kraus