GithubHelp home page GithubHelp logo

python-kadmin's Introduction

python-kadmin

Python module for kerberos admin (kadm5)

Initilization

kadmin

import kadmin

kadm = kadmin.init_with_keytab("user/[email protected]", "/path/to/keytab")
kadm = kadmin.init_with_ccache("user/[email protected]", "/path/to/krb5cc")
kadm = kadmin.init_with_password("user/[email protected]", "aStrongPassword")

kadmin_local

used for direct database access as local root account.

import kadmin_local as kadmin

kadm = kadmin.local();

* kadmin_local also supports the other init_with_<method> initializers whereas kadmin does not support local. It is advised that kadmin_local is used for rapid unpacked iteration, other tasks should be handled by the gssapi connection.

##Examples:

###Principal Creation:

>>> 
>>> # ank, addprinc, add_principal are all aliases for principal creation
>>> # omitting a password or setting to None results in a randomized key
>>> # kadm.ank(principal [, password|None] [, db_args=db_args])
>>> 
>>> kadm.ank("[email protected]", "correcthorsebatterysaple")
>>> kadm.addprinc("[email protected]", None)
>>> # 
>>> kadm.add_principal("[email protected]", None, db_args={'dn':'uid=user,ou=people,dc=example,dc=com'})
>>>

###Principal Attributes:

>>> princ = kadm.getprinc("[email protected]")
>>>
>>> # getters only
>>> princ.principal
>>> # get: unicode
>>>
>>> princ.name
>>> # get: unicode
>>>
>>> princ.mod_name
>>> # get: unicode
>>>
>>> princ.mod_date
>>> # get: datetime.datetime
>>>
>>> princ.last_pwd_change
>>> # get: [datetime.datetime|None]
>>>
>>> princ.last_success
>>> # get: [datetime.datetime|None]
>>>
>>> princ.last_failure
>>> # get: [datetime.datetime|None]
>>>
>>>
>>> #getters & setters
>>> princ.expire = datetime.datetime(2014, 12, 25)
>>> # get: datetime.datetime
>>> # set: [str|unicode|datetime.datetime|None]
>>>
>>> princ.pwexpire = u'Now'
>>> # get: datetime.datetime
>>> # set: [str|unicode|datetime.datetime|None]
>>>
>>> princ.maxlife = "8 Days"
>>> # get: datetime.timedelta
>>> # set: [str|unicode|datetime.timedelta|None]
>>>
>>> princ.maxrenewlife = datetime.timedelta(days=2)
>>> # get: datetime.timedelta
>>> # set: [str|unicode|datetime.timedelta|None]
>>>
>>> princ.policy = "strong_password_policy"
>>> # get: unicode
>>> # set: [str|unicode|kadmin.Policy]
>>>
>>> princ.kvno = 1
>>> # get: int
>>> # set: [int]
>>>
>>> # at this point the local copy of the principal is modified
>>> #  the remote will not change until commit is called as shown
>>> princ.commit()
>>>
>>> # for an existing principal object discard local state and
>>> #  fetch the state as it appears in the database
>>> princ.reload()

###Change a password:

princ = kadm.getprinc("[email protected]")
princ.change_password("correcthorsebatterystaple")

###Iteration:

for princ in kadm.principals():
  # princ is a string
  print princ

for princ in kadm.principals('r*@EXAMPLE.COM'):
  # princ is a string starting with 'r' and ending with '@EXAMPLE.COM'
  print princ

# unpacked iteration
#  prints each principal, data is optiona

def callback_a(princ, data):
	print(princ)

def callback_b(princ, data):
	print("{0}{1}".format(data, princ))

# invoke callback_a for each principal, equivilent of the above iteration.
kadm.each_principal(callback_a)

# invoke callback_b for each principal resulting in "Hello, [email protected]"
kadm.each_principal(callback_b, data="Hello, ")

#
# WARNING: unpack iteration deprecated in favor of "each iteration" with callbacks.
#		   unless run on the default backend via kadmin_local unpack iteration is *extremely* slow.
#

# old style unpack iteration [updated]
# replaces: kadm.principals('*', unpack=True)

for princ in kadm.principals('*'):
	principal = kadm.get_princ(princ)
	# use principal as needed

python-kadmin's People

Contributors

benley avatar dyarnell avatar ehashman avatar jaseg avatar kowh avatar michaelweiser avatar oliviermartin avatar pluggi avatar rjancewicz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-kadmin's Issues

Setting principal.policy to None gives Segfault

(gdb) run
Starting program: /usr/bin/python3
warning: Loadable section ".note.gnu.property" outside of ELF segments
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Python 3.7.1 (default, Nov 23 2018, 10:01:49)
[GCC 8.2.1 20181105 (Red Hat 8.2.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments

import kadmin
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
kadm = kadmin.init_with_password(REDACTED)
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
principal = kadm.get_principal(REDACTED)
principal.policy
'a_valid_policy_name'
principal.policy = None

Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
62 VPCMPEQ (%rdi), %ymm0, %ymm1
(gdb) backtrace
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
#1 0x00007ffff7921662 in __GI___strdup (s=0x0) at strdup.c:41
#2 0x00007fffea6d96cd in PyKAdminPrincipal_set_policy (self=0x7fffea70c2d8, value=None, closure=)
at src/PyKAdminPrincipalObject.c:810
#3 0x00007ffff7d1d487 in getset_set (descr=, obj=, value=, descr=, obj=,
value=) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Objects/descrobject.c:210
#4 0x00007ffff7dcbcab in _PyObject_GenericSetAttrWithDict (obj=<kadmin.Principal at remote 0x7fffea70c2d8>, name='policy', value=None, dict=0x0)
at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Objects/object.c:1335
#5 0x00007ffff7dcc014 in PyObject_GenericSetAttr (value=None, name=, obj=<kadmin.Principal at remote 0x7fffea70c2d8>)
at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Objects/object.c:1340
#6 PyObject_SetAttr (v=<kadmin.Principal at remote 0x7fffea70c2d8>, name=, value=None)
at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Objects/object.c:979
#7 0x00007ffff7dd3ade in _PyEval_EvalFrameDefault (f=, throwflag=)
at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/ceval.c:2015
#8 0x00007ffff7d188e6 in _PyEval_EvalCodeWithName (_co=, globals=, locals=, args=,
argcount=, kwnames=0x0, kwargs=0x0, kwcount=, kwstep=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0,
qualname=0x0) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/ceval.c:3930
--Type for more, q to quit, c to continue without paging-- c
#9 0x00007ffff7d19983 in PyEval_EvalCodeEx (_co=, globals=, locals=, args=, argcount=, kws=, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/ceval.c:3959
#10 0x00007ffff7d199ab in PyEval_EvalCode (co=co@entry=<code at remote 0x7fffea793db0>, globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0x55555556cd98>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0x7fffea8ddc28>, 'kadmin': <module at remote 0x7fffea70a8b8>, 'kadm': <kadmin.KAdmin at remote 0x7fffea614168>, 'principal': <kadmin.Principal at remote 0x7fffea70c2d8>}, locals=locals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0x55555556cd98>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0x7fffea8ddc28>, 'kadmin': <module at remote 0x7fffea70a8b8>, 'kadm': <kadmin.KAdmin at remote 0x7fffea614168>, 'principal': <kadmin.Principal at remote 0x7fffea70c2d8>}) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/ceval.c:524
#11 0x00007ffff7e4820e in run_mod (mod=mod@entry=0x55555562bc10, filename=filename@entry='', globals={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0x55555556cd98>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0x7fffea8ddc28>, 'kadmin': <module at remote 0x7fffea70a8b8>, 'kadm': <kadmin.KAdmin at remote 0x7fffea614168>, 'principal': <kadmin.Principal at remote 0x7fffea70c2d8>}, locals={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0x55555556cd98>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0x7fffea8ddc28>, 'kadmin': <module at remote 0x7fffea70a8b8>, 'kadm': <kadmin.KAdmin at remote 0x7fffea614168>, 'principal': <kadmin.Principal at remote 0x7fffea70c2d8>}, flags=flags@entry=0x7fffffffd110, arena=arena@entry=0x7fffea8e52d0) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/pythonrun.c:1035
#12 0x00007ffff7cdf65a in PyRun_InteractiveOneObjectEx (fp=fp@entry=0x7ffff7a57a20 <IO_2_1_stdin>, filename=filename@entry='', flags=flags@entry=0x7fffffffd110) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/pythonrun.c:256
#13 0x00007ffff7ce15e8 in PyRun_InteractiveLoopFlags (fp=fp@entry=0x7ffff7a57a20 <IO_2_1_stdin>, filename_str=filename_str@entry=0x7ffff7e4f53c "", flags=flags@entry=0x7fffffffd110) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/pythonrun.c:120
#14 0x00007ffff7e4b863 in PyRun_AnyFileExFlags (fp=0x7ffff7a57a20 <IO_2_1_stdin>, filename=0x7ffff7e4f53c "", closeit=0, flags=0x7fffffffd110) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Python/pythonrun.c:78
#15 0x00007ffff7e4d801 in pymain_run_file (p_cf=0x7fffffffd110, filename=0x0, fp=0x7ffff7a57a20 <IO_2_1_stdin>) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Modules/main.c:427
#16 pymain_run_filename (cf=0x7fffffffd110, pymain=0x7fffffffd220) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Modules/main.c:1537
#17 pymain_run_python (pymain=0x7fffffffd220) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Modules/main.c:2626
#18 pymain_main (pymain=, pymain=) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Modules/main.c:2787
#19 0x00007ffff7e4dbdc in _Py_UnixMain (argc=, argv=) at /usr/src/debug/python3-3.7.1-4.fc29.x86_64/Modules/main.c:2822
#20 0x00007ffff78bb413 in __libc_start_main (main=0x555555555050

, argc=1, argv=0x7fffffffd378, init=, fini=, rtld_fini=, stack_end=0x7fffffffd368) at ../csu/libc-start.c:308
#21 0x000055555555508e in _start ()
(gdb)

Error when importing kadmin

Error ❗

When importing kadmin I get the following error:

(env) chris@x ~/lifecycle (master) » python3 main.py
Traceback (most recent call last):
  File "main.py", line 4, in <module>
    import kadmin
SystemError: bad call flags

System Information 💻

python -V: Python 3.8.2

uname -a:
Linux x 5.5.8-arch1-1 #1 SMP PREEMPT Fri, 06 Mar 2020 00:57:33 +0000 x86_64 GNU/Linux

Let me know if there is more information needed, any help is highly appreciated. 😊

implementing the delprinc method on PyKAdminPrincipalObjects

Hi,

I've implemented a delete() method on principal objects themselves as opposed to just on PyKadminObject, but I had a question about the implementation first. After calling kadm5_delete_principal(...), should we call the destructor--PyKAdminPrincipalObject_destroy(self)--proactively or wait for that to get done automatically when the object refcount goes to zero?

Let me know if this doesn't make any sense and I'll put in the MR for you to see exactly what I'm doing.

Thanks,
Liam

There is no way to set the realm upon which to perform operations

Upon startup the module loads the default realm from the configuration file and all subsequent operations are performed on on that system's default realm. We have three separate realms (development, test, and production) and it would be extremely useful to us to be able to perform kadmin operations on all three realms from a single (production) machine.

In perl (Authen::Krb5::Admin), you have the ability to create a configuration object and pass the realm in that, so that might be a viable option here as well.

Access/modify attributes of principal

It would be cool if I could use this library to modify the "Attributes" field of principals; for instance, to set +needchange on user principals to expire passwords rather than hard-expiring them with a date.

Interface could look something like

>>> princ.attributes
['REQUIRES_PRE_AUTH']
>>> princ.attributes.append('REQUIRES_PWCHANGE')
>>> princ.attributes
['REQUIRES_PRE_AUTH', 'REQUIRES_PWCHANGE']

corresponding to

kadmin: getprinc foobar
Principal: [email protected]
...
Attributes: REQUIRES_PRE_AUTH REQUIRES_PWCHANGE
kadmin: modprinc +needchange foobar
Principal "[email protected]" modified.

in kadmin.

I could write a pull request if someone were to point me in the right direction re: docs, etc.

undefined symbol: pykadmin_pydatetime_from_timestamp

$ pip install python-kadmin
Collecting python-kadmin
  Downloading https://files.pythonhosted.org/packages/8e/80/db00a44f980036388e62d70fe290c44dfa102687a5b16ed8a96e2124cf41/python-kadmin-0.1.2.tar.gz (56kB)
    100% |████████████████████████████████| 61kB 895kB/s 
Building wheels for collected packages: python-kadmin
  Running setup.py bdist_wheel for python-kadmin ... error
  Complete output from command /home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kgf6dag9/python-kadmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-w94tusgv --python-tag cp35:
  running bdist_wheel
  running build
  running build_ext
  building 'kadmin' extension
  creating build
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/kadmin.c -o build/temp.linux-x86_64-3.5/src/kadmin.o
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/kadmin.c:8:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminErrors.c -o build/temp.linux-x86_64-3.5/src/PyKAdminErrors.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminObject.c -o build/temp.linux-x86_64-3.5/src/PyKAdminObject.o
  src/PyKAdminObject.c: In function ‘PyKAdminObject_new’:
  src/PyKAdminObject.c:43:21: warning: variable ‘code’ set but not used [-Wunused-but-set-variable]
       krb5_error_code code = 0;
                       ^~~~
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminObject.c:6:
  src/PyKAdminObject.c: At top level:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminIterator.c -o build/temp.linux-x86_64-3.5/src/PyKAdminIterator.o
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminIterator.c:5:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminIterator.c:17:12: warning: ‘PyKAdminIterator_init’ defined but not used [-Wunused-function]
   static int PyKAdminIterator_init(PyKAdminIterator *self, PyObject *args, PyObject *kwds) {
              ^~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminPrincipalObject.c -o build/temp.linux-x86_64-3.5/src/PyKAdminPrincipalObject.o
  src/PyKAdminPrincipalObject.c: In function ‘PyKAdminPrincipal_print’:
  src/PyKAdminPrincipalObject.c:124:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
       krb5_error_code errno;
       ^~~~~~~~~~~~~~~
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminPrincipalObject.c:6:
  src/PyKAdminPrincipalObject.c: At top level:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminPrincipalObject.c:69:18: warning: ‘PyKAdminPrincipal_str’ defined but not used [-Wunused-function]
   static PyObject *PyKAdminPrincipal_str(PyKAdminPrincipalObject *self) {
                    ^~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminPolicyObject.c -o build/temp.linux-x86_64-3.5/src/PyKAdminPolicyObject.o
  src/PyKAdminPolicyObject.c:123:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
       KAdminPolicyObject_print,                         /*tp_print*/
       ^~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminPolicyObject.c:123:5: note: (near initialization for ‘PyKAdminPolicyObject_Type.tp_print’)
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminPolicyObject.c:2:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminCommon.c -o build/temp.linux-x86_64-3.5/src/PyKAdminCommon.o
  src/PyKAdminCommon.c:217:20: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   static kadm5_ret_t krb5_copy_key_data_contents(context, from, to)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.c: In function ‘pykadmin_kadm_from_kdb’:
  src/PyKAdminCommon.c:378:11: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
           } else
             ^~~~
  src/PyKAdminCommon.c:381:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
               for (i = 0; i < entry->n_key_data; i++)
               ^~~
  In file included from src/PyKAdminCommon.c:14:0:
  src/PyKAdminCommon.c: At top level:
  /usr/include/python3.5m/datetime.h:231:22: warning: ‘PyDateTimeAPI’ is static but used in inline function ‘pykadmin_pydatetime_from_timestamp’ which is not static
           (PyObject*) (PyDateTimeAPI->DateTimeType), args, NULL)
                        ^
  src/PyKAdminCommon.c:108:24: note: in expansion of macro ‘PyDateTime_FromTimestamp’
               datetime = PyDateTime_FromTimestamp(args);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.5m/datetime.h:230:5: warning: ‘PyDateTimeAPI’ is static but used in inline function ‘pykadmin_pydatetime_from_timestamp’ which is not static
       PyDateTimeAPI->DateTime_FromTimestamp( \
       ^
  src/PyKAdminCommon.c:108:24: note: in expansion of macro ‘PyDateTime_FromTimestamp’
               datetime = PyDateTime_FromTimestamp(args);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.5m/datetime.h:194:5: warning: ‘PyDateTimeAPI’ is static but used in inline function ‘pykadmin_pydatetime_from_timestamp’ which is not static
       PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)
       ^
  src/PyKAdminCommon.c:99:5: note: in expansion of macro ‘PyDateTime_IMPORT’
       PyDateTime_IMPORT;
       ^~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminXDR.c -o build/temp.linux-x86_64-3.5/src/PyKAdminXDR.o
  src/PyKAdminXDR.c: In function ‘pykadmin_xdr_osa_princ_ent_rec’:
  src/PyKAdminXDR.c:36:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (!xdr_array(xdrs, (caddr_t *) &entry->old_keys, (unsigned int *) &entry->old_key_len, ~0, sizeof(osa_pw_hist_ent), pykadmin_xdr_osa_pw_hist_ent))
     ^~
  src/PyKAdminXDR.c:39:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
    result = 1;
    ^~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/getdate.c -o build/temp.linux-x86_64-3.5/src/getdate.o
  ./src/getdate.y:110:15: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   extern struct tm *gmtime();
                 ^~
  ./src/getdate.y:111:15: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   extern struct tm *localtime();
                 ^~
  creating build/lib.linux-x86_64-3.5
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/src/kadmin.o build/temp.linux-x86_64-3.5/src/PyKAdminErrors.o build/temp.linux-x86_64-3.5/src/PyKAdminObject.o build/temp.linux-x86_64-3.5/src/PyKAdminIterator.o build/temp.linux-x86_64-3.5/src/PyKAdminPrincipalObject.o build/temp.linux-x86_64-3.5/src/PyKAdminPolicyObject.o build/temp.linux-x86_64-3.5/src/PyKAdminCommon.o build/temp.linux-x86_64-3.5/src/PyKAdminXDR.o build/temp.linux-x86_64-3.5/src/getdate.o -lkrb5 -lkadm5clnt -lkdb5 -o build/lib.linux-x86_64-3.5/kadmin.cpython-35m-x86_64-linux-gnu.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  copying build/lib.linux-x86_64-3.5/kadmin.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel
  warning: install_lib: byte-compiling is disabled, skipping.
  
  running install_egg_info
  running egg_info
  creating python_kadmin.egg-info
  writing python_kadmin.egg-info/PKG-INFO
  writing dependency_links to python_kadmin.egg-info/dependency_links.txt
  writing top-level names to python_kadmin.egg-info/top_level.txt
  writing manifest file 'python_kadmin.egg-info/SOURCES.txt'
  reading manifest file 'python_kadmin.egg-info/SOURCES.txt'
  writing manifest file 'python_kadmin.egg-info/SOURCES.txt'
  Copying python_kadmin.egg-info to build/bdist.linux-x86_64/wheel/python_kadmin-0.1.2-py3.5.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/python_kadmin-0.1.2.dist-info/WHEEL
  creating '/tmp/pip-wheel-w94tusgv/python_kadmin-0.1.2-cp35-cp35m-linux_x86_64.whl' and adding '.' to it
  adding 'kadmin.cpython-35m-x86_64-linux-gnu.so'
  adding 'python_kadmin-0.1.2.dist-info/top_level.txt'
  adding 'python_kadmin-0.1.2.dist-info/WHEEL'
  adding 'python_kadmin-0.1.2.dist-info/METADATA'
  adding 'python_kadmin-0.1.2.dist-info/RECORD'
  removing build/bdist.linux-x86_64/wheel
  running bdist_wheel
  running build
  running build_ext
  building 'kadmin_local' extension
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/kadmin.c -o build/temp.linux-x86_64-3.5/src/kadmin.o
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/kadmin.c:8:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminErrors.c -o build/temp.linux-x86_64-3.5/src/PyKAdminErrors.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminObject.c -o build/temp.linux-x86_64-3.5/src/PyKAdminObject.o
  src/PyKAdminObject.c: In function ‘PyKAdminObject_new’:
  src/PyKAdminObject.c:43:21: warning: variable ‘code’ set but not used [-Wunused-but-set-variable]
       krb5_error_code code = 0;
                       ^~~~
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminObject.c:6:
  src/PyKAdminObject.c: At top level:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminIterator.c -o build/temp.linux-x86_64-3.5/src/PyKAdminIterator.o
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminIterator.c:5:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminIterator.c:17:12: warning: ‘PyKAdminIterator_init’ defined but not used [-Wunused-function]
   static int PyKAdminIterator_init(PyKAdminIterator *self, PyObject *args, PyObject *kwds) {
              ^~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminPrincipalObject.c -o build/temp.linux-x86_64-3.5/src/PyKAdminPrincipalObject.o
  src/PyKAdminPrincipalObject.c: In function ‘PyKAdminPrincipal_print’:
  src/PyKAdminPrincipalObject.c:124:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
       krb5_error_code errno;
       ^~~~~~~~~~~~~~~
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminPrincipalObject.c:6:
  src/PyKAdminPrincipalObject.c: At top level:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminPrincipalObject.c:69:18: warning: ‘PyKAdminPrincipal_str’ defined but not used [-Wunused-function]
   static PyObject *PyKAdminPrincipal_str(PyKAdminPrincipalObject *self) {
                    ^~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminPolicyObject.c -o build/temp.linux-x86_64-3.5/src/PyKAdminPolicyObject.o
  src/PyKAdminPolicyObject.c:123:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
       KAdminPolicyObject_print,                         /*tp_print*/
       ^~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminPolicyObject.c:123:5: note: (near initialization for ‘PyKAdminPolicyObject_Type.tp_print’)
  In file included from src/PyKAdminPolicyObject.h:13:0,
                   from src/PyKAdminPolicyObject.c:2:
  src/PyKAdminCommon.h:29:18: warning: inline function ‘pykadmin_pydatetime_from_timestamp’ declared but never defined
   inline PyObject *pykadmin_pydatetime_from_timestamp(time_t timestamp);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.h:25:14: warning: inline function ‘PyUnicode_or_PyBytes_asCString’ declared but never defined
   inline char *PyUnicode_or_PyBytes_asCString(PyObject *in_str);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminCommon.c -o build/temp.linux-x86_64-3.5/src/PyKAdminCommon.o
  src/PyKAdminCommon.c:217:20: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   static kadm5_ret_t krb5_copy_key_data_contents(context, from, to)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/PyKAdminCommon.c: In function ‘pykadmin_kadm_from_kdb’:
  src/PyKAdminCommon.c:378:11: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
           } else
             ^~~~
  src/PyKAdminCommon.c:381:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
               for (i = 0; i < entry->n_key_data; i++)
               ^~~
  In file included from src/PyKAdminCommon.c:14:0:
  src/PyKAdminCommon.c: At top level:
  /usr/include/python3.5m/datetime.h:231:22: warning: ‘PyDateTimeAPI’ is static but used in inline function ‘pykadmin_pydatetime_from_timestamp’ which is not static
           (PyObject*) (PyDateTimeAPI->DateTimeType), args, NULL)
                        ^
  src/PyKAdminCommon.c:108:24: note: in expansion of macro ‘PyDateTime_FromTimestamp’
               datetime = PyDateTime_FromTimestamp(args);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.5m/datetime.h:230:5: warning: ‘PyDateTimeAPI’ is static but used in inline function ‘pykadmin_pydatetime_from_timestamp’ which is not static
       PyDateTimeAPI->DateTime_FromTimestamp( \
       ^
  src/PyKAdminCommon.c:108:24: note: in expansion of macro ‘PyDateTime_FromTimestamp’
               datetime = PyDateTime_FromTimestamp(args);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.5m/datetime.h:194:5: warning: ‘PyDateTimeAPI’ is static but used in inline function ‘pykadmin_pydatetime_from_timestamp’ which is not static
       PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)
       ^
  src/PyKAdminCommon.c:99:5: note: in expansion of macro ‘PyDateTime_IMPORT’
       PyDateTime_IMPORT;
       ^~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/PyKAdminXDR.c -o build/temp.linux-x86_64-3.5/src/PyKAdminXDR.o
  src/PyKAdminXDR.c: In function ‘pykadmin_xdr_osa_princ_ent_rec’:
  src/PyKAdminXDR.c:36:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (!xdr_array(xdrs, (caddr_t *) &entry->old_keys, (unsigned int *) &entry->old_key_len, ~0, sizeof(osa_pw_hist_ent), pykadmin_xdr_osa_pw_hist_ent))
     ^~
  src/PyKAdminXDR.c:39:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
    result = 1;
    ^~~~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/usr/include/python3.5m -I/home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/include/python3.5m -c src/getdate.c -o build/temp.linux-x86_64-3.5/src/getdate.o
  ./src/getdate.y:110:15: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   extern struct tm *gmtime();
                 ^~
  ./src/getdate.y:111:15: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   extern struct tm *localtime();
                 ^~
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/src/kadmin.o build/temp.linux-x86_64-3.5/src/PyKAdminErrors.o build/temp.linux-x86_64-3.5/src/PyKAdminObject.o build/temp.linux-x86_64-3.5/src/PyKAdminIterator.o build/temp.linux-x86_64-3.5/src/PyKAdminPrincipalObject.o build/temp.linux-x86_64-3.5/src/PyKAdminPolicyObject.o build/temp.linux-x86_64-3.5/src/PyKAdminCommon.o build/temp.linux-x86_64-3.5/src/PyKAdminXDR.o build/temp.linux-x86_64-3.5/src/getdate.o -lkrb5 -lkadm5srv -lkdb5 -o build/lib.linux-x86_64-3.5/kadmin_local.cpython-35m-x86_64-linux-gnu.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  copying build/lib.linux-x86_64-3.5/kadmin_local.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel
  error: could not create 'build/bdist.linux-x86_64/wheel/kadmin_local.cpython-35m-x86_64-linux-gnu.so': No such file or directory
  
  ----------------------------------------
  Failed building wheel for python-kadmin
  Running setup.py clean for python-kadmin
Failed to build python-kadmin
Installing collected packages: python-kadmin
  Running setup.py install for python-kadmin ... done
Successfully installed python-kadmin-0.1.2
$ python -c 'import kadmin'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /home/dtucker/.local/share/virtualenvs/isilon_hadoop_tools-FcMFzDNy/lib/python3.5/site-packages/kadmin.cpython-35m-x86_64-linux-gnu.so: undefined symbol: pykadmin_pydatetime_from_timestamp

--no-binary :all: does not seem to help.
Also, the build error changes if mkdir -p build/lib.linux-x86_64-3.5 is run beforehand.

Fatal Python error: deallocating None

When iterating over a 4000 list that is getting and creating principals. The following error occurs:

Fatal Python error: deallocating None
Aborted (core dumped)

I can see the reference count of None reduce if i print:

print(sys.getrefcount(None))

I tried iterating with the "getprinc" method and you can clearly see the refcount to None drop consistently...

Compile fails on Fedora 22

Hello,

Great project, I've been looking for something like this for a long time.

Unfortunately, compiling fails on Fedora 22 with this:

    src/PyKAdminObject.c:365:16: error: too few arguments to function ‘krb5_db_iterate’
             code = krb5_db_iterate(self->context, match, kdb_iter_princs, (void *)self);

The /usr/include/kdb.h in krb5-devel-1.13.2-3 (the version that comes with Fedora 22) defines krb5_db_iterate as:

krb5_error_code krb5_db_iterate ( krb5_context kcontext,                        
                                  char *match_entry,                            
                                  int (*func) (krb5_pointer, krb5_db_entry *),  
                                  krb5_pointer func_arg, krb5_flags iterflags );

I assume that this was an API break that happened at a major version (not sure which one). In kdb.h, there is a #define KRB5_KDB_API_VERSION 8, so it should be fixable with something like:

#if KRB5_KDB_API_VERSION > [whatever]
// call with 5 arguments
#else
// call with 4 arguments
#endif

Unfortunately, I don't know exactly which version that change was made at.

Make available on PyPI?

Hi there,

This project looks really neat -- I'd really like to start using this instead of pexpect+kadmin!

I can't seem to find this module on PyPI, though -- I'm wondering if you've considered uploading it there, or if there's some reason you haven't? It would be a lot easier for us to deploy this across our machines if we could install it via pip.

I'd be happy to help in any way with uploading! Thanks for a really cool module!

Creating principals

Hello,

Could you please add a couple of notes on how to create principals? Getting them and working on existing principals are mostly covered in your readme, however creating them, as part of kadmin management, is not covered, and I think that's also a very important thing.

Thanks in advance

Cannot build wheel for python-kadmin

Wheel cannot be built for python-kadmin. Installing directly works for some reason:

  Running setup.py bdist_wheel for python-kadmin ... �[?25l-� �\� �|� �/� �-� �\� �|� �/� �-� �\� �|� �/� �-� �\� �|� �/� �-� �\� �error
  Complete output from command /tmp/build-cache.scoE0K/appdev-aloha/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FscgMz/python-kadmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp8T_6Blpip-wheel-:
  running bdist_wheel
  running build
  running build_ext
  building 'kadmin' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/kadmin.c -o build/temp.linux-x86_64-2.7/src/kadmin.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminErrors.c -o build/temp.linux-x86_64-2.7/src/PyKAdminErrors.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminObject.c -o build/temp.linux-x86_64-2.7/src/PyKAdminObject.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminIterator.c -o build/temp.linux-x86_64-2.7/src/PyKAdminIterator.o
  src/PyKAdminIterator.c:17: warning: ‘PyKAdminIterator_init’ defined but not used
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminPrincipalObject.c -o build/temp.linux-x86_64-2.7/src/PyKAdminPrincipalObject.o
  src/PyKAdminPrincipalObject.c: In function ‘PyKAdminPrincipal_print’:
  src/PyKAdminPrincipalObject.c:124: warning: function declaration isn’t a prototype
  src/PyKAdminPrincipalObject.c: At top level:
  src/PyKAdminPrincipalObject.c:69: warning: ‘PyKAdminPrincipal_str’ defined but not used
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminPolicyObject.c -o build/temp.linux-x86_64-2.7/src/PyKAdminPolicyObject.o
  src/PyKAdminPolicyObject.c:123: warning: initialization from incompatible pointer type
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminCommon.c -o build/temp.linux-x86_64-2.7/src/PyKAdminCommon.o
  src/PyKAdminCommon.c:218: warning: function declaration isn’t a prototype
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminXDR.c -o build/temp.linux-x86_64-2.7/src/PyKAdminXDR.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/getdate.c -o build/temp.linux-x86_64-2.7/src/getdate.o
  ./src/getdate.y:110: warning: function declaration isn’t a prototype
  ./src/getdate.y:111: warning: function declaration isn’t a prototype
  creating build/lib.linux-x86_64-2.7
  gcc -pthread -shared build/temp.linux-x86_64-2.7/src/kadmin.o build/temp.linux-x86_64-2.7/src/PyKAdminErrors.o build/temp.linux-x86_64-2.7/src/PyKAdminObject.o build/temp.linux-x86_64-2.7/src/PyKAdminIterator.o build/temp.linux-x86_64-2.7/src/PyKAdminPrincipalObject.o build/temp.linux-x86_64-2.7/src/PyKAdminPolicyObject.o build/temp.linux-x86_64-2.7/src/PyKAdminCommon.o build/temp.linux-x86_64-2.7/src/PyKAdminXDR.o build/temp.linux-x86_64-2.7/src/getdate.o -L/opt/python27/lib -lkrb5 -lkadm5clnt -lkdb5 -lpython2.7 -o build/lib.linux-x86_64-2.7/kadmin.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  copying build/lib.linux-x86_64-2.7/kadmin.so -> build/bdist.linux-x86_64/wheel
  running install_egg_info
  running egg_info
  creating python_kadmin.egg-info
  writing python_kadmin.egg-info/PKG-INFO
  writing top-level names to python_kadmin.egg-info/top_level.txt
  writing dependency_links to python_kadmin.egg-info/dependency_links.txt
  writing manifest file 'python_kadmin.egg-info/SOURCES.txt'
  warning: manifest_maker: standard file '-c' not found
  
  reading manifest file 'python_kadmin.egg-info/SOURCES.txt'
  writing manifest file 'python_kadmin.egg-info/SOURCES.txt'
  Copying python_kadmin.egg-info to build/bdist.linux-x86_64/wheel/python_kadmin-0.1.2-py2.7.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/python_kadmin-0.1.2.dist-info/WHEEL
  running bdist_wheel
  running build
  running build_ext
  building 'kadmin_local' extension
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/kadmin.c -o build/temp.linux-x86_64-2.7/src/kadmin.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminErrors.c -o build/temp.linux-x86_64-2.7/src/PyKAdminErrors.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminObject.c -o build/temp.linux-x86_64-2.7/src/PyKAdminObject.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminIterator.c -o build/temp.linux-x86_64-2.7/src/PyKAdminIterator.o
  src/PyKAdminIterator.c:17: warning: ‘PyKAdminIterator_init’ defined but not used
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminPrincipalObject.c -o build/temp.linux-x86_64-2.7/src/PyKAdminPrincipalObject.o
  src/PyKAdminPrincipalObject.c: In function ‘PyKAdminPrincipal_print’:
  src/PyKAdminPrincipalObject.c:124: warning: function declaration isn’t a prototype
  src/PyKAdminPrincipalObject.c: At top level:
  src/PyKAdminPrincipalObject.c:69: warning: ‘PyKAdminPrincipal_str’ defined but not used
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminPolicyObject.c -o build/temp.linux-x86_64-2.7/src/PyKAdminPolicyObject.o
  src/PyKAdminPolicyObject.c:123: warning: initialization from incompatible pointer type
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminCommon.c -o build/temp.linux-x86_64-2.7/src/PyKAdminCommon.o
  src/PyKAdminCommon.c:218: warning: function declaration isn’t a prototype
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/PyKAdminXDR.c -o build/temp.linux-x86_64-2.7/src/PyKAdminXDR.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DKADMIN_LOCAL= -I/usr/include/ -I/usr/include/et/ -I/opt/python27/include/python2.7 -c src/getdate.c -o build/temp.linux-x86_64-2.7/src/getdate.o
  ./src/getdate.y:110: warning: function declaration isn’t a prototype
  ./src/getdate.y:111: warning: function declaration isn’t a prototype
  gcc -pthread -shared build/temp.linux-x86_64-2.7/src/kadmin.o build/temp.linux-x86_64-2.7/src/PyKAdminErrors.o build/temp.linux-x86_64-2.7/src/PyKAdminObject.o build/temp.linux-x86_64-2.7/src/PyKAdminIterator.o build/temp.linux-x86_64-2.7/src/PyKAdminPrincipalObject.o build/temp.linux-x86_64-2.7/src/PyKAdminPolicyObject.o build/temp.linux-x86_64-2.7/src/PyKAdminCommon.o build/temp.linux-x86_64-2.7/src/PyKAdminXDR.o build/temp.linux-x86_64-2.7/src/getdate.o -L/opt/python27/lib -lkrb5 -lkadm5srv -lkdb5 -lpython2.7 -o build/lib.linux-x86_64-2.7/kadmin_local.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  copying build/lib.linux-x86_64-2.7/kadmin.so -> build/bdist.linux-x86_64/wheel
  error: build/bdist.linux-x86_64/wheel/kadmin.so: No such file or directory

AWS/Terraform Autoscaling instance refresh, can we have multiple triggers for different use cases.?.

Hi Team,

I have written terraform code for any version change , it triggers autoscaling. But i want to include other variable in triggers as below. But it is failing with "'pass_test' is not a recognized parameter name for aws_autoscaling_group".

code

+++
resource "aws_autoscaling_group" "ec2_group" {
name = "${local.full_asg_name}-asg"
desired_capacity = var.desired_capacity
max_size = var.max_capacity
min_size = var.min_capacity
vpc_zone_identifier = var.instance_subnets
target_group_arns = [aws_alb_target_group.asg_alb_target_group.arn, aws_lb_target_group.asg_nlb_target_group.arn]
health_check_type = var.health_check_type
suspended_processes = var.suspend_process
launch_template {
id = aws_launch_template.asg_template.id
version = var.template_version
}
instance_refresh {
strategy = "Rolling"
preferences {
min_healthy_percentage = 0
}
triggers = ["tag","pass_test"]
}

tag {
key = "Name"
value = local.full_asg_name
propagate_at_launch = true
}

tag {
key = "subsystem"
value = var.subsystem
propagate_at_launch = true
}

tag {
key = "component"
value = var.component
propagate_at_launch = true
}

tag {
key = "environment"
value = var.environment
propagate_at_launch = true
}
tag {
key = "build"
value = var.tag
propagate_at_launch = true
}
tag {
key = var.tag
value = var.tag
propagate_at_launch = true
}
tag {
key = "Rotating Password"
value = var.pass_test
propagate_at_launch = true
}
}
+++

When i execute this, I am getting below error :

++

│ Error: 'pass_test' is not a recognized parameter name for aws_autoscaling_group

│ with module.auto_environment.module.postx_asg.aws_autoscaling_group.ec2_group,
│ on ../modules/aws/asg_alb_nlb/main.tf line 113, in resource "aws_autoscaling_group" "ec2_group":
│ 113: triggers = ["tag","pass_test"]
++

Use case : Every 3 months, we will be rotating db passwords by updating this variable "pass_test". It is rotated but instance refresh is manual here, where there is no trigger. I am trying to add those variable as a trigger here, but it s not working. Any help would be appareciated.

Thanks
K.Keerthiga

New Release for "inline" fix?

Is it possible for you to publish a new release for build fix? The current released version does not install under Ubuntu 16.04 but master from git does.

Use of -O0 in CFLAGS causes warning in distributions that enable FORTIFY_SOURCE by default

I get a bunch of these warnings in Fedora 20:

    In file included from /usr/include/stdlib.h:24:0,
                     from /usr/include/krb5/krb5.h:101,
                     from /usr/include/krb5.h:8,
                     from ./PyKAdminXDR.h:5,
                     from ./PyKAdminXDR.c:2:
    /usr/include/features.h:327:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
     #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)

Is there a particular reason for forcing -O0?

Useful function - ExportKeytab

Refer to apache kerb-admin api and kadmin.local, from my point of view, exportkeytab is very useful. How about adding it? @russjancewicz

Segmentation fault with `kadmin.init_with_keytab(None)`

Python 3.5.3 (default, May 11 2017, 09:10:41)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

import kadmin
kadmin.init_with_keytab(None)
Segmentation fault (core dumped)

I haven't worked out why yet, but I'll see what I can work out.

RPCErrorError

After several hours running, 'addprinc' threw RPCErrorError, but 'getprinc' returned the different response( principal exist but this function returned none ), so i should try/catch the exception only with addprinc and re-initial?

Unable to Unlock Kerberos Principal

While using python-kadmin to administer kerberos principals(users), I am trying to use unlock method for unlocking a user but when I call the method, the call abruptly ends and terminates the python process. There is no exception, no error of any sorts just complete shutdown of the process. Below is my code:

(Pdb) import kadmin
(Pdb) kadmin_obj = kadmin.init_with_password(app.config['KADMIN_USER'], app.config['KADMIN_PWD'])
(Pdb) kadmin_obj.unlock()

I am using docker run the process and dependencies are as follows:

yum install -y python3 python3-devel gcc krb5-devel glibc
pip3 install python-kadmin

addprinc with dbargs

Could you please add some notes on how to add principals with dbargs set?

When KDC is having an LDAP backend it's important to create the principals within the right subtree, including attaching them to an already existing object.

It's explained here: http://sugo.ubuntu.hu/9.04/html/serverguide/hu/kerberos-ldap.html
From that page, here's an example what needs to be done using the API:
addprinc -x dn="uid=steve,ou=people,dc=example,dc=com" steve

-x here is a dbarg, which tells it to add it to an already existing DN.

Thanks in advance

Support for rename_principal

I can't find anything in the source that looks like the implementation for rename_principal. I don't suppose there's any plans to implement that command?

I might be able to write an implementation; does anybody have an idea how much effort that would be and where to start?

Cannot build with pip 20.1

In pip 20.1, I am unable to install python-kadmin. Here is my output:

(venv) [ec2-user@<redacted> ~]$ pip install python-kadmin
Collecting python-kadmin
  Downloading python-kadmin-0.1.2.tar.gz (56 kB)
     |████████████████████████████████| 56 kB 2.1 MB/s
ERROR: More than one .egg-info directory found in /tmp/pip-pip-egg-info-l_xig4fv

It is referenced in this issue on pip that installing two packages from a single setup.py file is not supported, which I would guess is the cause here seeing as there are two 'setup' objects defined in this project's setup.py:

pypa/pip#8201

My environment:
RHEL 8, Python 3.7.7, Pip 20.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.