diff options
Diffstat (limited to 'source3/python')
-rw-r--r-- | source3/python/py_conv.c | 25 | ||||
-rw-r--r-- | source3/python/py_conv.h | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/source3/python/py_conv.c b/source3/python/py_conv.c index 39b20ace86..20302c83e8 100644 --- a/source3/python/py_conv.c +++ b/source3/python/py_conv.c @@ -68,7 +68,32 @@ PyObject *from_struct(void *s, struct pyconv *conv) break; } + case PY_STRING: { + char *str = (char *)s + conv[i].offset; + + item = PyString_FromString(str); + PyDict_SetItemString(obj, conv[i].name, item); + + break; + } + case PY_UID: { + uid_t *uid = (uid_t *)((char *)s + conv[i].offset); + + item = PyInt_FromLong(*uid); + PyDict_SetItemString(obj, conv[i].name, item); + + break; + } + case PY_GID: { + gid_t *gid = (gid_t *)((char *)s + conv[i].offset); + + item = PyInt_FromLong(*gid); + PyDict_SetItemString(obj, conv[i].name, item); + + break; + } default: + break; } } diff --git a/source3/python/py_conv.h b/source3/python/py_conv.h index ed06b9a852..24f5a66287 100644 --- a/source3/python/py_conv.h +++ b/source3/python/py_conv.h @@ -21,7 +21,7 @@ #ifndef _PY_CONV_H #define _PY_CONV_H -enum pyconv_types { PY_UNISTR, PY_UINT32, PY_UINT16 }; +enum pyconv_types { PY_UNISTR, PY_UINT32, PY_UINT16, PY_STRING, PY_UID, PY_GID }; struct pyconv { char *name; /* Name of member */ |