[PATCH 1/2] s3fs-popt: Add function to burn the commandline password.

Jeremy Allison jra at samba.org
Thu Nov 8 13:55:32 MST 2012


On Thu, Nov 08, 2012 at 09:43:51PM +0100, Jelmer Vernooij wrote:
> Hi Andreas, Jeremy,
> 
> On Tue, 2012-11-06 at 09:27 +0100, Andreas Schneider wrote:
> > Signed-off-by: Andreas Schneider <asn at samba.org>
> > ---
> >  source3/include/popt_common.h |  1 +
> >  source3/lib/popt_common.c     | 47 +++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 48 insertions(+)
> > 
> > diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h
> > index 2125ed6..5266f36 100644
> > --- a/source3/include/popt_common.h
> > +++ b/source3/include/popt_common.h
> > @@ -49,5 +49,6 @@ extern const struct poptOption popt_common_dynconfig[];
> >  #define POPT_COMMON_OPTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_option, 0, "Common samba commandline config:", NULL },
> >  
> >  void popt_common_set_auth_info(struct user_auth_info *auth_info);
> > +void popt_burn_cmdline_password(int argc, char *argv[]);
> >  
> Looking at this code again, I'm not sure I understand what this does
> exactly.
> 
> Right after parsing the username with included password, we already take
> care of erasing the password in memory in argv (see
> source3/lib/popt_common.c:555). What this do exactly that isn't covered
> by that code? Am I misunderstanding the current code?

I wasn't aware of that code in source3/lib/popt_common.c:555.

It does look like it's doing something similar.

Andreas, can you check if this has the same effect (I just
checked that the password part of the argv was erased by
the patch, I didn't check if it was already being done
somewhere else :-).

Jeremy


More information about the samba-technical mailing list