2014-08-22 14:59:24 -03:00
|
|
|
/*[clinic input]
|
|
|
|
preserve
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
#if defined(HAVE_GETSPNAM)
|
|
|
|
|
|
|
|
PyDoc_STRVAR(spwd_getspnam__doc__,
|
|
|
|
"getspnam($module, arg, /)\n"
|
|
|
|
"--\n"
|
|
|
|
"\n"
|
|
|
|
"Return the shadow password database entry for the given user name.\n"
|
|
|
|
"\n"
|
|
|
|
"See `help(spwd)` for more on shadow password database entries.");
|
|
|
|
|
|
|
|
#define SPWD_GETSPNAM_METHODDEF \
|
2015-04-03 18:12:11 -03:00
|
|
|
{"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
|
2014-08-22 14:59:24 -03:00
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 11:35:15 -03:00
|
|
|
spwd_getspnam_impl(PyObject *module, PyObject *arg);
|
2014-08-22 14:59:24 -03:00
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 11:35:15 -03:00
|
|
|
spwd_getspnam(PyObject *module, PyObject *arg_)
|
2014-08-22 14:59:24 -03:00
|
|
|
{
|
|
|
|
PyObject *return_value = NULL;
|
|
|
|
PyObject *arg;
|
|
|
|
|
2018-12-25 07:23:47 -04:00
|
|
|
if (!PyUnicode_Check(arg_)) {
|
2019-08-29 12:29:59 -03:00
|
|
|
_PyArg_BadArgument("getspnam", "argument", "str", arg_);
|
2014-08-22 14:59:24 -03:00
|
|
|
goto exit;
|
2016-06-09 10:16:06 -03:00
|
|
|
}
|
2018-12-25 07:23:47 -04:00
|
|
|
if (PyUnicode_READY(arg_) == -1) {
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
arg = arg_;
|
2014-08-22 14:59:24 -03:00
|
|
|
return_value = spwd_getspnam_impl(module, arg);
|
|
|
|
|
|
|
|
exit:
|
|
|
|
return return_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* defined(HAVE_GETSPNAM) */
|
|
|
|
|
|
|
|
#if defined(HAVE_GETSPENT)
|
|
|
|
|
|
|
|
PyDoc_STRVAR(spwd_getspall__doc__,
|
|
|
|
"getspall($module, /)\n"
|
|
|
|
"--\n"
|
|
|
|
"\n"
|
|
|
|
"Return a list of all available shadow password database entries, in arbitrary order.\n"
|
|
|
|
"\n"
|
|
|
|
"See `help(spwd)` for more on shadow password database entries.");
|
|
|
|
|
|
|
|
#define SPWD_GETSPALL_METHODDEF \
|
|
|
|
{"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 11:35:15 -03:00
|
|
|
spwd_getspall_impl(PyObject *module);
|
2014-08-22 14:59:24 -03:00
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 11:35:15 -03:00
|
|
|
spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
|
2014-08-22 14:59:24 -03:00
|
|
|
{
|
|
|
|
return spwd_getspall_impl(module);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* defined(HAVE_GETSPENT) */
|
|
|
|
|
2015-04-03 17:09:02 -03:00
|
|
|
#ifndef SPWD_GETSPNAM_METHODDEF
|
|
|
|
#define SPWD_GETSPNAM_METHODDEF
|
|
|
|
#endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
|
|
|
|
|
2014-08-22 14:59:24 -03:00
|
|
|
#ifndef SPWD_GETSPALL_METHODDEF
|
|
|
|
#define SPWD_GETSPALL_METHODDEF
|
|
|
|
#endif /* !defined(SPWD_GETSPALL_METHODDEF) */
|
2019-08-29 12:29:59 -03:00
|
|
|
/*[clinic end generated code: output=eec8d0bedcd312e5 input=a9049054013a1b77]*/
|