diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-08-01 15:35:32 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-08-03 14:25:50 +1000 |
commit | 463ab48868e917b1ccad22bfb5c3c101b6c44e7b (patch) | |
tree | 3f698ccc719a90a6d3bf798c9f4f47dd5bfdb68d /source4 | |
parent | 0c8d74299234b50c8705d7700da325146cf9a5fe (diff) | |
download | samba-463ab48868e917b1ccad22bfb5c3c101b6c44e7b.tar.gz samba-463ab48868e917b1ccad22bfb5c3c101b6c44e7b.tar.bz2 samba-463ab48868e917b1ccad22bfb5c3c101b6c44e7b.zip |
s4-policy: Add python wrapper for ads_to_dir_access_mask() function
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/policy/pypolicy.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source4/lib/policy/pypolicy.c b/source4/lib/policy/pypolicy.c index 3f302e6764..8a9aa47f1f 100644 --- a/source4/lib/policy/pypolicy.c +++ b/source4/lib/policy/pypolicy.c @@ -108,11 +108,26 @@ static PyObject *py_get_gplink_options(PyObject *self, PyObject *args) return py_ret; } +static PyObject *py_ads_to_dir_access_mask(PyObject *self, PyObject *args) +{ + uint32_t access_mask, dir_mask; + + if (! PyArg_ParseTuple(args, "I", &access_mask)) + return NULL; + + dir_mask = gp_ads_to_dir_access_mask(access_mask); + + return Py_BuildValue("I", dir_mask); +} + + static PyMethodDef py_policy_methods[] = { { "get_gpo_flags", (PyCFunction)py_get_gpo_flags, METH_VARARGS, "get_gpo_flags(flags) -> list" }, - { "get_gplink_options", (PyCFunction)py_get_gplink_options, METH_VARARGS, - "get_gplink_options(options) -> list" }, + { "get_gplink_options", (PyCFunction)py_get_gplink_options, METH_VARARGS, + "get_gplink_options(options) -> list" }, + { "ads_to_dir_access_mask", (PyCFunction)py_ads_to_dir_access_mask, METH_VARARGS, + "ads_to_dir_access_mask(access_mask) -> dir_mask" }, { NULL } }; |