Merge lp:~dbarth/ubuntuone-credentials/acl-updater-script into lp:ubuntuone-credentials/rtm-14.09

Proposed by David Barth
Status: Merged
Approved by: dobey
Approved revision: 168
Merged at revision: 151
Proposed branch: lp:~dbarth/ubuntuone-credentials/acl-updater-script
Merge into: lp:ubuntuone-credentials/rtm-14.09
Diff against target: 75 lines (+34/-1)
4 files modified
acl-updater/acl-updater (+29/-0)
debian/control (+3/-0)
debian/libubuntuoneauth-2.0-0.migrations (+1/-0)
debian/rules (+1/-1)
To merge this branch: bzr merge lp:~dbarth/ubuntuone-credentials/acl-updater-script
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+252346@code.launchpad.net

Commit message

Upgrades the ACL of U1 accounts registered in the Online Accounts database.
Add dependencies on sqlite3 and account-plugin-tools for migration script.

Description of the change

Upgrades the ACL of U1 accounts registered in the Online Accounts database.
Add dependencies on sqlite3 and account-plugin-tools for migration script.

To post a comment you must log in.
168. By David Barth

resync with mardy's branch

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'acl-updater'
2=== added file 'acl-updater/acl-updater'
3--- acl-updater/acl-updater 1970-01-01 00:00:00 +0000
4+++ acl-updater/acl-updater 2015-03-09 18:02:36 +0000
5@@ -0,0 +1,29 @@
6+#!/bin/sh
7+#
8+
9+export LC_ALL=C
10+SIGNON_DB="$HOME/.config/signond/signon.db"
11+
12+ACCOUNT_ID=`account-console list | grep -i ubuntuone | grep -o '[0-9]\+'`
13+if [ -z $ACCOUNT_ID ]; then
14+ echo "no U1 account found; exiting"
15+ exit 1
16+fi
17+CREDS_ID=`account-console show $ACCOUNT_ID | grep CredentialsId | grep -o '[0-9]\+'`
18+if [ -z $CREDS_ID ]; then
19+ echo "no U1 account found; exiting"
20+ exit 1
21+fi
22+
23+echo "Upgrading ACL for U1 account (id:$CREDS_ID)"
24+
25+# ensure the 'unconfined' element exists in the table
26+UNCONFINED=`sqlite3 $SIGNON_DB 'select id from TOKENS where token="unconfined"'`
27+if [ -z $UNCONFINED ]; then
28+ sqlite3 $SIGNON_DB 'insert or ignore into TOKENS(token) values ("unconfined")'
29+fi
30+
31+# add the ACL to protect the U1 account
32+sqlite3 $SIGNON_DB "insert or ignore into ACL (identity_id, token_id) values ($CREDS_ID, (select id from TOKENS where token='unconfined'))"
33+
34+echo "done"
35
36=== modified file 'debian/control'
37--- debian/control 2014-08-20 14:33:41 +0000
38+++ debian/control 2015-03-09 18:02:36 +0000
39@@ -4,6 +4,7 @@
40 Build-Depends:
41 cmake,
42 debhelper (>= 9),
43+ dh-migrations,
44 libaccounts-qt5-dev,
45 liboauth-dev,
46 libsignon-qt5-dev,
47@@ -70,7 +71,9 @@
48 multiarch-support,
49 ${misc:Pre-Depends},
50 Depends:
51+ account-plugin-tools,
52 signon-plugin-password,
53+ sqlite3,
54 ubuntuone-credentials-common (= ${source:Version}),
55 ${misc:Depends},
56 ${shlibs:Depends},
57
58=== added file 'debian/libubuntuoneauth-2.0-0.migrations'
59--- debian/libubuntuoneauth-2.0-0.migrations 1970-01-01 00:00:00 +0000
60+++ debian/libubuntuoneauth-2.0-0.migrations 2015-03-09 18:02:36 +0000
61@@ -0,0 +1,1 @@
62+acl-updater/acl-updater
63
64=== modified file 'debian/rules'
65--- debian/rules 2014-07-24 14:12:32 +0000
66+++ debian/rules 2015-03-09 18:02:36 +0000
67@@ -7,7 +7,7 @@
68
69
70 %:
71- dh $@ --buildsystem cmake --fail-missing
72+ dh $@ --buildsystem cmake --fail-missing --with migrations
73
74 override_dh_auto_configure:
75 dh_auto_configure -- -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH)

Subscribers

People subscribed via source and target branches

to all changes: