Merge lp:~mardy/ubuntuone-credentials/lp1376445-migration-vivid into lp:ubuntuone-credentials

Proposed by Alberto Mardegan on 2015-03-09
Status: Merged
Approved by: dobey on 2015-04-01
Approved revision: 179
Merged at revision: 186
Proposed branch: lp:~mardy/ubuntuone-credentials/lp1376445-migration-vivid
Merge into: lp:ubuntuone-credentials
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:~mardy/ubuntuone-credentials/lp1376445-migration-vivid
Reviewer Review Type Date Requested Status
dobey (community) 2015-03-09 Approve on 2015-04-01
PS Jenkins bot continuous-integration Approve on 2015-04-01
Alexandre Abreu (community) Approve on 2015-03-12
Review via email: mp+252292@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. This avoids the bug where older accounts are removed by the u1 code to force their re-creation.

To post a comment you must log in.
dobey (dobey) :
review: Approve
dobey (dobey) :
review: Needs Fixing
178. By Alberto Mardegan on 2015-03-12

Do actually install the script

review: Approve
dobey (dobey) wrote :

This still needs the updated script that was included in the RTM MP (and which landed there).

review: Needs Fixing
179. By Alberto Mardegan on 2015-04-01

Sync with RTM

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-04-01 14:26:49 +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 2015-03-09 17:11:54 +0000
38+++ debian/control 2015-04-01 14:26:49 +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@@ -71,7 +72,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-04-01 14:26:49 +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-04-01 14:26:49 +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