Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] gdm 3, accountsservice and UID < 1000
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sat Aug 09, 2014 3:15 am    Post subject: [SOLVED] gdm 3, accountsservice and UID < 1000 Reply with quote

How do you change the behavior of Accounts Service in order to make users with uid < 1000 showing in gdm?

It seems all the good old ways it works with gdm 2 no longer work with gdm 3. Life was so much simpler before Gnome 3 and systemd. Why the documentation is so crappy it is almost impossible to find something like that easily anywhere?
_________________
Achille Talon Hop!


Last edited by AchilleTalon on Sun Aug 10, 2014 12:07 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Sat Aug 09, 2014 2:41 pm    Post subject: Reply with quote

I think it looks like it's hardcoded in the source, though I haven't found exactly where to change it. It says 500 is the minimum userid in https://help.gnome.org/admin/gdm/3.12/configuration.html.en#greeterconfiguration ... but perhaps this can workaround some of it?

/etc/gdm/custom.conf

[greeter]
IncludeAll=true
Include=the-userids-you-want-to-show-up

Yes Gnome seems to have gotten hit with the nerf bat.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sat Aug 09, 2014 3:26 pm    Post subject: Reply with quote

eccerr0r wrote:
I think it looks like it's hardcoded in the source, though I haven't found exactly where to change it. It says 500 is the minimum userid in https://help.gnome.org/admin/gdm/3.12/configuration.html.en#greeterconfiguration ... but perhaps this can workaround some of it?


There is no /apps/gdm/ in the configuration.

eccerr0r wrote:

/etc/gdm/custom.conf

[greeter]
IncludeAll=true
Include=the-userids-you-want-to-show-up

Yes Gnome seems to have gotten hit with the nerf bat.


No, it doesn't work. I had already tried it before posting. It seems at this point the only thing you can do with /etc/gdm/custom.conf is to remove a user from the list provided by Accounts Service. That is Accounts Service which is filtering on the uid number and that is where this should be adressed.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Sat Aug 09, 2014 4:28 pm    Post subject: Reply with quote

Browsing through the code it looks like it is hardcoded. You'll have to patch this and rebuild to change it, it appears. Might be easier to change your uid. It looks like Gentoo opted against heuristics and went for the uid number and table approach to remove system accounts which is added in portage. You can check the userpatch in the files for what Gentoo added.

If you're daring you can make an overlay ebuild and add --with-minimum-uid XYZ in the gnome2_src_configure line in src_configure() and rebuild sys-apps/accountsservice.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sat Aug 09, 2014 5:58 pm    Post subject: Reply with quote

eccerr0r wrote:
Browsing through the code it looks like it is hardcoded. You'll have to patch this and rebuild to change it, it appears. Might be easier to change your uid. It looks like Gentoo opted against heuristics and went for the uid number and table approach to remove system accounts which is added in portage. You can check the userpatch in the files for what Gentoo added.

If you're daring you can make an overlay ebuild and add --with-minimum-uid XYZ in the gnome2_src_configure line in src_configure() and rebuild sys-apps/accountsservice.


Thanks, will look at it. What is the procedure to submit an ebuild to the official portage filetree? I may at least make a USE flag for this if anyone else need to configure the minimum uid for his own purpose.

In fact, changing the uid implies changing the uids in the filetree as well in order to propagate ownership accordingly. I am far to be sure this would be easier in my case.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Sat Aug 09, 2014 9:11 pm    Post subject: Reply with quote

I highly doubt such ebuild patch would be accepted unfortunately - because it would be a variable number and would cause a lot of grief with people setting it all sorts of different ways. However you can ask the devs to add "epatch_user" so you can keep a patch around that gets picked up each time you emerge (but you'll need to potentially fix it each rev), now that is very possible and likely to get accepted at bugs.gentoo.org


In any case, you can easily change all the files' ownership with the find command -

# vipw
# find / -uid olduidnumber -exec chown username {} \;

Should be able to find and fix of them if you have a simple setup.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sat Aug 09, 2014 9:31 pm    Post subject: Reply with quote

eccerr0r wrote:
I highly doubt such ebuild patch would be accepted unfortunately - because it would be a variable number and would cause a lot of grief with people setting it all sorts of different ways. However you can ask the devs to add "epatch_user" so you can keep a patch around that gets picked up each time you emerge (but you'll need to potentially fix it each rev), now that is very possible and likely to get accepted at bugs.gentoo.org


In any case, you can easily change all the files' ownership with the find command -

# vipw
# find / -uid olduidnumber -exec chown username {} \;

Should be able to find and fix of them if you have a simple setup.


Thanks, I still look at changing the uid limit instead. For live filesystems, that could be handled with the find command, however there is more than that, backups, offline storage, unfrequently used data, etc. So, I would have to live with that for months if I change my uid. Much simpler to at my opinion to look to change in Accounts Service and have a patch available. In the worst case, the current situation is gdm is not showing the users, but it doesn't prevent to type them manually after clicking on the "not in the list" link on the gdm greeter screen.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sun Aug 10, 2014 12:06 am    Post subject: Reply with quote

Okay,

I did the change in the ebuild, for the records here is my change. I introduced a new use flag called lowuids which when set enable uids between 450 and 1000 to be shown.

In file sys-apps/accountsservice/accountsservice-0.6.37.ebuild, near the top I define the variable MINUID=1000 as the default value, I define the new use flag, lowuids, then in the configure section I have a condition if lowuids is set then MINUID is set to 400.


Code:
(...)
KEYWORDS="~alpha amd64 arm ~ia64 ~ppc ~ppc64 ~sparc x86"

IUSE="doc lowuids +introspection selinux systemd"

MINUID="1000"
(...)


Then,

Code:
(...)
src_configure() {
    use lowuids && MINUID="400"

(...)


In metadata.xml I added:
Code:
(...)
   <use>
      <flag name="lowuids">
         Allow the users with uids between 400 and 1000 to be added to
         the GDM chooser</flag>
      <flag name="introspection">Use <pkg>dev-libs/gobject-introspection</pkg>
(...)




Diff metadata.xml:
Code:
diff metadata.xml /usr/portage/sys-apps/accountsservice/metadata.xml
6,8d5
<       <flag name="lowuids">
<          Allow the users with uids between 400 and 1000 to be added to
<          the GDM chooser</flag>


Diff accountsservice-0.6.37.ebuild:
Code:
diff accountsservice-0.6.37.ebuild /usr/portage/sys-apps/accountsservice/accountsservice-0.6.37.ebuild
18,20c18
< IUSE="doc lowuids +introspection selinux systemd"
<
< MINUID="1000"
---
> IUSE="doc +introspection selinux systemd"
49,50d46
<     use lowuids && MINUID="400"
<
57d52
<       --with-minimum-uid=${MINUID} \


Then in package.use I added the flag lowuids to accountsservice.

However, this is not sufficient to make the users showing in gdm, you have also to go into former setup of Accounts Service in directory /var/lib/AccountsService/users.

If there is files named after the users you would like to show in gdm, edit the file and change SystemAccount=true to SystemAccount=false. If you want to make some users with uids between 400 and 1000 to NOT show, you create a file for each user with this minimal content:

Code:
[User]
SystemAccount=false


Don't bother with /etc/gdm/custom.conf or /etc/X11/gdm/custom.conf for the [greeter] section, it is ignored.

And since I'm at it. If you want to add a image/picture, just drop a 96x96 image/png file in /var/lib/AccountsService/icons with the username or username.png and add the following line in /var/lib/AccountsService/users/[username]:

Code:
Icon=/var/lib/AccoutsService/icons/[username_image_file]

_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Sun Aug 10, 2014 5:53 pm    Post subject: Reply with quote

It's unfortunate that there's so much GDM2 documentation out there that does not apply to GDM3... Even the Gnome website has incorrect information, talk about misleading. I should be glad I can't use GDM3 (due to the ati-drivers bug.)


BTW anyone cutting and pasting the patches, they're reversed (fixed file first, original unpatched second).
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sun Aug 10, 2014 9:17 pm    Post subject: Reply with quote

eccerr0r wrote:
It's unfortunate that there's so much GDM2 documentation out there that does not apply to GDM3... Even the Gnome website has incorrect information, talk about misleading. I should be glad I can't use GDM3 (due to the ati-drivers bug.)


BTW anyone cutting and pasting the patches, they're reversed (fixed file first, original unpatched second).


I didn't intend to make these snippets as patches, I just wanted to show the difference. However, you are right, I should have made them as patches to simplify life to anyone stumbling upon them. So, here they are:

Code:
diff /usr/portage/sys-apps/accountsservice/accountsservice-0.6.37.ebuild ./accountsservice-0.6.37.ebuild
18c18,20
< IUSE="doc +introspection selinux systemd"
---
> IUSE="doc lowuids +introspection selinux systemd"
>
> MINUID="1000"
46a49,50
>     use lowuids && MINUID="400"
>
52a57
>       --with-minimum-uid=${MINUID} \


and

Code:
diff /usr/portage/sys-apps/accountsservice/metadata.xml ./metadata.xml
5a6,8
>       <flag name="lowuids">
>          Allow the users with uids between 400 and 1000 to be added to
>          the GDM chooser</flag>

_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 735
Location: Queensland

PostPosted: Sat Feb 25, 2017 12:46 am    Post subject: Reply with quote

eccerr0r wrote:
Browsing through the code it looks like it is hardcoded. You'll have to patch this and rebuild to change it, it appears.


What with this and the 15 minute limit on the screen-saver, I am beginning to see for myself how the GNOME 3 design team has earned its reputation for hubris and stupidity.
_________________
Michael Mounteney
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum