archive mirror
 help / color / mirror / Atom feed
* cgit and global configuration
@ 2019-06-11 15:04 Christian Hesse
  2019-06-11 19:55 ` Junio C Hamano
  2019-06-11 20:22 ` Jeff Hostetler
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Hesse @ 2019-06-11 15:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List, Jeff Hostetler, Jason A. Donenfeld

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

Dear Jeff, dear Junio,

for cgit we use the static git library built into the executable. This used
to work well, but breaks with latest release v2.22.0: Our code unsets HOME
and XDG_CONFIG_HOME to mitigate loading arbitrary configuration.
We have tests that use strace to check for access to directories given by
environment variables.

With the new trace2 code in place at least tracing configuration is loaded
before cmd_main() kicks in. This happens in trace2_initialize_fl() ->
tr2_sysenv_load() -> read_very_early_config(). The offending commit is
bce9db6d ("trace2: use system/global config for default trace2 settings") [0].

I had thought about adding a new option to struct config_options and making
xdg_config_home() and expand_user_path() conditional in
do_git_config_sequence() when called from read_very_early_config(). However
this breaks the test suite as ptrace2 tests with global configuration depend
on HOME being set to a trash directory. Any hint about how to properly solve
Or can we be sure configuration read at this point can not do any harm and
updating out tests is sufficient? I guess no as file paths can be specified.

Best regards,
Christian Hesse

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-25 21:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 15:04 cgit and global configuration Christian Hesse
2019-06-11 19:55 ` Junio C Hamano
2019-06-11 20:22 ` Jeff Hostetler
2019-06-12 19:08   ` Jeff King
2019-10-25 16:10     ` Christian Hesse
2019-10-25 21:24       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).