Skip to content

Fix AA-less content-hub transfer

Cosima Neidahl requested to merge OPNA2608/content-hub:fix/AAless-transfer into main

After another look at the unusual aa_profile call pointed out in !33 (merged), it turns out that it was the cause for content-hub transfers failing when AppArmor is unavailable.

Fix it by setting the "unconfined" fallback value, just like with every other aa_profile call.


This makes an attempted content-hub transfer go from

machine # [  415.029368] com.lomiri.content.dbus.Service[1522]: /build/source/src/com/lomiri/content/detail/transfer.cpp 181 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&) PROFILE: ""
machine # [  415.031507] com.lomiri.content.dbus.Service[1522]: /build/source/src/com/lomiri/content/item.cpp 137 operator>> const QDBusArgument& operator>>(const QDBusArgument&, com::lomiri::content::Item&)
machine # [  415.033885] com.lomiri.content.dbus.Service[1522]: /build/source/src/com/lomiri/content/detail/transfer.cpp 189 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&)
machine # [  415.035932] com.lomiri.content.dbus.Service[1522]: /build/source/src/com/lomiri/content/detail/transfer.cpp 192 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&) IS LOCAL FILE
machine # [  415.038139] com.lomiri.content.dbus.Service[1522]: /build/source/src/com/lomiri/content/detail/transfer.cpp 194 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&) FILE: "/home/alice/Pictures/Screenshots/screenshot20240531_164134036.png"
machine # [  415.041501] com.lomiri.content.dbus.Service[1522]: /build/source/src/com/lomiri/content/utils.cpp 411 check_profile_read bool {anonymous}::check_profile_read(QString, QString) PROFILE: ""
machine # [  415.043511] com.lomiri.content.dbus.Service[1522]: error: Cannot allocate memory "/home/alice/Pictures/Screenshots/screenshot20240531_164134036.png"
machine # [  415.046107] com.lomiri.content.dbus.Service[1522]: Failed to charge items, aborting

to

machine # [  207.466899] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/transfer.cpp 181 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&) PROFILE: "unconfined"
machine # [  207.469403] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/item.cpp 137 operator>> const QDBusArgument& operator>>(const QDBusArgument&, com::lomiri::content::Item&)
machine # [  207.471370] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/transfer.cpp 189 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&)
machine # [  207.473755] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/utils.cpp 329 copy_to_store QString {anonymous}::copy_to_store(const QString&, const QString&, bool)
machine # [  207.477188] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/utils.cpp 353 copy_to_store QString {anonymous}::copy_to_store(const QString&, const QString&, bool) "/home/alice/.local/share/lomiri-system-settings/Pictures/screenshot20240531_173403809.png"
machine # [  207.501800] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/transfer.cpp 207 Charge void com::lomiri::content::detail::Transfer::Charge(const QVariantList&) Item: QUrl("file:///home/alice/.local/share/lomiri-system-settings/Pictures/screenshot20240531_173403809.png")
machine # [  207.505990] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/service.cpp 468 handle_imports void com::lomiri::content::detail::Service::handle_imports(int) 3
machine # [  207.508471] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/transfer.cpp 119 State int com::lomiri::content::detail::Transfer::State()
machine # [  207.512071] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/transfer.cpp 93 Id int com::lomiri::content::detail::Transfer::Id()
machine # [  207.514058] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/service.cpp 470 handle_imports void com::lomiri::content::detail::Service::handle_imports(int) State:  3 Id: 1
machine # [  207.516767] com.lomiri.content.dbus.Service[1555]: /build/source/src/com/lomiri/content/detail/service.cpp 499 handle_imports void com::lomiri::content::detail::Service::handle_imports(int) Charged

(I don't know if there's anything in the logs that would properly point this out, but I was attempting to get a background image for LSS via Filemanager, and after applying this it actually arrives in the app)

Merge request reports