Python bindings for keytab manipulation

Matthieu Patou mat at
Mon Feb 14 03:02:48 MST 2011

Hi Jelmer,

Following our talk on IRC you pointed the following points
1) why is loadkeytab not a method on Krb5Keytab ?
2) please don't copy the SIGINT hack into any other python modules
3) __version__  is commonly used for module version strings
4) super() takes the current type object as first argument, rather than 
the parents class object
5) the docstring for your test script refers to xattr :)
6) the module is named krb5 but is shipped with Samba; I think it'd be 
nice to have it upstream (so non-Samba users also get the ability to use 
keytabs from Python) or alternatively moved into the samba module name 
space (samba.keytab)

So  for 1), I would say why not, because the api for me would not be so 
clear if a Keytab object would allow to load a keytab questions like 
what do we do if there is already entries have to be decided and I think 
that it can lead to mistake.
2) Done, note that I copy it from other modules like glue I guess, maybe 
it can be worth to specify in this modules that it's a hack and that it 
should not be reused
3) version -> __version__ it's fixed I copy it also so the change can be 
done as well in other modules
4) Sorry my mistake, was pretty sure that you had to put the parent class
5) Fixed
6) Ok so I put it in the samba architecture under the krb5 namespace as 
potentially there is also keytab for kerberos4, it could be named 
kerberos5 if we want to avoid confusion with heimdal. I chose to put in 
the samba namespace as we will need soon more samba function to dig 
information form the samdb.

The last version is here:;a=shortlog;h=refs/heads/misc_review


Matthieu Patou
Samba Team
Private repo;a=summary

More information about the samba-technical mailing list