4 code results in snapcore/snapd

C
cmd/snap-confine/snap-confine.c
Showing the top two matches Last indexed Nov 17, 2017
154 if (geteuid() != 0 && secure_getenv("SNAP_CONFINE_NO_ROOT") == NULL) {
155 die("need to run as root or suid");
156 }
157 #endif
158
159 char *snap_context SC_CLEANUP(sc_cleanup_string) = NULL;
162 struct sc_error *err SC_CLEANUP(sc_cleanup_error) = NULL;
163 snap_context = sc_cookie_get_from_snapd(snap_name, &err);
164 if (err != NULL) {
Go
cmd/snapctl/main.go
Showing the top match Last indexed Nov 2, 2017
72 cookie = os.Getenv("SNAP_CONTEXT")
73 }
74 return cli.RunSnapctl(&client.SnapCtlOptions{
75 ContextID: cookie,
76 Args: os.Args[1:],
77 })
78 }
YAML
tests/main/snap-env/task.yaml
Showing the top match Last indexed Jan 2, 2018
32 MATCH "^SNAP_COOKIE=$CTX" < snap-vars.txt
33 MATCH "^SNAP_CONTEXT=$CTX" < snap-vars.txt
Go
overlord/hookstate/hookmgr.go
Showing the top two matches Last indexed Jan 2, 2018
378 fmt.Sprintf("SNAP_COOKIE=%s", hookContext),
379 // Set SNAP_CONTEXT too for compatibility with old snapctl
380 // binary when transitioning to a new core - otherwise configure
381 // hook would fail during transition.
382 fmt.Sprintf("SNAP_CONTEXT=%s", hookContext),