diff options
author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-06-30 09:14:12 +0200 |
---|---|---|
committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-06-30 09:14:12 +0200 |
commit | dcca51525ab4994cb8c1232e9698a534109288db (patch) | |
tree | bf514895323c86de40989b5bc73954f8515c151f /lib/Python/PyABRTUtils.cpp | |
parent | a0c9339e53a2e9c2d340aeecadd00fbc62e8443b (diff) | |
download | abrt-dcca51525ab4994cb8c1232e9698a534109288db.tar.gz abrt-dcca51525ab4994cb8c1232e9698a534109288db.tar.xz abrt-dcca51525ab4994cb8c1232e9698a534109288db.zip |
fixed security issue
User can read only his debugdump directories
Diffstat (limited to 'lib/Python/PyABRTUtils.cpp')
-rw-r--r-- | lib/Python/PyABRTUtils.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Python/PyABRTUtils.cpp b/lib/Python/PyABRTUtils.cpp index 9ce5a38f..e56ba076 100644 --- a/lib/Python/PyABRTUtils.cpp +++ b/lib/Python/PyABRTUtils.cpp @@ -59,7 +59,7 @@ typedef struct { PyObject_HEAD CDebugDump *obj; } PyCDebugDump; - + extern PyTypeObject PyCDebugDump_Type; @@ -74,7 +74,7 @@ static int _wrap_PyCDebugDump__tp_init(PyCDebugDump *self, PyObject *args, PyObject *kwargs) { const char *keywords[] = {NULL}; - + if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) { return -1; } @@ -87,7 +87,7 @@ PyObject * _wrap_PyCDebugDump_Close(PyCDebugDump *self) { PyObject *py_retval; - + self->obj->Close(); Py_INCREF(Py_None); py_retval = Py_None; @@ -100,9 +100,10 @@ _wrap_PyCDebugDump_Create(PyCDebugDump *self, PyObject *args, PyObject *kwargs) { PyObject *py_retval; char *pFilename2; - const char *keywords[] = {"pFilename", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s", (char **) keywords, &pFilename2)) { + char *pUID2; + const char *keywords[] = {"pFilename", "pUID", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ss", (char **) keywords, &pFilename2, &pUID2)) { return NULL; } self->obj->Create(pFilename2); @@ -119,7 +120,7 @@ _wrap_PyCDebugDump_SaveText(PyCDebugDump *self, PyObject *args, PyObject *kwargs char *pName2; char *pData2; const char *keywords[] = {"pName", "pData", NULL}; - + if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ss", (char **) keywords, &pName2, &pData2)) { return NULL; } @@ -148,7 +149,7 @@ _wrap_PyCDebugDump__tp_dealloc(PyCDebugDump *self) static PyObject* _wrap_PyCDebugDump__tp_richcompare (PyCDebugDump *self, PyCDebugDump *other, int opid) { - + if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyCDebugDump_Type)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; |