Projects STRLCPY cdebug Commits 4ce2320c
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 127 lines
    128 128   
    129 129  The secret sauce is the symlink + PATH modification + chroot-ing.
    130 130   
     131 +## F.A.Q
     132 + 
     133 +**Q:** Running `cdebug exec` fails with `rm: cannot remove '/proc/1/root/nix': Permission denied` or
     134 +`ln: /proc/1/root/.cdebug-XXXXXXXX: Permission denied`.
     135 + 
     136 +Chances are your target container has been started with elevated permissions while you're trying to run a non-privileged debugger sidecar. Try `cdebug exec --privileged` instead.
     137 + 
    131 138  ## Similar tools
    132 139   
    133 140  - [`docker-slim debug`](https://github.com/docker-slim/docker-slim) - a PoC `debug` command for DockerSlim (contributed by [D4N](https://github.com/D4N))
    skipped 18 lines
  • ■ ■ ■ ■ ■
    cmd/exec/exec.go
    skipped 2 lines
    3 3  import (
    4 4   "bytes"
    5 5   "context"
     6 + "encoding/json"
    6 7   "fmt"
    7 8   "io"
    8 9   "strings"
    skipped 165 lines
    174 175   AttachStderr: true,
    175 176   },
    176 177   &container.HostConfig{
    177  - Privileged: opts.privileged,
     178 + Privileged: target.HostConfig.Privileged || opts.privileged,
     179 + CapAdd: target.HostConfig.CapAdd,
     180 + CapDrop: target.HostConfig.CapDrop,
     181 + 
    178 182   AutoRemove: opts.autoRemove,
    179 183   
    180 184   NetworkMode: container.NetworkMode(nsMode),
    skipped 186 lines
    367 371   return
    368 372  }
    369 373   
     374 +func pprint(v any) {
     375 + b, _ := json.MarshalIndent(v, "", " ")
     376 + fmt.Println(string(b))
     377 +}
     378 + 
Please wait...
Page is in error, reload to recover