[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Problem writing module

A few more things to try -

- Run the test harness in GDB and step through the code to see where it's hanging

- Run the test harness on a set of modules that are known to work & compare the results

- Try isolating which phase the hang is occurring in (maybe it's session?) by using pam_permit in all phases except the one you're testing.

- If you can't use GDB to debug, then maybe add some print/syslog statements to see what's happening?

- Max

Thanks a lot for that test harness!!! I debugged with it and this is what I found out:

1: the tester request for a "login" service (and my module is loaded for that)
2: the tester calls pam_authenticate.
3: my module returns PAM_SUCCESS
4: the tester calls pam_acct_mgmt(pamh, 0)
5: pam_permit.so handles that and returns PAM_SUCCESS
5: the tester calls pam_open_session(pamh, 0);
6: pam_unix responds to the call, and, on the line 98 of pam_unix_sess.c, it calls the this function on support.c:

_log_err(LOG_INFO, pamh, "session opened for user %s by %s(uid=%d)",
user_name, login_name, getuid());

/* values: user_name = "tbezerra", login_name = "", getuid() = 1022 (tbezerra's id) */

And there, at line 53 [syslog(err, format, args);], the tester halts!! No error, no nothing. Simply stops!
More ideas?? I'm really lost!!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]