Giter Club home page Giter Club logo

Comments (3)

dominikschulz avatar dominikschulz commented on July 26, 2024 1

Running under strace shows that go test ./... writes to the global gopass config a few times ☚ī¸

$ GOPASS_HOMEDIR=/tmp/gp1
$ strace -f -o /tmp/gopass.strace go test ./... -count=1
$ grep "/tmp/gp1/.config/gopass/config" /tmp/gopass.strace | grep O_WRONLY
256051 openat(AT_FDCWD, "/tmp/gp1/.config/gopass/config", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0600 <unfinished ...>
256049 openat(AT_FDCWD, "/tmp/gp1/.config/gopass/config", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0600 <unfinished ...>
256060 openat(AT_FDCWD, "/tmp/gp1/.config/gopass/config", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0600 <unfinished ...>
256049 openat(AT_FDCWD, "/tmp/gp1/.config/gopass/config", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0600 <unfinished ...>
256435 openat(AT_FDCWD, "/tmp/gp1/.config/gopass/config", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0600 <unfinished ...>
256049 openat(AT_FDCWD, "/tmp/gp1/.config/gopass/config", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0600 <unfinished ...>

Now we need to figure out where this happens.

Edit: Actually this overwrites the entire config (O_CREATE and O_TRUNC).

from gopass.

dominikschulz avatar dominikschulz commented on July 26, 2024 1

I think I got it (mostly). Not exactly sure what the root cause is, but the trigger might be related to some of your recent changes @AnomalRoil .

We should probably add ctx = config.NewNoWrites().WithConfig(ctx) to every (?) unit test.
Will work on a PR tomorrow.

from gopass.

dominikschulz avatar dominikschulz commented on July 26, 2024

The plot thickens:

$ grep "writing config to /tmp/gp1/.config/gopass/config" /tmp/gp.log 
2023/11/25 18:20:57.225061 gitconfig/config.go:258	gitconfig.(*Config).flushRaw	writing config to /tmp/gp1/.config/gopass/config: 
2023/11/25 18:20:57.226834 gitconfig/config.go:258	gitconfig.(*Config).flushRaw	writing config to /tmp/gp1/.config/gopass/config: 
2023/11/25 18:20:57.233848 gitconfig/config.go:258	gitconfig.(*Config).flushRaw	writing config to /tmp/gp1/.config/gopass/config: 
2023/11/25 18:20:57.234426 gitconfig/config.go:258	gitconfig.(*Config).flushRaw	writing config to /tmp/gp1/.config/gopass/config: 
2023/11/25 18:20:57.278175 gitconfig/config.go:258	gitconfig.(*Config).flushRaw	writing config to /tmp/gp1/.config/gopass/config: 
2023/11/25 18:20:57.307876 gitconfig/config.go:258	gitconfig.(*Config).flushRaw	writing config to /tmp/gp1/.config/gopass/config:

from gopass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.