From e7424de27902be604424183742a8198b0a2f9450 Mon Sep 17 00:00:00 2001 From: bescoto Date: Sun, 19 Jan 2003 09:33:45 +0000 Subject: Fixed segfault bug on openbsd+sparc systems git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-10@263 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/_librsyncmodule.c | 14 +++++++------- rdiff-backup/testing/chdir-wrapper | 2 +- rdiff-backup/testing/chdir-wrapper2 | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 1e14395..00d34d3 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -5,6 +5,9 @@ If get a socket error from trying to create a socket whose name is too long, just skip file instead of exiting with error (original bug report by Ivo De Decker). +Fixed seg fault bug reported by a couple sparc+openbsd users. Thanks +to Dave Steinberg for giving me an account on his system for testing. + New in v0.10.1 (2002/09/16) diff --git a/rdiff-backup/rdiff_backup/_librsyncmodule.c b/rdiff-backup/rdiff_backup/_librsyncmodule.c index 6fca4cc..9b24d6a 100644 --- a/rdiff-backup/rdiff_backup/_librsyncmodule.c +++ b/rdiff-backup/rdiff_backup/_librsyncmodule.c @@ -70,7 +70,7 @@ static PyObject * _librsync_sigmaker_cycle(_librsync_SigMakerObject *self, PyObject *args) { char *inbuf, outbuf[RS_JOB_BLOCKSIZE]; - long inbuf_length; + int inbuf_length; rs_buffers_t buf; rs_result result; @@ -91,7 +91,7 @@ _librsync_sigmaker_cycle(_librsync_SigMakerObject *self, PyObject *args) } return Py_BuildValue("(ils#)", (result == RS_DONE), - inbuf_length - (long)buf.avail_in, + (long)inbuf_length - (long)buf.avail_in, outbuf, RS_JOB_BLOCKSIZE - (long)buf.avail_out); } @@ -168,7 +168,7 @@ _librsync_new_deltamaker(PyObject* self, PyObject* args) { _librsync_DeltaMakerObject* dm; char *sig_string, outbuf[RS_JOB_BLOCKSIZE]; - long sig_length; + int sig_length; rs_job_t *sig_loader; rs_signature_t *sig_ptr; rs_buffers_t buf; @@ -224,7 +224,7 @@ static PyObject * _librsync_deltamaker_cycle(_librsync_DeltaMakerObject *self, PyObject *args) { char *inbuf, outbuf[RS_JOB_BLOCKSIZE]; - long inbuf_length; + int inbuf_length; rs_buffers_t buf; rs_result result; @@ -244,7 +244,7 @@ _librsync_deltamaker_cycle(_librsync_DeltaMakerObject *self, PyObject *args) } return Py_BuildValue("(ils#)", (result == RS_DONE), - inbuf_length - (long)buf.avail_in, + (long)inbuf_length - (long)buf.avail_in, outbuf, RS_JOB_BLOCKSIZE - (long)buf.avail_out); } @@ -360,7 +360,7 @@ static PyObject * _librsync_patchmaker_cycle(_librsync_PatchMakerObject *self, PyObject *args) { char *inbuf, outbuf[RS_JOB_BLOCKSIZE]; - long inbuf_length; + int inbuf_length; rs_buffers_t buf; rs_result result; @@ -380,7 +380,7 @@ _librsync_patchmaker_cycle(_librsync_PatchMakerObject *self, PyObject *args) } return Py_BuildValue("(ils#)", (result == RS_DONE), - inbuf_length - (long)buf.avail_in, + (long)inbuf_length - (long)buf.avail_in, outbuf, RS_JOB_BLOCKSIZE - (long)buf.avail_out); } diff --git a/rdiff-backup/testing/chdir-wrapper b/rdiff-backup/testing/chdir-wrapper index 1d0db7d..6002617 100755 --- a/rdiff-backup/testing/chdir-wrapper +++ b/rdiff-backup/testing/chdir-wrapper @@ -13,4 +13,4 @@ if len(sys.argv) > 1: os.chdir(sys.argv[1]) #PipeConnection(sys.stdin, sys.stdout).Server() #os.system("/home/ben/prog/python/rdiff-backup/rdiff-backup --server") -os.system("/home/ben/prog/python/rdiff-backup/testing/server.py /home/ben/prog/python/rdiff-backup/src") +os.system("/home/ben/prog/python/rdiff-backup/testing/server.py /home/ben/prog/python/rdiff-backup/rdiff_backup") diff --git a/rdiff-backup/testing/chdir-wrapper2 b/rdiff-backup/testing/chdir-wrapper2 index 7fc1312..1a4a283 100755 --- a/rdiff-backup/testing/chdir-wrapper2 +++ b/rdiff-backup/testing/chdir-wrapper2 @@ -12,5 +12,5 @@ import os, sys if len(sys.argv) > 1: os.chdir(sys.argv[1]) #PipeConnection(sys.stdin, sys.stdout).Server() -os.system("/home/ben/prog/python/rdiff-backup/rdiff-backup --server") +os.system("/home/ben/prog/rdiff-backup/rdiff-backup --server") -- cgit v1.2.1