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

[pwdb memory leak.]



Redhat maintain libpwdb. They release it in .rpm form and I guess you'll
need to submit your bug report to them.

[Redhat folk do read the pam-list, so I'm Cc:ing your email there.]

Thanks for the suggested patch!

Cheers

Andrew

Koni wrote:
> 
> Dear Morgan,
> 
> Sorry, I guess this got sent to old email address. I found this one on
> the Linux PAM page a kernel.org. The attached is about memory leaks in
> linux libpwdb-0.61. I did not find a new version yet, or a web page for
> the library. If you can spare a moment, please tell me where I can find
> the development site for libpwdb and any comments you have on the
> solutions I used below, or, point me toward the active developers for
> libpwdb.
> 
> Cheers,
> Koni
> 
> --
> mhw6@cornell.edu
> Koni (Mark Wright)
> Solanaceae Genome Network       250 Emerson Hall - Cornell University
> Strategic Forecasting           242 Langmuir Laboratory
> Lightlink Internet              http://www.lightlink.com/
> 
> "If I'm right 90% of the time, why quibble about the other 3%?"
> 
>   ------------------------------------------------------------------------
> 
> Subject: failure notice
> Date: 5 Apr 2001 00:13:29 -0000
> From: MAILER-DAEMON@askatu.strategicforecasting.com
> To: mhw6@cornell.edu (Mark Hamilton Wright)
> 
> Hi. This is the qmail-send program at askatu.strategicforecasting.com.
> I'm afraid I wasn't able to deliver your message to the following addresses.
> This is a permanent error; I've given up. Sorry it didn't work out.
> 
> <morgan@parc.power.net>:
> Sorry, I wasn't able to establish an SMTP connection. (#4.4.1)
> I'm not going to try again; this message has been in the queue too long.
> 
> --- Below this line is a copy of the message.
> 
> Return-Path: <mhw6@cornell.edu>
> Received: (qmail 13321 invoked from network); 28 Mar 2001 23:13:21 -0000
> Received: from askatu.corsim.bogus.net (HELO txakoli) (root@192.168.2.6)
>   by askatu.corsim.bogus.net with SMTP; 28 Mar 2001 23:13:21 -0000
> Subject: Memory leaks in libpwdb-0.61
> From: Koni <mhw6@cornell.edu>
> To: morgan@parc.power.net
> Cc: gafton@sorosis.ro
> Content-Type: text/plain
> X-Mailer: Evolution (0.9/+cvs.2001.03.16.09.00 - Preview Release)
> Date: 28 Mar 2001 18:12:44 -0500
> Mime-Version: 1.0
> 
> Hello,
> 
> My name is Koni. In the process of developing some soon to be open
> source software for a local ISP here in Ithaca, NY, which uses PAM to
> authenticate users, I've tracked down some memory leaks in my program
> which led to the PAM libraries, and ultimately to "libpwdb". At the end
> of this email are diffs for pwdb_module.c and pwdb_start.c
> 
> This is for pwdb version 0.61, as distrubted in RedHat-6.2. I didn't
> find the project homepage for possibly more recent versions, so I
> apologize if this is already known and fixed.
> 
> In pwdb_module.c, two dynamically allocated/reallocated arrays were not
> being freed. They are arrays of pointers, and the pointers are being
> freed but not the array itself. I added the appropriate free() calls.
> 
> In pwdb_start.c, something was calling _pwdb_delete_string(entry->name)
> to free memory, but entry->name was set to NULL explicitly before this
> call, which means _pwdb_delete_string will not free the string (nor will
> it zero the memory before freeing!). I deleted the line that set
> entry->name to NULL.
> 
> I found no further memory leaks in PAM or pwdb and the core size of my
> server is no longer growing with each authenticated connection. I'm
> using shadow passwords on my system at the moment. Thus, I conclude
> that, for the path of execution for authenticating a user using shadow
> passwords, libpwdb with these fixes has no futher memory leaks.
> 
> Thank you very very much for developing this software. PAM and pwdb have
> greatly simplified authentication for us, as well as allowed an
> impressive amount of options in handling user sessions and
> authentication methods.
> 
> Cheers,
> Koni
> 
> Diffs:
> 
> for file: libpwdb/pwdb/pwdb_module.c
> 309a310
> >     if (pwdb_policy) free(pwdb_policy);
> 315a317
> >     if (pwdb_group_policy) free(pwdb_group_policy);
> 
> for file: libpwdb/pwdb/pwdb_start.c
> 77d76
> <     entry->name = NULL;
> 
> --
> mhw6@cornell.edu
> Koni (Mark Wright)
> Solanaceae Genome Network       250 Emerson Hall - Cornell University
> Strategic Forecasting           242 Langmuir Laboratory
> Lightlink Internet              http://www.lightlink.com/
> 
> "If I'm right 90% of the time, why quibble about the other 3%?"





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