ben | 21 Dec 2011 01:49
Favicon

Pam Perl or how to debug a pam module

So the problem began with browsing my Linux distro's repository looking
for a pam module to create home directories on demand. I found one that
works almost like I want. Almost, not quite, so onto the source code. It
is written in python. I have a severe Pathological and Eclectic aversion
to python. It reminds me of the Rubbish Lists i turned in in my
hi-school COBOL programing class. I'd rather try to transcend dental
medication.

so... I've been looking for a project to brush up my c skills, maybe
embed a interpreter for practice... so announcing version 0.0001. Write
your own device driver days here. It is about 75% to theoretically
functional level.

I expect to reach theoretical functional in about a week or two, but I
figured that this is far enough along to fire up a debugger, Which
brings us to the real question: how do you debug pam modules, especially
linker errors?

code is available. License requires fixing bugs to distribute until
version 0.5 when I will go gpl.
thanks,
ben

--

-- 
Ben Hildred
Estimator
Applied Plastic Coatings, Inc.
5000 Tabor St.
Wheat Ridge, CO 80033
303 424 9200
(Continue reading)

Jason Gerfen | 21 Dec 2011 02:20
Picon
Favicon

Re: Pam Perl or how to debug a pam module

Linker errors? My first assumption is that you are trying to link to the PAM libraries, in which case...

gcc -o pam_module.so pam_module.c -llibpam 

Of course this is all listed within the developers handbook

Jas

On Dec 20, 2011, at 5:53 PM, "ben" <ben <at> appliedplastic.com> wrote:

> So the problem began with browsing my Linux distro's repository looking
> for a pam module to create home directories on demand. I found one that
> works almost like I want. Almost, not quite, so onto the source code. It
> is written in python. I have a severe Pathological and Eclectic aversion
> to python. It reminds me of the Rubbish Lists i turned in in my
> hi-school COBOL programing class. I'd rather try to transcend dental
> medication.
> 
> so... I've been looking for a project to brush up my c skills, maybe
> embed a interpreter for practice... so announcing version 0.0001. Write
> your own device driver days here. It is about 75% to theoretically
> functional level.
> 
> I expect to reach theoretical functional in about a week or two, but I
> figured that this is far enough along to fire up a debugger, Which
> brings us to the real question: how do you debug pam modules, especially
> linker errors?
> 
> code is available. License requires fixing bugs to distribute until
> version 0.5 when I will go gpl.
(Continue reading)

ben | 21 Dec 2011 22:55
Favicon

Re: Pam Perl or how to debug a pam module

On 12/20/2011 6:20 PM, Jason Gerfen wrote:
> Linker errors? My first assumption is that you are trying to link to the PAM libraries, in which case...
> 
> gcc -o pam_module.so pam_module.c -llibpam 
> 
> Of course this is all listed within the developers handbook
> 
> Jas

That looks like it might be my problem. I will test tonight. could you
point me to the developer's handbook, Which i assume is not the module
writer's guide included with my distro.
thanks,
ben

--

-- 
Ben Hildred
Estimator
Applied Plastic Coatings, Inc.
5000 Tabor St.
Wheat Ridge, CO 80033
303 424 9200
F: 303 424 8800
ben <at> appliedplastic.com
http://appliedplastic.com
Jason Gerfen | 22 Dec 2011 01:48
Picon
Favicon

Re: Pam Perl or how to debug a pam module

It actually is the module writers guide that should be used. In terms of debugging once compiled as shown
above, tools like nm, ldd and objdump can be used to verify library linking and function calls available
within the compiled shared object.

Jason Gerfen

On Dec 21, 2011, at 2:59 PM, "ben" <ben <at> appliedplastic.com> wrote:

> On 12/20/2011 6:20 PM, Jason Gerfen wrote:
>> Linker errors? My first assumption is that you are trying to link to the PAM libraries, in which case...
>> 
>> gcc -o pam_module.so pam_module.c -llibpam 
>> 
>> Of course this is all listed within the developers handbook
>> 
>> Jas
> 
> That looks like it might be my problem. I will test tonight. could you
> point me to the developer's handbook, Which i assume is not the module
> writer's guide included with my distro.
> thanks,
> ben
> 
> -- 
> Ben Hildred
> Estimator
> Applied Plastic Coatings, Inc.
> 5000 Tabor St.
> Wheat Ridge, CO 80033
> 303 424 9200
(Continue reading)

ben | 23 Dec 2011 02:08
Favicon

Re: Pam Perl or how to debug a pam module

On 12/21/2011 5:48 PM, Jason Gerfen wrote:
> It actually is the module writers guide that should be used. In terms of debugging once compiled as shown
above, tools like nm, ldd and objdump can be used to verify library linking and function calls available
within the compiled shared object.
> 
> Jason Gerfen
> 
> 

Indeed linking against the correct library helped. unfortunately, the
included documentation is wrong, and now that it is links correctly at
run time, it segfaults, so I'm going to bug  a njanph or two. If anyone
wants to play with my code, drop me a line.

thanks,
ben

--

-- 
Ben Hildred
Estimator
Applied Plastic Coatings, Inc.
5000 Tabor St.
Wheat Ridge, CO 80033
303 424 9200
F: 303 424 8800
ben <at> appliedplastic.com
http://appliedplastic.com

Gmane