30 Commits

Author SHA1 Message Date
Miguel Pires
29c9752d66 many: s/ioutil.WriteFile/os.WriteFile (#13217)
Replace ioutil.WriteFile with os.WriteFile since the former has been
deprecated since go1.16 and simply calls the latter.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-09-26 11:38:46 +01:00
Samuele Pedroni
c2c8f2489c cmd: fix imports order (according to gci)
gci needed cmd/snap-seccomp/main.go import comment to made one long line
otherwise it keeps only the last line :(

cmd/snap/color_test.go need some manual cleanup of commented out imports
2021-06-15 10:25:05 +02:00
Michael Vogt
67901c9dd5 client,snapctl: add naive support for "stdin"
This adds initial support for having "snapctl" commands read
from "stdin". Note that in the future we want something more
advanced that keeps the connection open and forwards the real
stdin to the server. But this requires much more work.
2020-11-25 15:47:56 +01:00
Samuele Pedroni
8ebf6d56aa c/snapctl,usersession: drive-by: move xdgopenproxy under usersession 2020-05-12 16:49:37 +02:00
Pawel Stolowski
7ba4ea1cd5 Merge branch 'master' into snapctl-is-connected 2019-12-06 11:15:20 +01:00
Ian Johnson
b372b957b6 tests/cmd/snapctl: unset SNAP_CONTEXT for the suite
This variable can also be used to specify the cookie to use for snapctl, and
sometimes other tests can leak this env var, so to be safe just unset it in the
start of our test to ensure that we always use SNAP_COOKIE for this test

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2019-12-04 14:16:40 -06:00
Pawel Stolowski
a2f9965cd4 Pass exit-code as number, not string. 2019-12-04 18:26:50 +01:00
Pawel Stolowski
d7176293a8 Fix spelling errors. 2019-11-29 11:16:19 +01:00
Pawel Stolowski
d04c5f74f8 Introduce UnsuccesfulError in ctlcmd and use it to propagate exit code from is-connected (thanks pedronis). 2019-11-29 10:57:21 +01:00
Michael Vogt
82a68da27a many: remove deadcode
I ran deadcode (remyoudompheng/go-misc/deadcode) over our codebase
and removed all the low hanging fruits.
2018-09-05 10:21:29 +02:00
James Henstridge
92443bedf9 xdgopenproxy: integrate xdg-open implementation into snapctl (#4794)
* xdgopenproxy: add a Go implementation of the xdg-open proxy client

* xdgopenproxy: add tests

* xdgopenproxy: test that passed file descriptor is for expected file

* xdgopenproxy: fix copyright years
2018-03-08 13:43:09 +01:00
Michael Vogt
e9eafa17a7 many: handle core configuration internally instead of using the core configure hook (#4076)
This makes handling the configuration of core/snapd internal to snapd by using a dedicated handler chosen from snapstate.Configure instead of setting up running the "configure" hook.
2017-11-02 08:04:14 +01:00
Michael Vogt
467bf49dc3 address review comments (thanks to Gustavo) 2017-07-13 09:43:32 +02:00
Michael Vogt
1de88c39d7 simplify snapctl/main.go 2017-07-06 17:15:59 +02:00
Michael Vogt
fb6d567d86 add first go version of the core configure code 2017-07-06 12:23:32 +02:00
Pawel Stolowski
5da6cd1627 Further compatibilty changes to support SNAP_CONTEXT in transition period. 2017-06-02 13:32:06 +02:00
Pawel Stolowski
38ace232b9 Renamed SNAP_CONTEXT env var to SNAP_COOKIE. 2017-06-01 10:03:35 +02:00
Pawel Stolowski
16aed8f2d6 Minor cleanups. Restored SNAP_CONTEXT for now. 2017-05-30 10:17:42 +02:00
Pawel Stolowski
1ef17160a8 More renaming, check cookie length in spread test. 2017-05-29 10:11:39 +02:00
Michael Vogt
c7ac9f7a74 Select what socket to use in cmd/snap{,ctl}
So far we relied on apparmor to figure out what snap socket we
can use. However this fails on distributions without apparmor
support.
2017-03-28 21:24:09 +02:00
Samuele Pedroni
75da4a8ac2 clearer more consistent envvars for auth data files 2017-02-16 17:43:21 +01:00
Michael Vogt
4aa77dc585 comment why snapctl will not use auth 2017-02-01 15:24:19 +01:00
Michael Vogt
87db3c11d2 add config in client to disable auth and use it in snapctl
LP: #1660941
2017-02-01 13:11:54 +01:00
Kyle Fazzari
0759d761fa many: support snapctl -h
This makes the tool much easier to discover (and document). It requires
that the API accepts a missing context, however, which means the
commands need to verify its presence before using it.

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
2016-09-16 07:02:07 -07:00
Kyle Fazzari
0b006f2c3f s/request/options/
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
2016-08-29 15:07:50 -07:00