How unstable is the CVS source?: smbpasswd
Lonnie J. Borntreger
lonnie at borntreger.com
Wed Jul 7 13:14:02 GMT 1999
I just got the latest CVS and the entire getpwnam interface has been
rewritten, so you can forget the patch. The SIGBUS no longer happens
(although my login/connection attempts always fail now ;)
Lonnie Borntreger
> -----Original Message-----
> From: java at bitserv.vpnet.at [mailto:java at bitserv.vpnet.at]On Behalf Of
> Bertl
> Sent: Wednesday, July 07, 1999 7:15 AM
> To: lonnie at borntreger.com
> Cc: D.Bannon at latrobe.edu.au; SambaList (E-mail)
> Subject: Re: How unstable is the CVS source?: smbpasswd
>
>
> "Lonnie J. Borntreger" wrote:
> >
> > This was covered in the thread "SIGBUS Panic in smbd". I
> submitted a fix to
> > Luke who is having some people test it before it's posted.
> (see attached
> > message and diff).
>
> Hi!
>
> I don't think the diff is right: When USE_HASHED_GETPWNAM is
> set, the pw_passwd field is allocated with strdup (line 145),
> so this looks like a (very small) memory leak...
>
> I tried the following and it seems to work with hash and without:
> (btw: why is pw-hashing not set by default?)
>
> --- username.c.orig Thu Jul 1 16:01:52 1999
> +++ username.c Wed Jul 7 13:38:23 1999
> @@ -228,9 +228,8 @@
>
> struct passwd *hashed_getpwnam(const char *name)
> {
> -#ifndef USE_HASHED_GETPWNAM
> - return getpwnam(name);
> -#else
> + struct passwd *ret;
> +#ifdef USE_HASHED_GETPWNAM
> struct passwd_hash_table_s *pht=&passwd_hash_table;
>
> DEBUG(5,("getpwnam(%s)\n", name));
> @@ -259,8 +258,11 @@
> return NULL;
> }
> /* Fall back to real getpwnam() */
> - return getpwnam(name);
> #endif
> + ret = getpwnam(name);
> + if(ret != NULL)
> + ret->pw_passwd = strdup(ret->pw_passwd);
> + return ret;
> }
>
More information about the samba-ntdom
mailing list