auth/pycreds/encrypt_netr_crypt_password: don't pretend arg is optional
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 9 Jul 2019 11:07:18 +0000 (23:07 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 22 Jul 2019 22:20:26 +0000 (22:20 +0000)
The "|O" signature is saying the password argument is optional, which
makes no sense in terms of the funxtion and immediately leads to a
TypeError (or until last commit, segfault). Removing the "|" leaves it
with a TypeError, but it is better worded and faster.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/credentials/pycredentials.c

index 91e9276473db8fd51aac9443014fdf08c8f85d15..446f30970a2f68c9d0bf1081e93afedb5396f6ef 100644 (file)
@@ -906,7 +906,7 @@ static PyObject *py_creds_encrypt_netr_crypt_password(PyObject *self,
                return NULL;
        }
 
-       if (!PyArg_ParseTuple(args, "|O", &py_cp)) {
+       if (!PyArg_ParseTuple(args, "O", &py_cp)) {
                return NULL;
        }