Prechádzať zdrojové kódy

dpkg-split: Truncate the output file when splitting a package

Use creat() instead of open() with the missing O_TRUNC.

Regression introduced in f2115151c19ff37b305296c23225807b0832086b.
Guillem Jover 15 rokov pred
rodič
commit
e70589e47f
2 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 4 0
      debian/changelog
  2. 1 1
      dpkg-split/split.c

+ 4 - 0
debian/changelog

@@ -1,5 +1,9 @@
 dpkg (1.15.8.8) UNRELEASED; urgency=low
 
+  [ Guillem Jover ]
+  * Truncate the output part file on “dpkg-split -s”. Regression introduced
+    with the C rewrite.
+
   [ Updated man page translations ]
   * Two typos fixed in French (Christian Perrier, thanks to Julien
     Valroff).

+ 1 - 1
dpkg-split/split.c

@@ -196,7 +196,7 @@ mksplit(const char *file_src, const char *prefix, size_t partsize,
 		}
 
 		/* Split the data. */
-		fd_dst = open(file_dst.buf, O_CREAT | O_WRONLY, 0644);
+		fd_dst = creat(file_dst.buf, 0644);
 		if (fd_dst < 0)
 			ohshite(_("unable to open file '%s'"), file_dst.buf);