Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.sh error #2

Open
mikevmk opened this issue Dec 19, 2016 · 3 comments
Open

test.sh error #2

mikevmk opened this issue Dec 19, 2016 · 3 comments

Comments

@mikevmk
Copy link

mikevmk commented Dec 19, 2016

Hi,

I see you're working on the script right now, so I decided to share the issue.

I'm trying to set up the script to authenticate against postfixadmin user DB

I set db settings right in the code as well as password query. Other queries are disabled.

The wierd thing is that I see this in ejabberd logs:

2016-12-19 17:10:20.013 [critical] <0.909.0>@extauth:loop:142 extauth script has exitted abruptly with reason 'normal'
2016-12-19 17:10:20.022 [critical] <0.910.0>@extauth:loop:142 extauth script has exitted abruptly with reason 'normal'
2016-12-19 17:10:20.034 [critical] <0.911.0>@extauth:loop:142 extauth script has exitted abruptly with reason 'normal'

When I try to test it with test.sh I see this:

Python version is: Python 2.7.12
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
struct.error: unpack requires a string argument of length 4
Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
IOError: [Errno 32] Broken pipe

Versions:
ejabberd 16.01-2
Ubuntu 16.04
python 2.7.12

Do you think you could help me? Thanks in advance.

Mike

@cdauth
Copy link
Member

cdauth commented Dec 19, 2016

I have no idea what could be causing this. I have only very basic knowledge of Python and didn’t write the respective code myself.

As far as my research can tell, struct.unpack('>h', input_length) should always expect 2 bytes, so it is a mystery to me why in your case it expects 4.

Are you running the script on a normal 64bit x86 processor? Are you sure that the script is executed with Python 2 (run /usr/bin/python --version)?

@mikevmk
Copy link
Author

mikevmk commented Dec 19, 2016

Yes to both

Well, ok, thank you anyway, will try to investigate here

@rlaager
Copy link
Contributor

rlaager commented Jan 27, 2019

Ubuntu has an apparmor policy that does not allow extauth scripts. In /etc/apparmor.d/local/usr.sbin.ejabberdctl, add:

/path/to/your/auth_mysql.py Ux,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants