unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob dceaefe668a1f04c8312a8a7da3c42d1b53c3d8f 1083 bytes (raw)
name: gnu/packages/patches/nvi-lfs.patch 	 # note: path name is non-authoritative(*)

 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
 
This patch originates from the Debian project, see https://www.debian.org/

08lfs.dpatch by  <hesso@pool.math.tu-berlin.de>


Insert a safety check to save large files from being overwritten.

diff -Naur nvi-1.81.6.orig/common/exf.c nvi-1.81.6/common/exf.c
--- nvi-1.81.6.orig/common/exf.c	2007-11-18 17:41:42.000000000 +0100
+++ nvi-1.81.6/common/exf.c	2008-05-01 18:09:55.000000000 +0200
@@ -157,6 +157,18 @@
 	 */
 	if (file_spath(sp, frp, &sb, &exists))
 		return (1);
+        /*
+         * On LFS systems, it's possible that stat returned an error because
+         * the file is >2GB, which nvi would normally treat as "doesn't exist"
+         * and eventually overwrite. That's no good. Rather than mess with
+         * every stat() call in file_spath, we'll just check again here.
+         */
+        if (!exists && stat(frp->name, &sb)) {
+            if (errno == EOVERFLOW) {
+                msgq(sp, M_ERR,  "File too large (>2GB, probably)");
+                goto err;
+            }
+        }
 
 	/*
 	 * Check whether we already have this file opened in some

debug log:

solving dceaefe ...
found dceaefe in https://yhetil.org/guix-devel/54BE9C68.9070103@gmail.com/

applying [1/1] https://yhetil.org/guix-devel/54BE9C68.9070103@gmail.com/
diff --git a/gnu/packages/patches/nvi-lfs.patch b/gnu/packages/patches/nvi-lfs.patch
new file mode 100644
index 0000000..dceaefe

1:18: space before tab in indent.
 	 */
1:19: space before tab in indent.
 	if (file_spath(sp, frp, &sb, &exists))
1:20: space before tab in indent.
 		return (1);
1:33: trailing whitespace.
 
1:34: space before tab in indent.
 	/*
Checking patch gnu/packages/patches/nvi-lfs.patch...
Applied patch gnu/packages/patches/nvi-lfs.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 dceaefe668a1f04c8312a8a7da3c42d1b53c3d8f	gnu/packages/patches/nvi-lfs.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).