Bug 14261 - wrong expansion of '%G' in parameter 'template homedir'
Summary: wrong expansion of '%G' in parameter 'template homedir'
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.9.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2020-02-03 12:55 UTC by Albert
Modified: 2020-02-03 21:07 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Albert 2020-02-03 12:55:22 UTC
Hello, dear Samba developers!

First of all, I'd like to thank you for this change:

> winbind primary group and nss info
> With 4.6, it will be possible to optionally use the primary group as set in the "Unix > Attributes" tab for the local unix token of a domain user. Before 4.6, the Windows primary group was always chosen as primary group for the local unix token.
> To activate the unix primary group, set
> idmap config <DOMAIN> : unix_primary_group = yes

It is Greatly appreciated! Now we have the primary groups for all the users set correctly even BEFORE they log in, thank you!

But I found out that string '%G' in parameter 'template homedir' is still expands to "Domain Users" for all the users that didn't log in.

We have 'template homedir = /FILES/%G/staff/%U' in smb.conf.
We have group ADMIN with gidNumber 5100 (gidNumber of 'Domain Users' is 5615)
So now even before user logs in he has a correct gid, but not the home folder:

# getent passwd admin
admin:*:5203:5100::/FILES/Domain Users/staff/admin:/bin/bash

after login it became as it should be (correct gid AND home folder):


But we need to know correct users home folders for all users BEFORE they log in. It is required for scheduled scripts (backup, optimisation, etc.)

This is the last thing preventing us to use Samba gracefully!
I'm asking you to fix this!
Thank you!

Best regards,