Coder Social home page Coder Social logo

PATH, GOROOT, GOPATH about gokrazy HOT 7 CLOSED

gokrazy avatar gokrazy commented on June 2, 2024
PATH, GOROOT, GOPATH

from gokrazy.

Comments (7)

tv42 avatar tv42 commented on June 2, 2024 2

Sounds like a great reason to separate building from writing to SD card. shrug If this doesn't seem important to you, I'll just have to take note that you don't care and move along.

from gokrazy.

stapelberg avatar stapelberg commented on June 2, 2024 1

The best practice is to not use sudo at all, but rather grant the required capabilities to the gokr-packer binary, as https://gokrazy.org/quickstart.html does via sudo setcap CAP_SYS_ADMIN,CAP_DAC_OVERRIDE=ep $(go env GOPATH)/bin/gokr-packer.

Why does that not work for you?

from gokrazy.

YaguraStation avatar YaguraStation commented on June 2, 2024 1

TLDR: That simply answers the question, sorry.

It's a long - now uninteresting story - from my first experiment with gokrazy, setting an environment up for root, then reverting back to user and messed up secure_path and env_keep in the sudoers file... eventually libcap2-bin not working anymore. Probably based on some initial misunderstanding of a few errors, the role of setcap, and necessity of elevated rights. Works on a "clean" machine just fine now.

from gokrazy.

tv42 avatar tv42 commented on June 2, 2024

Permanently giving some random binary CAP_SYS_ADMIN is a really bad idea. That allows it to e.g. extract secrets from from kernel memory and from disk. Transient privileges (for this run only) are much safer.

from gokrazy.

stapelberg avatar stapelberg commented on June 2, 2024

How exactly can one grant transient privileges?

from gokrazy.

tv42 avatar tv42 commented on June 2, 2024

You're already doing that with sudo, for the setcap run.

from gokrazy.

stapelberg avatar stapelberg commented on June 2, 2024

Using sudo for the gokr-packer command results in compilation happening as root, which is not intended.

If you dislike granting CAP_SYS_ADMIN, don’t specify a privileged device to the -overwrite= flag and do your own copying.

from gokrazy.

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.