Bug 950635 - (RFE) kcm_useraccount: support accountsservice interfaces
Summary: (RFE) kcm_useraccount: support accountsservice interfaces
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kde-baseapps
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Gregor Tätzner
QA Contact: Fedora Extras Quality Assurance
URL: https://git.reviewboard.kde.org/r/110...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-10 14:18 UTC by Gerald Cox
Modified: 2013-12-10 18:59 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-10 18:59:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Gerald Cox 2013-04-10 14:18:16 UTC
Description of problem:

Lightdm does not show user image which is created from KDE password & user account settings dialog.  I believe this image is stored in the users home directory as .face.icon - instead a default image is used.

I also saw Bug 911826 which was related to lightdm-gtk - and it mentions kde in passing, it talks about F19, so not sure if it is a match.

I did a google search and found postings which mention this problem in other distributions.  Suggestions range from copying .face.icon to .face to changing the permissions of the file.  None work.  


Version-Release number of selected component (if applicable):
lightdm-kde-0.3.0-2.fc18.x86_64


How reproducible:
Activate lightdm and either reboot system or logoff userid.  
Default image is shown.


Steps to Reproduce:
1. Create user image using KDE user & account settings dialog
2. Activate lightdm using display-manager switcher
3. Reboot or logoff userid
  
Actual results:
Default image is shown

Expected results:
User image is shown


Additional info:

Comment 1 Gerald Cox 2013-04-20 17:54:39 UTC
I upgraded to the following from the testing repository:

lightdm-qt-1.4.1-3.fc18.x86_64
lightdm-kde-0.3.2.1-1.fc18.x86_64
lightdm-1.4.1-3.fc18.x86_64
lightdm-gobject-1.4.1-3.fc18.x86_64

Additionally I created the .face file in my home directory some google searches suggest as follows:
ln -s .face.icon .face

Same issue, doesn't work.

Comment 2 Rex Dieter 2013-04-20 19:26:19 UTC
Works for me, testing with those same versions, *if* you change default home directory permissions to allow other users' access to your $HOME : 

chmod o+x $HOME

Comment 3 Rex Dieter 2013-04-20 19:29:54 UTC
In particular, the 'lightdm' user, must have adequate permissions to read your $HOME/.face (or $HOME/.face.icon)

Comment 4 Gregor Tätzner 2013-04-20 20:18:29 UTC
is there some way to make this 'just works'? (besides running lightdm as root)

Comment 5 Gregor Tätzner 2013-04-20 20:39:37 UTC
ah I think we're supposed to utilize accountsservice. You can set an icon file using it's dbus interface. It puts the file in /var/lib/AccountsService/icons/

now lightdm-kde shows the proper icon file, even without read access to $HOME. surprised this works...

Comment 6 Rex Dieter 2013-04-20 20:47:43 UTC
Ah, we can consider modifying KDE Password & User Account Setting module:

1.  add support to KDE Password & User Account Setting to use this accountsservice dbus interface

and/or

2.  adding code to the KDE Password & User Account Settings module to check-for and fix $HOME permissions when setting a custom $HOME/.face.icon (for legacy DM's that don't yet support accountsservice, like kdm)

Comment 7 Rex Dieter 2013-04-20 20:53:53 UTC
Triaging RFE to kde-baseapps (owner of kcm_useraccount)

Comment 8 Rex Dieter 2013-04-20 21:01:24 UTC
For example, 

qdbus --system org.freedesktop.Accounts /org/freedesktop/Accounts
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
signal void org.freedesktop.DBus.Properties.PropertiesChanged(QString interface_name, QVariantMap changed_properties, QStringList invalidated_properties)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
property read QString org.freedesktop.Accounts.DaemonVersion
method QDBusObjectPath org.freedesktop.Accounts.CacheUser(QString name)
method QDBusObjectPath org.freedesktop.Accounts.CreateUser(QString name, QString fullname, int accountType)
method void org.freedesktop.Accounts.DeleteUser(qlonglong id, bool removeFiles)
method QDBusObjectPath org.freedesktop.Accounts.FindUserById(qlonglong id)
method QDBusObjectPath org.freedesktop.Accounts.FindUserByName(QString name)
method QList<QDBusObjectPath> org.freedesktop.Accounts.ListCachedUsers()
method void org.freedesktop.Accounts.UncacheUser(QString name)
signal void org.freedesktop.Accounts.UserAdded(QDBusObjectPath user)
signal void org.freedesktop.Accounts.UserDeleted(QDBusObjectPath user)
[rdieter1@localhost services]$ qdbus --system org.freedesktop.Accounts /org/freedesktop/Accounts/User1000
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
signal void org.freedesktop.DBus.Properties.PropertiesChanged(QString interface_name, QVariantMap changed_properties, QStringList invalidated_properties)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
property read int org.freedesktop.Accounts.User.AccountType
property read bool org.freedesktop.Accounts.User.AutomaticLogin
property read QString org.freedesktop.Accounts.User.Email
property read QString org.freedesktop.Accounts.User.HomeDirectory
property read QString org.freedesktop.Accounts.User.IconFile
property read QString org.freedesktop.Accounts.User.Language
property read bool org.freedesktop.Accounts.User.LocalAccount
property read QString org.freedesktop.Accounts.User.Location
property read bool org.freedesktop.Accounts.User.Locked
property read qulonglong org.freedesktop.Accounts.User.LoginFrequency
property read QString org.freedesktop.Accounts.User.PasswordHint
property read int org.freedesktop.Accounts.User.PasswordMode
property read QString org.freedesktop.Accounts.User.RealName
property read QString org.freedesktop.Accounts.User.Shell
property read bool org.freedesktop.Accounts.User.SystemAccount
property read qulonglong org.freedesktop.Accounts.User.Uid
property read QString org.freedesktop.Accounts.User.UserName
property read QString org.freedesktop.Accounts.User.XSession
signal void org.freedesktop.Accounts.User.Changed()
method void org.freedesktop.Accounts.User.SetAccountType(int accountType)
method void org.freedesktop.Accounts.User.SetAutomaticLogin(bool enabled)
method void org.freedesktop.Accounts.User.SetEmail(QString email)
method void org.freedesktop.Accounts.User.SetHomeDirectory(QString homedir)
method void org.freedesktop.Accounts.User.SetIconFile(QString filename)
method void org.freedesktop.Accounts.User.SetLanguage(QString language)
method void org.freedesktop.Accounts.User.SetLocation(QString location)
method void org.freedesktop.Accounts.User.SetLocked(bool locked)
method void org.freedesktop.Accounts.User.SetPassword(QString password, QString hint)
method void org.freedesktop.Accounts.User.SetPasswordMode(int mode)
method void org.freedesktop.Accounts.User.SetRealName(QString name)
method void org.freedesktop.Accounts.User.SetShell(QString shell)
method void org.freedesktop.Accounts.User.SetUserName(QString name)
method void org.freedesktop.Accounts.User.SetXSession(QString x_session)

Comment 9 Gerald Cox 2013-04-20 21:32:57 UTC
Thanks for the heads up.  I didn't want to change my permissions, so I logged into Gnome, went to account settings, clicked on the default avatar, and assigned a photo.  

Then logged off, and lo and behold... there is my photo in lightdm.  Amazing...LOL...

At least we have two simple workarounds...

Thanks!

Comment 10 Gregor Tätzner 2013-04-21 07:45:42 UTC
(In reply to comment #6)
> 2.  adding code to the KDE Password & User Account Settings module to
> check-for and fix $HOME permissions when setting a custom $HOME/.face.icon
> (for legacy DM's that don't yet support accountsservice, like kdm)

Though that sound dangerous to me. User management tools shouldn't silently relax $HOME permissions...

Comment 11 Kevin Kofler 2013-04-21 14:17:29 UTC
And it shouldn't be needed for KDM because KDM always runs as root.

Comment 12 Rex Dieter 2013-05-03 17:11:11 UTC
adjusting summary, I'll see if I can whip up some basic proof-of-concept code to support this today.

Comment 13 Gregor Tätzner 2013-06-06 15:23:20 UTC
any progress rex? Suppose I can finish this as well.

Comment 14 Rex Dieter 2013-06-06 15:54:43 UTC
Turns out to do this right was a wee bit more than trivial (but not *hard*), so no, nothing to report yet.  @work has kept my free/play time at a minimum for the foreseeable future, so no eta either.  sorry.

Comment 15 Gregor Tätzner 2013-06-07 10:39:24 UTC
allright I'm going to take it then

Comment 16 Gregor Tätzner 2013-06-07 21:35:07 UTC
yeah wasn't too hard. see here for a working solution: https://git.reviewboard.kde.org/r/110875/

Comment 17 Kevin Kofler 2013-06-07 22:28:37 UTC
Good work, thanks! Let's see what upstream thinks of the patch, but IMHO it's definitely good enough for us.

Comment 18 Rex Dieter 2013-06-11 15:53:06 UTC
Thanks, I tried building your submitted reviewboard patch on f19, and ran into a problem.

Seems qdbusxml2cpp chokes on /usr/share/dbus-1/interfaces/org.freedesktop.Accounts.User.xml : 

Got unknown type `a(xxa{sv})'

on f19, the problematic xml snippet looks like:

  <property name="LoginHistory" type="a(xxa{sv})" access="read">
    <doc:doc>
      <doc:description>
        <doc:para>
          The login history for this user.
          Each entry in the array represents a login session. The first two
          members are the login time and logout time, as timestamps (seconds since the epoch). If the session is still running, the logout time
          is 0.
        </doc:para>
...

which may indeed be a newer/complex type that qt4's dbus code doesn't handle (yet).

Comment 19 Gregor Tätzner 2013-06-11 16:39:52 UTC
(In reply to Rex Dieter from comment #18)
> which may indeed be a newer/complex type that qt4's dbus code doesn't handle
> (yet).

And it never will be able to. But what we could do is annotate the xml and teach Qt about the custom array type [1]. Dunno if thats ok with the accountsservice guys. 

[1] http://techbase.kde.org/Development/Tutorials/D-Bus/CustomTypes#Edit_the_XML

Comment 20 Lukáš Tinkl 2013-06-11 16:51:04 UTC
It's not only OK but required for Qt to work with such complex types; another side of the story is that you have to add custom marshall/demarshall[1] methods should you want to actually use the function in question.

http://qt-project.org/doc/qt-4.8/qdbusargument.html

Comment 21 Rex Dieter 2013-06-11 22:04:41 UTC
I'd be happy to reach out to accountsservice maintainers and help apply fixes/patches to the xml as needed.

Comment 22 Rex Dieter 2013-12-10 18:59:39 UTC
Pulled this in awhile back,

* Tue Jun 11 2013 Rex Dieter <rdieter> 4.10.4-2
- kcm_useraccount: support accountsservice (#950635)


Note You need to log in before you can comment on or make changes to this bug.