[PATCH 3/8] pyutil: add INTEGER_TO_PY as BUP_LONGISH_TO_PY

2023-05-30 Thread Rob Browning
Change to longish to hint that it only handles up to long (long)s. Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_helpers.c | 47 ++ src/bup/pyutil.h | 7 +++ 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/li

[PATCH 0/8] Move py C utility code to pyutil; guard overflow

2023-05-30 Thread Rob Browning
Proposed for main. This starts moving some of the utility functions to src/bup/pyutil.*, so that we can use them everywhere, e.g. hashsplit, bupsplit... Rob Browning (8): bup_shared_cflags: add -Winline Create src/pyutil.c for utility functions pyutil: add INTEGER_TO_PY as BUP_LONGISH_TO_PY

[PATCH 1/8] bup_shared_cflags: add -Winline

2023-05-30 Thread Rob Browning
Signed-off-by: Rob Browning Tested-by: Rob Browning --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 6300acf6c..d762f32b7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -43,7 +43,7 @@ os := $(call shout,$(os),Unable to determine O

[PATCH 2/8] Create src/pyutil.c for utility functions

2023-05-30 Thread Rob Browning
Signed-off-by: Rob Browning --- GNUmakefile| 2 +- lib/bup/_helpers.c | 29 ++--- src/bup/pyutil.c | 37 + src/bup/pyutil.h | 4 4 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 src/bup/pyutil.c

[PATCH 6/8] _helpers: remove vestigial py2 utimes related code

2023-05-30 Thread Rob Browning
Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_helpers.c | 180 - 1 file changed, 180 deletions(-) diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index 2ca4ef839..9bfb5e35a 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers

[PATCH 8/8] Reject bup_getpwuid bup_getgrgid argument overflow

2023-05-30 Thread Rob Browning
Replace PyArg_ParseTuple "K" checks (which ignore overflow) with BUP_ASSIGN_PYLONG_TO_INTEGRAL. Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_helpers.c | 25 - src/bup/pyutil.h | 4 ++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git

[PATCH 5/8] pyutil: add BUP_ASSIGN_PYLONG_TO_INTEGRAL; use EXPR_SIGNED

2023-05-30 Thread Rob Browning
Check EXPR_SIGNED to simplify the handling, i.e. we know which path we're on up front. Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_helpers.c | 43 --- src/bup/pyutil.h | 39 +++ 2 files changed, 4

[PATCH 4/8] pyutil: add bup_uint_from_py bup_ulong_from_py bup_ullong_from_py

2023-05-30 Thread Rob Browning
Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_helpers.c | 58 -- src/bup/pyutil.c | 56 src/bup/pyutil.h | 4 3 files changed, 60 insertions(+), 58 deletions(-) diff --git a/lib

[PATCH 7/8] HashSplitter_init: guard against bits/fanbits overflow

2023-05-30 Thread Rob Browning
Replace PyArg_ParseTuple "I" conversion (which ignores overflow) with bup_uint_from_py. Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_hashsplit.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/bup/_hashsplit.c b/lib/bup/_hashsplit.c in

Re: [PATCH 0/8] Move py C utility code to pyutil; guard overflow

2023-05-30 Thread Rob Browning
Rob Browning writes: > Proposed for main. > > This starts moving some of the utility functions to src/bup/pyutil.*, > so that we can use them everywhere, e.g. hashsplit, bupsplit... Apologies. Clearly the wrong git send-email address. -- Rob Browning rlb @defaultvalue.org and @debian.org GPG