Otherwise (a) it was pointless trying to set a default, and (b) you get
an error when you try to set KEXP_FOREVER explicitly. Effectively it
was impossible to make keys which never expire.
PyObject *kfobj;
uint32 id;
char *type;
PyObject *kfobj;
uint32 id;
char *type;
- long exptime = KEXP_FOREVER;
+ unsigned long exptime = KEXP_FOREVER;
static char *kwlist[] = { "keyfile", "id", "type", "exptime", 0 };
key *k;
int err;
static char *kwlist[] = { "keyfile", "id", "type", "exptime", 0 };
key *k;
int err;
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!O&sl:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!O&s|O&:new", kwlist,
keyfile_pytype, &kfobj, convu32, &id,
keyfile_pytype, &kfobj, convu32, &id,
+ &type, convulong, &exptime))
goto end;
if ((err = key_new(KEYFILE_KF(kfobj), id, type, exptime, &k)) != 0)
KEYERR(err);
goto end;
if ((err = key_new(KEYFILE_KF(kfobj), id, type, exptime, &k)) != 0)
KEYERR(err);