aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2006-07-16 14:53:23 +0200
committerWilly Tarreau <willy@wtap.(none)>2006-07-26 11:51:23 +0200
commitf179c4f810adddd808eddf0312cdb08673824ac2 (patch)
treef96b4c5521a74a06a41e07a2c1624402e555e337
parent[RELEASE] flxutils-0.1.11.3 (diff)
downloadflxutils-f179c4f810adddd808eddf0312cdb08673824ac2.tar.xz
[RELEASE] flxutils-0.1.12v0.1.12
-rw-r--r--flx/ChangeLog2
-rw-r--r--flx/Makefile2
-rw-r--r--flx/TODO4
-rw-r--r--flx/fct1.c11
-rw-r--r--init/init.c5
-rwxr-xr-xscripts/mkinstall22
6 files changed, 18 insertions, 8 deletions
diff --git a/flx/ChangeLog b/flx/ChangeLog
index 50da2b5..5397930 100644
--- a/flx/ChangeLog
+++ b/flx/ChangeLog
@@ -1,3 +1,5 @@
+2003/06/05 : Version 0.6.7
+- segfault on /proc directory : size_t -> ssize_t
2003/01/04 : Version 0.6.6c
- Before a crash disk, I
2001/12/23 : Version 0.3
diff --git a/flx/Makefile b/flx/Makefile
index a84b701..214385f 100644
--- a/flx/Makefile
+++ b/flx/Makefile
@@ -26,7 +26,7 @@
NAME=flx
-VERSION=0.6.6e
+VERSION=0.6.7
SRC=main.c arg.c utils.c md5.c flx.c fct1.c check.c sign.c \
input.c input_fs.c input_file.c \
output.c output_file.c
diff --git a/flx/TODO b/flx/TODO
index 8f7cb18..c7350b9 100644
--- a/flx/TODO
+++ b/flx/TODO
@@ -1,3 +1,7 @@
+2003/06/01:
+ - ignore dots : ne pas signer . et .. si ce n'est pas
+ forcé par parametre
+
2002/06/18:
completly change
diff --git a/flx/fct1.c b/flx/fct1.c
index 79378a3..811391a 100644
--- a/flx/fct1.c
+++ b/flx/fct1.c
@@ -224,8 +224,8 @@ int browse_over_path(char *path, PROTO_FS(*fct), void *data) {
/* build an MD5 checksum from data in file */
char *checksum_md5_from_file(char *file) {
int fd;
- size_t size;
- char *checksum_md5 = 0, blk[BUFFER_LENGTH];
+ ssize_t size;
+ char *checksum_md5 = NULL, blk[BUFFER_LENGTH];
MD5_CTX md5_ctx;
if ((fd = open(file, O_RDONLY)) < 0 ) {
@@ -236,8 +236,11 @@ char *checksum_md5_from_file(char *file) {
while ((size = read(fd, blk, BUFFER_LENGTH)) > 0)
MD5_Update(&md5_ctx, blk, size);
close(fd);
- checksum_md5 = MALLOC(16);
- MD5_Final(checksum_md5, &md5_ctx);
+ // if size = -1, there is a read error, don't do anything
+ if (size == 0) { // last read is null
+ checksum_md5 = MALLOC(16);
+ MD5_Final(checksum_md5, &md5_ctx);
+ }
}
return (checksum_md5);
}
diff --git a/init/init.c b/init/init.c
index b73234e..d8d1906 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1528,11 +1528,12 @@ int main(int argc, char **argv, char **envp) {
return 1;
}
else if (res > 0) {
+ int ret;
print("<E>xec(parent) : waiting for termination\n");
- while (wait(&error) != res)
+ while (((ret = wait(&error)) != -1) && (ret != res))
print("<E>xec(parent) : signal received\n");
- error = (WIFEXITED(error) > 0) ? WEXITSTATUS(error) : 1;
+ error = (ret == -1) || ((WIFEXITED(error) > 0) ? WEXITSTATUS(error) : 1);
print("<E>xec(parent) : child exited\n");
}
else {
diff --git a/scripts/mkinstall2 b/scripts/mkinstall2
index ee98736..e23e446 100755
--- a/scripts/mkinstall2
+++ b/scripts/mkinstall2
@@ -1136,7 +1136,7 @@ while [ -n "$action" ] ; do
#fi
menu_pkg_dir
list=( ); idx=0
- for pack in $(cd $PKGDIR && echo *.{prf,tgz}); do
+ for pack in $(shopt -s nullglob ; cd $PKGDIR && echo *.{prf,tgz}); do
list[idx++]=$pack
list[idx++]=""
if [ -z "${pack##[0-9][0-9][0-9]_*}" ]; then