The following commit has been merged in the master branch:
commit 2a7cbd9bbad67021e447068521fd60d42e02cb46
Author: Guillem Jover <[email protected]>
Date: Mon Jul 13 02:44:48 2009 +0200
dpkg-split: Properly check error condition on open when splitting
diff --git a/dpkg-split/split.c b/dpkg-split/split.c
index 6243851..af8a989 100644
--- a/dpkg-split/split.c
+++ b/dpkg-split/split.c
@@ -62,7 +62,8 @@ void do_split(const char *const *argv) {
sprintf(partsizebuf,"%ld",maxpartsize-HEADERALLOWANCE);
sprintf(partsizeallowbuf,"%ld",maxpartsize);
fd= open(sourcefile,O_RDONLY);
- if (!fd) ohshite(_("unable to open source file `%.250s'"),sourcefile);
+ if (fd < 0)
+ ohshite(_("unable to open source file `%.250s'"), sourcefile);
if (fstat(fd,&stab)) ohshite(_("unable to fstat source file"));
if (!S_ISREG(stab.st_mode)) ohshit(_("source file `%.250s' not a plain
file"),sourcefile);
sprintf(lengthbuf,"%lu",(unsigned long)stab.st_size);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]