Re: [PATCH v3 4/9] bugreport: add config values from whitelist
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 15, 2019, 17:30 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1912151826380.46@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20191211204811.GC107889@google.com>
Hi Emily,
On Wed, 11 Dec 2019, Emily Shaffer wrote:
Show 20 quoted lines
> On Mon, Oct 28, 2019 at 03:14:35PM +0100, Johannes Schindelin wrote: > > > > > On Thu, 24 Oct 2019, Emily Shaffer wrote: > > > > > Teach bugreport to gather the values of config options which are > > > present in 'git-bugreport-config-whitelist'. > > > > > > Many config options are sensitive, and many Git add-ons use config > > > options which git-core does not know about; it is better only to > > > gather config options which we know to be safe, rather than > > > excluding options which we know to be unsafe. > > > > Should we still have the `// bugreport-exclude` comments, then? > > They were optional (useless) before too. I can remove them if you want; > I suppose I like the idea of having precedent if someone wants to build > their own internal version with opt-out configs rather than opt-in. I > can remove them if we want; it doesn't matter very much to me either > way.
How are you guaranteeing that this information does not become stale, like, immediately?
If you _still_ insist on keeping those comments even after answering this question, at least please turn them into C-style comments: we have no C++-style comments in Git and want to keep it this way.
Show 28 quoted lines
> > > diff --git a/bugreport.c b/bugreport.c
> > > [...]
> > > + }
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +void get_whitelisted_config(struct strbuf *config_info)
> > > +{
> > > + struct strbuf path = STRBUF_INIT;
> > > +
> > > + strbuf_addstr(&path, git_exec_path());
> > > + strbuf_addstr(&path, "/git-bugreport-config-whitelist");
> >
> > Hmm. I would have expected this patch to come directly after the patch
> > 2/9 that generates that white-list, and I would also have expected that
> > to be pre-sorted, and compiled in.
> >
> > Do you want users to _edit_ the file in the exec path? In general, that
> > path will be write-protected, though. A better alternative would
> > probably be to compile in a hard-coded list, and to allow including more
> > values e.g. by offering command-line options to specify config setting
> > patterns. But if we allow patterns, we might actually want to have those
> > exclusions to prevent sensitive data from being included.
>
> Hm, interesting. Do we have precedent for compiling in a header
> generated during the build process? I think I saw one when I was adding
> this script - I'll take a look.Yes, we do. The entire `command-list.h` is generated during the build. Look for `GENERATED_H` in the `Makefile`.
Ciao, Dscho