kerberos-android-ndk
kerberos-android-ndk copied to clipboard
Error while initializing Kerberos 5 library
Hello,
i can not get started the code on the real device. I was able to start it on the emulator, but the real device(htc sensation) throws "Error while initializing Kerberos 5 library". I have done all things written in readme, i also tried to change location of the files and libs, but without any success.
Here is the log:
03-28 10:50:16.267: E/Trace(29984): error opening trace file: No such file or directory (2) 03-28 10:50:16.277: D/ActivityThread(29984): setTargetHeapUtilization:0.25 03-28 10:50:16.277: D/ActivityThread(29984): setTargetHeapIdealFree:8388608 03-28 10:50:16.277: D/ActivityThread(29984): setTargetHeapConcurrentStart:2097152 03-28 10:50:16.307: D/dalvikvm(29984): Trying to load lib /data/data/edu.mit.kerberos/lib/libkerberosapp.so 0x40ea0450 03-28 10:50:16.307: D/dalvikvm(29984): Added shared lib /data/data/edu.mit.kerberos/lib/libkerberosapp.so 0x40ea0450 03-28 10:50:16.307: I/---KERBEROS---(29984): Loaded libkerberosapp 03-28 10:50:17.208: E/SpannableStringBuilder(29984): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 03-28 10:50:17.208: E/SpannableStringBuilder(29984): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 03-28 10:50:17.278: E/SpannableStringBuilder(29984): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 03-28 10:50:17.278: E/SpannableStringBuilder(29984): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 03-28 10:50:36.657: I/---KERBEROS---(29984): Entered generateArgv #03-28 10:50:36.687: I/---JAVA JNI---(29984): Return value from native lib: 1
Now i tried the project on the new updated android sdk, and it fails too. Do you have any idea whats going wrong ?
Thank you
Cheers, Maxim
Now it works again on the emulator(i forgot the krb5.conf file). But the real device, fails on initializing kerberos 5 library, i suspect what is caused by app permisions
It looks like the "Error while initializing Kerberos 5 library" comes from line #456 of ./jni/kinit/kinit.c. Does it give you the value of the associated error code?
Thanks, Chris
Yes, this is the value
I already looked c code, but i cant find the reason of it. It looks like that i dont have permission to read config file. In JAVA i am able to read the file.
Okay, i was able to read config file line by line from the c code, so it is not a permission problem, at least not for config file
Have you made any progress on this issue?
I can confirm this bug-- was able to successfully get a ticket in the emulator but not on an Android 4.3 physical device, using the same config file.
EDIT: I added some debugging. Looks like the error code returned from krb5_init_context is error 13, which means "KRB5KDC_ERR_BADOPTION: KDC can't fulfill requested option".
I'll try rebuilding the kerberos libraries in the morning, at least as a starting point.
Huh. I decided to try sending the krb5.conf file over again after purging the app from my phone (and deleting the configuration file) and it worked just fine.
I am not actually sure what the problem was, but it's working now.
Hi TC01,
Just following up on this issue. In your last message, you mentioned after purging the app, the issue was resolved. Had you also recompiled the kerberos libraries as you mentioned, or was that not necessary?
Thanks, Chris
No, I haven't actually succeeded in doing that, and it wasn't necessary. I think I had screwed up somehow when creating krb5.conf; resending that and ensuring it landed in the right place and had reasonable permissions seemed to solve the problem.