summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>1999-05-18 19:37:37 +0000
committerjmg <jmg@FreeBSD.org>1999-05-18 19:37:37 +0000
commit09c8cd859c3b5e4f1eaab92d81ef7af43c7f3bf8 (patch)
treea307d50c35792b327f47d84b10e5dbfdc34e95b5
parent9f72a57de7c7e4b921133b7f3c42406b816992ef (diff)
downloadFreeBSD-src-09c8cd859c3b5e4f1eaab92d81ef7af43c7f3bf8.zip
FreeBSD-src-09c8cd859c3b5e4f1eaab92d81ef7af43c7f3bf8.tar.gz
make md5 checksums actually work instead of simply calculating the length
of an empty buffer... the output file wasn't readable... also warn that we can't checksum on stdout and print out the base64 encoded version of the md5 checksum... Site to actually return md5 digest: web.golux.com Verified that fetch was broken: Ken Coar <Ken.Coar@Golux.Com>
-rw-r--r--usr.bin/fetch/http.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/fetch/http.c b/usr.bin/fetch/http.c
index 815cc7d..7851b38 100644
--- a/usr.bin/fetch/http.c
+++ b/usr.bin/fetch/http.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: http.c,v 1.25 1999/02/03 20:24:53 fenner Exp $
+ * $Id: http.c,v 1.26 1999/02/23 18:51:13 wollman Exp $
*/
#include <sys/types.h>
@@ -1006,7 +1006,7 @@ spewerror:
if (to_stdout)
local = fopen("/dev/stdout", restarting ? "a" : "w");
else
- local = fopen(fs->fs_outputfile, restarting ? "a" : "w");
+ local = fopen(fs->fs_outputfile, restarting ? "a+" : "w+");
if (local == 0) {
warn("%s: fopen", fs->fs_outputfile);
fclose(remote);
@@ -1048,7 +1048,11 @@ spewerror:
*/
fseek(local, restart_from, SEEK_SET);
fs->fs_status = "computing MD5 message digest";
- status = check_md5(local, base64ofmd5);
+ if (!to_stdout)
+ status = check_md5(local, base64ofmd5);
+ else
+ warnx("can't check md5 digest on stdout: %s",
+ base64ofmd5);
free(base64ofmd5);
}
OpenPOWER on IntegriCloud