Cannot get the IMEI number

Bug #1338420 reported by XiaoGuo, Liu
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtcreator-plugin-ubuntu (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have a simple code like:

        DeviceInfo {
            id: deviceInfos
        }

                ListItem.SingleValue {
                    objectName: "imeiItem"
                    property string imeiNumber
                    imeiNumber: deviceInfos.imei(0)
                    text: "IMEI"
                    value: imeiNumber
                    visible: true
                }

If I set the "Security Profile" to the following:

{
    "policy_groups": [],
    "policy_version": 1.1,
    "template": "unconfined"
}

Then I can get the IMEI number. However, if I set it to:

{
    "policy_groups": [
        "networking",
        "connectivity"
    ],
    "policy_version": 1.1
}

I could not get the IMEI number. According to http://developer.ubuntu.com/publish/apps/security-policy-for-click-packages/

connectivity: Can access coarse network connectivity information
QML: qtdeclarative5-systeminfo-plugin
import QtSystemInfo <version>
Other APIs: Qt5 QHostAddress and QNetworkInterface

"connectivity" has been added, however, it does not retrieve any of the useful information. I have checked the "/var/log/syslog", there is no violation as well.

Best regards,
XiaoGuo

Revision history for this message
Zoltan Balogh (bzoltan) wrote :

I think this issue is hardly caused by the QtCreator plugins. I try to find the team who can help to solve this issue.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

What is the output of 'grep DEN /var/log/syslog'?

Changed in qtcreator-plugin-ubuntu (Ubuntu):
status: New → Incomplete
Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

In fact, I did not see anything there. Is it very strange?

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Kernel rate limiting may be in effect. Can you perform on the system exhibiting the problem:
sudo sysctl -w kernel.printk_ratelimit=0

Then try to run the app under confinement? Please post the output of 'grep DEN /var/log/syslog' after.

Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote : Re: [Bug 1338420] Re: Cannot get the IMEI number

Hi,

The policy is defined as:

{

"policy_groups": [],

"policy_version": 1.1,

"template": "unconfined"

}

and run my app directly, it shows the IMEI number. Then

root@ubuntu-phablet:/var# grep DEN /var/log/syslog

root@ubuntu-phablet:/var#

Nothing is shown after checking the syslog. Then,

root@ubuntu-phablet:/var# sudo sysctl -w kernel.printk_ratelimit=0
kernel.printk_ratelimit = 0

root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var# sudo sysctl -w kernel.printk_ratelimit=0
kernel.printk_ratelimit = 0
root@ubuntu-phablet:/var# sudo sysctl -w kernel.printk_ratelimit=0
kernel.printk_ratelimit = 0
root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var#

Nothing is shown again. If I change the policy to the normal one, it does
not show the IMEI number at all. Is it because I did not define the correct
policy group?

Thanks & best regards,
XiaoGuo

On Mon, Jul 7, 2014 at 11:45 PM, Jamie Strandboge <email address hidden> wrote:

> Kernel rate limiting may be in effect. Can you perform on the system
> exhibiting the problem:
> sudo sysctl -w kernel.printk_ratelimit=0
>
> Then try to run the app under confinement? Please post the output of
> 'grep DEN /var/log/syslog' after.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1338420
>
> Title:
> Cannot get the IMEI number
>
> Status in “qtcreator-plugin-ubuntu” package in Ubuntu:
> Incomplete
>
> Bug description:
> I have a simple code like:
>
> DeviceInfo {
> id: deviceInfos
> }
>
>
> ListItem.SingleValue {
> objectName: "imeiItem"
> property string imeiNumber
> imeiNumber: deviceInfos.imei(0)
> text: "IMEI"
> value: imeiNumber
> visible: true
> }
>
>
> If I set the "Security Profile" to the following:
>
> {
> "policy_groups": [],
> "policy_version": 1.1,
> "template": "unconfined"
> }
>
> Then I can get the IMEI number. However, if I set it to:
>
> {
> "policy_groups": [
> "networking",
> "connectivity"
> ],
> "policy_version": 1.1
> }
>
> I could not get the IMEI number. According to
> http://developer.ubuntu.com/publish/apps/security-policy-for-click-
> packages/
>
> connectivity: Can access coarse network connectivity information
> QML: qtdeclarative5-systeminfo-plugin
> import QtSystemInfo <version>
> Other APIs: Qt5 QHostAddress and QNetworkInterface
>
> "connectivity" has been added, however, it does not retrieve any of
> the useful information. I have checked the "/var/log/syslog", there is
> no violation as well.
>
> Best regards,
> XiaoGuo
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/qtcreator-plugin-ubuntu/+bug/1338420/+subscriptions
>

--
XiaoGuo, Liu (刘晓国)
Mobile: +86-13911181302

Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

Hi,

The policy is defined as:

{
"policy_groups": [],
"policy_version": 1.1,
"template": "unconfined"
}

and run my app directly, it shows the IMEI number. Then

root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var#

Nothing is shown after checking the syslog. Then,

root@ubuntu-phablet:/var# sudo sysctl -w kernel.printk_ratelimit=0
kernel.printk_ratelimit = 0

root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var# sudo sysctl -w kernel.printk_ratelimit=0
kernel.printk_ratelimit = 0
root@ubuntu-phablet:/var# sudo sysctl -w kernel.printk_ratelimit=0
kernel.printk_ratelimit = 0
root@ubuntu-phablet:/var# grep DEN /var/log/syslog
root@ubuntu-phablet:/var#

Nothing is shown again. If I change the policy to the normal one, it does not show the IMEI number at all. Is it because I did not define the correct policy group?

Thanks & best regards,
XiaoGuo

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I think I wasn't clear. These are the steps:

1. sudo sysctl -w kernel.printk_ratelimit=0 # only has to be done once per boot

2. adjust the security profile to be:
{
"policy_groups": [],
"policy_version": 1.1,
"template": "ubuntu-sdk"
}

3. install the click app

4. run 'sudo aa-clickhook -f' to regenerate the apparmor policy (needed if you didn't rev the version number of the click package)

4. start the app to trigger the behavior

5. see if 'grep DEN /var/log/syslog'

If it is apparmor, you should see denials. While there are explicit deny rules in the ubuntu-sdk template to silence noisy denials, none of those should be what is breaking the app. If you see denials, please paste them here. If you do not, please look in ~/.cache/upstart/application-click-<your application>.log and post the errors.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Note, this may be a duplicate of bug #1226844.

Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

Hi Jamie,

Thanks. This time, I see the denial message:

Jul 8 13:38:40 ubuntu-phablet dbus[718]: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.ofono.Manager" member="GetModems" mask="send" name="org.ofono" pid=7659 profile="com.ubuntu.developer.liu-xiao-guo.deviceinfo_DeviceInfo_0.1" peer_pid=1232 peer_profile="unconfined"
Jul 8 13:41:31 ubuntu-phablet dbus[718]: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.ofono.Manager" member="GetModems" mask="send" name="org.ofono" pid=7919 profile="com.ubuntu.developer.liu-xiao-guo.deviceinfo_DeviceInfo_0.1" peer_pid=1232 peer_profile="unconfined"

I think it does not show anything in the Qt Creator application output window. It is not so convenient to check the syslog.

Best regards,
XiaoGuo

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Ok, thank you for testing that. This is indeed a duplicate of bug #1226844.

Changed in qtcreator-plugin-ubuntu (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

May I know whether the QStorageInfo/QSystemInfo API is supported on our
Ubuntu Touch platform? I cannot find the header files for the API. A
customer in China is now looking for such an API for the players.

Thanks!
XiaoGuo

On Tue, Jul 8, 2014 at 8:41 PM, Jamie Strandboge <email address hidden> wrote:

> *** This bug is a duplicate of bug 1226844 ***
> https://bugs.launchpad.net/bugs/1226844
>
> Ok, thank you for testing that. This is indeed a duplicate of bug
> #1226844.
>
> ** Changed in: qtcreator-plugin-ubuntu (Ubuntu)
> Status: Incomplete => Confirmed
>
> ** This bug has been marked a duplicate of bug 1226844
> QtSystemInfo fails when using ofono and there are DBus denials to ofono
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1338420
>
> Title:
> Cannot get the IMEI number
>
> Status in “qtcreator-plugin-ubuntu” package in Ubuntu:
> Confirmed
>
> Bug description:
> I have a simple code like:
>
> DeviceInfo {
> id: deviceInfos
> }
>
>
> ListItem.SingleValue {
> objectName: "imeiItem"
> property string imeiNumber
> imeiNumber: deviceInfos.imei(0)
> text: "IMEI"
> value: imeiNumber
> visible: true
> }
>
>
> If I set the "Security Profile" to the following:
>
> {
> "policy_groups": [],
> "policy_version": 1.1,
> "template": "unconfined"
> }
>
> Then I can get the IMEI number. However, if I set it to:
>
> {
> "policy_groups": [
> "networking",
> "connectivity"
> ],
> "policy_version": 1.1
> }
>
> I could not get the IMEI number. According to
> http://developer.ubuntu.com/publish/apps/security-policy-for-click-
> packages/
>
> connectivity: Can access coarse network connectivity information
> QML: qtdeclarative5-systeminfo-plugin
> import QtSystemInfo <version>
> Other APIs: Qt5 QHostAddress and QNetworkInterface
>
> "connectivity" has been added, however, it does not retrieve any of
> the useful information. I have checked the "/var/log/syslog", there is
> no violation as well.
>
> Best regards,
> XiaoGuo
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/qtcreator-plugin-ubuntu/+bug/1338420/+subscriptions
>

--
XiaoGuo, Liu (刘晓国)
Mobile: +86-13911181302

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.