Rename the package and everything else from ubuntu-core-launcher to snap-run #1

Merged
merged 3 commits into from May 24, 2016
View
@@ -1,2 +1,2 @@
-src/ubuntu-core-launcher
+src/snap-run
src/tmp
View
@@ -1,11 +1,11 @@
# Overview
-The ubuntu-core-launcher launches snappy applications to restrict
+The snap-run program launches snappy applications to restrict
access. It uses apparmor and seccomp to do this.
Run with:
- $ ubuntu-core-launcher /path/to/rootdir security-profile /path/to/binary additional args
+ $ snap-run /path/to/rootdir security-profile /path/to/binary additional args
Can run the tests with:
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/snap-run "$@"
View
@@ -1,3 +1,13 @@
+ubuntu-core-launcher (2.0) UNRELEASED; urgency=medium
+
+ * Rename the package and everything else from ubuntu-core-launcher to
+ snap-run
+ * Allow for graceful migrations from ubuntu-core-launcher to snap-run by
+ providing both commands as binary packages, with proper dependencies and
+ post-installation scripts that manage apparmor profile changes.
+
+ -- Zygmunt Krynicki <zygmunt.krynicki@canonical.com> Sun, 22 May 2016 16:14:24 +0300
+
ubuntu-core-launcher (1.0.28) yakkety; urgency=medium
* SECURITY UPDATE: delayed attack snap data theft and privilege escalation
View
@@ -4,12 +4,21 @@ Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Build-Depends: debhelper (>= 9), libseccomp-dev, libapparmor-dev, libudev-dev, dh-apparmor, indent
Standards-Version: 3.9.6
-Vcs-Bzr: lp:~snappy-dev/ubuntu-core-launcher/trunk
+Vcs-Git: https://github.com/ubuntu-core/snap-run
-Package: ubuntu-core-launcher
+Package: snap-run
Architecture: any
+Breaks: ubuntu-core-launcher (<< 2.0)
+Replaces: ubuntu-core-launcher (<< 2.0)
Depends: ${misc:Depends}, ${shlibs:Depends}, apparmor
-Breaks: ubuntu-snappy-cli (<< 1.9), snapd (<< 1.9)
+Description: Launcher for snappy apps
+ This package contains the launcher for applications packaged as snaps
+
+Package: ubuntu-core-launcher
+Architecture: all
@mvo5

mvo5 May 24, 2016

Contributor

You could add Section: oldlibs as a further (informal) clue that this is a transitional thing.

+Depends: ${misc:Depends}, ${shlibs:Depends}, snap-run
+Pre-Depends: dpkg (>= 1.17.14)
Description: Launcher for ubuntu-core (snappy) apps
- This package contains the launcher for launching ubuntu-core applications
- on a ubuntu "snappy" system.
+ This is a transitional package that lets existing installation depending on
+ ubuntu-core-launcher syntax continue to work as-is. In the future this will become
+ an empty transitional package.
View
@@ -1,7 +1,7 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
-Copyright: 2014 Canonical Ltd.
+Copyright: 2014-16 Canonical Ltd.
License: GPL-3.0
License: GPL-3.0
View
@@ -1 +0,0 @@
-debian/usr.bin.ubuntu-core-launcher etc/apparmor.d
View
@@ -4,8 +4,8 @@
dh $@
override_dh_fixperms:
- dh_fixperms -Xusr/bin/ubuntu-core-launcher
+ dh_fixperms -Xusr/bin/snap-run
override_dh_installdeb:
- dh_apparmor --profile-name=usr.bin.ubuntu-core-launcher -pubuntu-core-launcher
+ dh_apparmor --profile-name=usr.bin.snap-run -psnap-run
dh_installdeb
@@ -0,0 +1,3 @@
+debian/usr.bin.snap-run etc/apparmor.d
+usr/*
+lib/*
@@ -0,0 +1 @@
+compat/ubuntu-core-launcher usr/bin
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# XXX: doesn't seem to really work in practice. Perhaps the version needs love
+dpkg-maintscript-helper rm_conffile \
@mvo5

mvo5 May 24, 2016

Contributor

Instead of writing this in three places (postinst, postrm, preinst), it can also be written in a single place: debian/snap-run.mainscript with the content rm_conffile /etc/apparmor.d/usr.bin.ubuntu-core-launcher 2.0~.

+ /etc/apparmor.d/usr.bin.ubuntu-core-launcher 2.0~ -- "$@"
+
+case $1 in
+ configure)
+ # remove current profile so that the pass-through can still run
+ if [ -e /sys/kernel/security/apparmor/.remove ]; then
+ echo -n '/usr/bin/ubuntu-core-launcher' > /sys/kernel/security/apparmor/.remove
+ fi
+ ;;
+esac
@@ -0,0 +1,3 @@
+#!/bin/sh
+dpkg-maintscript-helper rm_conffile \
+ /etc/apparmor.d/usr.bin.ubuntu-core-launcher 2.0~ -- "$@"
@@ -0,0 +1,3 @@
+#!/bin/sh
+dpkg-maintscript-helper rm_conffile \
+ /etc/apparmor.d/usr.bin.ubuntu-core-launcher 2.0~ -- "$@"
@@ -1,7 +1,7 @@
# Author: Jamie Strandboge <jamie@canonical.com>
#include <tunables/global>
-/usr/bin/ubuntu-core-launcher (attach_disconnected) {
+/usr/bin/snap-run (attach_disconnected) {
# We run privileged, so be fanatical about what we include and don't use
# any abstractions
/etc/ld.so.cache r,
@@ -17,7 +17,7 @@
/usr/lib/@{multiarch}/libseccomp.so* mr,
/lib/@{multiarch}/libseccomp.so* mr,
- /usr/bin/ubuntu-core-launcher r,
+ /usr/bin/snap-run r,
/dev/null rw,
/dev/full rw,
View
@@ -1,16 +1,15 @@
-
CFLAGS= -D_GNU_SOURCE -O2 -Wall -Werror $(shell dpkg-buildflags --get CFLAGS)
LD_FLAGS = $(shell dpkg-buildflags --get LDFLAGS)
LIBS = -lapparmor -lseccomp -ludev
TMPDIR = ./tmp
FMT = indent -linux
-BIN = ubuntu-core-launcher
+BIN = snap-run
HDRS = $(wildcard *.h)
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
-ubuntu-core-launcher: $(OBJS)
+snap-run: $(OBJS)
$(CC) $(OBJS) -o $@ $(LD_FLAGS) $(LIBS)
%.o: %.c
View
@@ -1,6 +1,6 @@
#!/bin/sh
-L=$(pwd)/../src/ubuntu-core-launcher
+L=$(pwd)/../src/snap-run
TMP="$(mktemp -d)"
trap "rm -rf $TMP" EXIT