summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-08-28 20:33:06 +0000
committerjbj <devnull@localhost>2001-08-28 20:33:06 +0000
commit46713343fb02fe669de4ff879e1e3477746c05d1 (patch)
tree534edda7ded70c2792a4f29e8bd178c5cc183aae /python
parent64a1d1afdcfce7b401f02eb19e268cd3562ef1ac (diff)
downloadlibrpm-tizen-46713343fb02fe669de4ff879e1e3477746c05d1.tar.gz
librpm-tizen-46713343fb02fe669de4ff879e1e3477746c05d1.tar.bz2
librpm-tizen-46713343fb02fe669de4ff879e1e3477746c05d1.zip
- dependency whiteout for libgnomeprint -> gnome-print (ordering only).
- dependency whiteout for nautilus -> nautilus-mozilla (ordering only). CVS patchset: 5035 CVS date: 2001/08/28 20:33:06
Diffstat (limited to 'python')
-rw-r--r--python/rpmmodule.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
index 3a98e8324..901bd9621 100644
--- a/python/rpmmodule.c
+++ b/python/rpmmodule.c
@@ -447,11 +447,10 @@ static void mungeFilelist(Header h)
/**
*/
-static PyObject * rhnUnload(PyObject * self, PyObject * args) {
+static PyObject * rhnUnload(hdrObject * s, PyObject * args) {
int len;
char * uh;
PyObject * rc;
- hdrObject *s;
Header h;
if (!PyArg_ParseTuple(args, ""))
@@ -516,7 +515,7 @@ static struct PyMethodDef hdrMethods[] = {
{"expandFilelist", (PyCFunction) hdrExpandFilelist, 1 },
{"compressFilelist", (PyCFunction) hdrCompressFilelist, 1 },
{"fullFilelist", (PyCFunction) hdrFullFilelist, 1 },
- {"rhnUnload", (PyCFunction) rhnUnload, 1 },
+ {"rhnUnload", (PyCFunction) rhnUnload, METH_VARARGS },
{NULL, NULL} /* sentinel */
};
@@ -1851,12 +1850,12 @@ static PyObject * hdrLoad(PyObject * self, PyObject * args) {
if (!PyArg_ParseTuple(args, "s#", &obj, &len)) return NULL;
+ /* malloc is needed to avoid surprises from data swab in headerLoad(). */
copy = malloc(len);
if (copy == NULL) {
PyErr_SetString(pyrpmError, "out of memory");
return NULL;
}
-
memcpy (copy, obj, len);
hdr = headerLoad(copy);
@@ -1888,12 +1887,12 @@ static PyObject * rhnLoad(PyObject * self, PyObject * args) {
if (!PyArg_ParseTuple(args, "s#", &obj, &len)) return NULL;
+ /* malloc is needed to avoid surprises from data swab in headerLoad(). */
copy = malloc(len);
if (copy == NULL) {
PyErr_SetString(pyrpmError, "out of memory");
return NULL;
}
-
memcpy (copy, obj, len);
hdr = headerLoad(copy);
@@ -1903,13 +1902,16 @@ static PyObject * rhnLoad(PyObject * self, PyObject * args) {
}
headerAllocated(hdr);
+ /* XXX avoid the false OK's from rpmverifyDigest() with missing tags. */
if (!headerIsEntry(hdr, RPMTAG_HEADERIMMUTABLE)) {
PyErr_SetString(pyrpmError, "bad header, not immutable");
headerFree(hdr);
return NULL;
}
- if (!headerIsEntry(hdr, RPMTAG_SHA1HEADER)) {
+ /* XXX avoid the false OK's from rpmverifyDigest() with missing tags. */
+ if (!headerIsEntry(hdr, RPMTAG_SHA1HEADER)
+ && !headerIsEntry(hdr, RPMTAG_SHA1RHN)) {
PyErr_SetString(pyrpmError, "bad header, no digest");
headerFree(hdr);
return NULL;