aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-01-24libqmi-glib,wds: add missing 'underscore_name' in QmiWdsProfileTypeAleksander Morgado1-1/+1
2015-01-22libqmi-glib,test: unit test for the 'DMS Get Time' operation messagesAleksander Morgado1-0/+82
'DMS Get Time' is the only message where we have a sized-guint: the 0x01 mandatory response TLV is 8-byte long (6 bytes for the time value, 2 bytes for the source value). This unit test uses the generic library APIs to check the correct parsing of the 'DMS Get Time' response.
2015-01-22libqmi-glib: fix read/write sized uints when the size is not multiple of 2Aleksander Morgado2-10/+4
2015-01-20qmicli,pbm: better output when no capabilities are reportedAleksander Morgado1-28/+52
Old output: $ sudo qmicli -d /dev/cdc-wdm1 --pbm-get-all-capabilities [/dev/cdc-wdm1] Phonebook capabilities: New output: $ sudo qmicli -d /dev/cdc-wdm1 --pbm-get-all-capabilities [/dev/cdc-wdm1] Phonebook capabilities: none
2015-01-13libqmi-glib,test: fix compilation warnings in 32bit systemsAleksander Morgado1-15/+15
CC test_message-test-message.o cc1: warnings being treated as errors test-message.c: In function 'test_message_tlv_rw_64': test-message.c:702: error: integer constant is too large for 'long' type test-message.c:707: error: integer constant is too large for 'long' type test-message.c:712: error: integer constant is too large for 'long' type test-message.c:717: error: integer constant is too large for 'long' type test-message.c:745: error: integer constant is too large for 'long' type test-message.c:750: error: integer constant is too large for 'long' type test-message.c:755: error: integer constant is too large for 'long' type test-message.c:760: error: integer constant is too large for 'long' type test-message.c: In function 'test_message_tlv_rw_sized': test-message.c:790: error: integer constant is too large for 'long' type test-message.c: In function 'test_message_tlv_rw_mixed': test-message.c:1037: error: integer constant is too large for 'long' type test-message.c:1042: error: integer constant is too large for 'long' type test-message.c:1106: error: integer constant is too large for 'long' type test-message.c:1111: error: integer constant is too large for 'long' type test-message.c: In function 'test_message_tlv_write_overflow': test-message.c:1169: error: integer constant is too large for 'long' type test-message.c:1174: error: integer constant is too large for 'long' type make[4]: *** [test_message-test-message.o] Error 1
2015-01-13libqmi-glib,proxy: root user always allowedAleksander Morgado1-5/+4
Even if QMI_USERNAME is defined to a non-root user, root should always be able to access the proxy. E.g. ModemManager (run as root) must be able to launch and access the proxy even if QMI_USERNAME was set to a non-root user.
2015-01-11qmicli: update copyright datesAleksander Morgado1-2/+2
2015-01-09libqmi-glib,utils: avoid getpwnam() call if --enable-qmi-username not usedRoshan Pius2-1/+10
If --enable-qmi-username isn't explicitly used, we should just check for the root user UID, without using getpwnam(). See e.g. these SELinux warnings: SELinux is preventing /usr/bin/bash from read access on the file /etc/passwd. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that bash should be allowed read access on the passwd file by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # grep qmi-proxy /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp
2014-12-19build: distribute the udev rules template regardless of --enable-qmi-usernameAleksander Morgado1-1/+1
Include the udev rules template in the distribution tarball even if the `--enable-qmi-username' option wasn't specified.
2014-12-19libqmi-glib,proxy: Change ownership of QMI devices to the configured user.Roshan Pius2-0/+21
Adding a udev rule to change ownership of all QMI devices to the configured user specified at compile time using --enable-qmi-username flag.
2014-12-12libqmi,test: new test for QMI NAS Get Cell Info with GERANAleksander Morgado1-5/+63
Which currently fails: {*LOG(error):{Qmi-FATAL-CRITICAL: qmi_message_tlv_read_fixed_size_string: assertion 'out != NULL' failed}:LOG*} (/home/aleksander/Development/foss/libqmi/src/libqmi-glib/test/.libs/test-generated:12179): Qmi-CRITICAL **: qmi_message_tlv_read_fixed_size_string: assertion 'out != NULL' failed Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff717eae0 in g_logv () from /usr/lib/libglib-2.0.so.0 (gdb) bt #0 0x00007ffff717eae0 in g_logv () from /usr/lib/libglib-2.0.so.0 #1 0x00007ffff717ed1f in g_log () from /usr/lib/libglib-2.0.so.0 #2 0x00007ffff7a5381e in qmi_message_tlv_read_fixed_size_string (self=0x7fffe8007d30, tlv_offset=20, offset=0x7fffffffdcc8, string_length=3, out=0x0, error=0x0) at qmi-message.c:1817 #3 0x00007ffff7acce60 in __qmi_message_nas_get_cell_location_info_response_parse (message=0x7fffe8007d30, error=0x7fffffffded8) at qmi-nas.c:26772 #4 0x00007ffff7af46fa in get_cell_location_info_ready (device=0x64e8b0, res=0x65d990, simple=0x65d920) at qmi-nas.c:47982 #5 0x00007ffff76ff6d7 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0 #6 0x00007ffff76ff739 in ?? () from /usr/lib/libgio-2.0.so.0 #7 0x00007ffff717791d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #8 0x00007ffff7177cf8 in ?? () from /usr/lib/libglib-2.0.so.0 #9 0x00007ffff7178022 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 #10 0x0000000000403e9b in test_fixture_loop_run (fixture=0x63c800) at test-fixture.c:321 #11 0x0000000000406da4 in test_generated_nas_get_cell_location_info (fixture=0x63c800) at test-generated.c:562 #12 0x00007ffff719d0f3 in ?? () from /usr/lib/libglib-2.0.so.0 #13 0x00007ffff719d2c2 in ?? () from /usr/lib/libglib-2.0.so.0 #14 0x00007ffff719d2c2 in ?? () from /usr/lib/libglib-2.0.so.0 #15 0x00007ffff719d2c2 in ?? () from /usr/lib/libglib-2.0.so.0 #16 0x00007ffff719d62b in g_test_run_suite () from /usr/lib/libglib-2.0.so.0 #17 0x00007ffff719d661 in g_test_run () from /usr/lib/libglib-2.0.so.0 #18 0x0000000000406ef0 in main (argc=1, argv=0x7fffffffe678) at test-generated.c:584 (gdb) fr 3 #3 0x00007ffff7acce60 in __qmi_message_nas_get_cell_location_info_response_parse (message=0x7fffe8007d30, error=0x7fffffffded8) at qmi-nas.c:26772 warning: Source file is more recent than executable. 26772 if (!qmi_message_tlv_read_fixed_size_string (message, init_offset, &offset, 3, &cell_aux.plmn[0], NULL)) (gdb) p cell_aux $1 = {cell_id = 28541, plmn = 0x0, lac = 0, geran_absolute_rf_channel_number = 0, base_station_identity_code = 0 '\000', rx_level = 0}
2014-11-18libqmi,utils: new internal __qmi_user_allowed() methodAleksander Morgado3-35/+41
Allows to check whether the user is allowed to use the QMI device. Also fixes qmi_proxy_open() to make sure we always set the GError when FALSE is returned.
2014-11-18build: rename '--enable-qmi-proxy-username' to '--enable-qmi-username'Aleksander Morgado1-6/+6
This shouldn't be a proxy-only setting. We're going to chown the QMI devices to this specific user, so we'll re-use this setting for that as well.
2014-11-18libqmi-glib,proxy: add a configure flag to set the user ID of QMI proxyRoshan Pius1-6/+32
Currently, the QMI proxy process assumes that it is run as root user and that all incoming client connection users are also root. However, it's not always preferable to run the QMI proxy as root for security reasons. On some platforms, the QMI proxy could be constrained to run as a less-privileged user and specially granted the permission to access the QMI device. So, adding a compile time flag in libqmi to check for the specified user, rather than assume it to be the root user. If the flag is not sent, it'll revert to the existing behaviour of checking for user=root(i.e UID=0)
2014-11-10libqmi-glib,message: fix build (fdo #86128)Volker Sobek1-1/+1
The build failed because g_return_val_if_fail was used in a void function. Use g_return_if_fail instead. https://bugs.freedesktop.org/show_bug.cgi?id=86128
2014-11-10libqmi-glib: always attach timeout and idles to the thread default main contextAleksander Morgado1-9/+19
The standard timeout/idle methods will attach the sources to the default context, not the thread default context. So, create the GSources ourselves and attach them to the thread default context.
2014-11-09libqmi-glib: always attach sources to the thread default main contextAleksander Morgado2-2/+2
If NULL is specified in g_source_attach() it will attach to the default context, not to the thread-default one if one was given with g_main_context_push_thread_default(). This caused that QmiDevices started in the non-main thread would still attach their socket listening sources to the GMainContext in the main thread.
2014-11-09qmi-codegen: use the new TLV reader APIAleksander Morgado3-14/+48
2014-11-09test,message: fix leak in unit testsAleksander Morgado1-0/+2
2014-11-09libqmi-glib,utils: flag reader utils as deprecatedAleksander Morgado1-0/+16
2014-11-09test,message: unit tests for the reader APIAleksander Morgado1-84/+466
2014-11-09libqmi-glib,message: new TLV reader APIAleksander Morgado2-0/+746
2014-11-09libqmi-glib,utils: fix documentation when reading fixed size stringsAleksander Morgado1-2/+2
2014-11-09libqmi-glib,message: use TLV builder to create response messagesAleksander Morgado1-36/+8
2014-11-09test,message: unit tests for the QmiMessage creator methodsAleksander Morgado1-0/+180
2014-11-09libqmi-glib,message: update copyrightAleksander Morgado3-3/+3
2014-11-09libqmi-glib,utils: flag writer utils as deprecatedAleksander Morgado1-0/+17
2014-11-09libqmi-glib,message: no need to pass error when assertingAleksander Morgado1-2/+2
2014-11-09test,message: unit tests for the builder APIAleksander Morgado1-0/+731
2014-11-09libqmi-glib,message: new TLV builder APIAleksander Morgado3-2/+591
2014-11-09libqmi-glib,device: fix device initializationAleksander Morgado1-0/+3
Initialization ended up broken in commit ec30daa1 when the new 'device-no-file-check' property was introduced.
2014-11-09libqmi,test: check message builder/parser for "NAS Network Scan"Aleksander Morgado1-0/+251
2014-11-09libqmi,test: check message builder/parser for "DMS UIM Verify PIN"Aleksander Morgado1-0/+64
2014-11-09libqmi,test: check message builder/parser for "DMS UIM Get PIN Status"Aleksander Morgado1-1/+93
2014-11-09libqmi,test: don't print message contents by default in testsAleksander Morgado1-0/+2
2014-11-09libqmi,message: avoid printing error in stderrAleksander Morgado1-5/+1
2014-11-09libqmi,test: check message builder/parser for "DMS Get IDs"Aleksander Morgado1-0/+82
2014-11-09libqmi,test: setup testing framework to test content of generated messagesAleksander Morgado6-2/+913
2014-11-09libqmi-glib,device: new 'device-proxy-path' propertyAleksander Morgado2-1/+18
String which specifies which is the path of the abstract socket where the proxy is listening.
2014-11-09libqmi-glib,device: minor indentation fixesAleksander Morgado1-6/+6
2014-11-09libqmi-glib,device: new 'device-no-file-check' propertyAleksander Morgado2-28/+57
If set to TRUE, this property will make the QmiDevice not check for the existence and file type of the given GFile. This is a construct write-only property, and should be only used when building the QmiDevice with g_async_initable_new_async() explicitly (i.e. no library helper method given).
2014-11-09libqmi,message: fix qmi_message_set_transaction_id() in non-CTL messagesAleksander Morgado2-1/+53
The transaction ID in non-CTL messages wasn't being written properly when qmi_message_set_transaction_id() was used. Internally this never happened, but this method is part of the API, so could be a big issue for users.
2014-10-30qmicli: fix license text, it should be GPLv2+Aleksander Morgado2-2/+2
2014-10-13libqmi-glib,message: avoid g_byte_array_new_take()Aleksander Morgado1-4/+12
It will break our unit tests, which are all executed with gc-friendly. See: https://bugzilla.gnome.org/show_bug.cgi?id=738170
2014-10-12libqmi-glib,proxy: add missing QmiProxy documentationAleksander Morgado1-0/+23
2014-10-10libqmi-glib,proxy: fix segfaultAlbert Diserholt1-4/+4
This patch fixes a segfault caused by a race condition where an incoming request has just been accepted and allocated, but a device for it has yet to be opened, and an old request is closed. The checks prevent a strcmp against unexisting devices. https://bugs.freedesktop.org/show_bug.cgi?id=77335
2014-10-08libqmi,utils: assert input buffer size when writing strings to bufferThomas Haller1-4/+11
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-08qmi-codegen: ensure enough buffer available to read string/array size variableAleksander Morgado1-0/+28
Code generation via emit_size_read() creates the _validate() functions. The generated code for strings and arrays used to read the length prefix without checking that the provided buffer is large enough. https://bugzilla.redhat.com/show_bug.cgi?id=1031738 Patch based on a patch from Thomas Haller <thaller@redhat.com> Reported-by: Florian Weimer <fweimer@redhat.com>
2014-09-05pds: implement "PDS Set/Get AGPS Config"Aleksander Morgado1-0/+15
2014-09-05pds: implement "PDS Set/Get Default Tracking Session"Aleksander Morgado1-0/+17