Bug 10324 - template homedir substitution bug
Summary: template homedir substitution bug
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.1.2
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: 4.3
Assignee: Garming Sam
QA Contact: Samba QA Contact
Depends on:
Reported: 2013-12-14 15:50 UTC by Andy Igoshin
Modified: 2015-08-28 02:08 UTC (History)
2 users (show)

See Also:

fix for this big (2.42 KB, patch)
2013-12-14 15:51 UTC, Andy Igoshin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Igoshin 2013-12-14 15:50:33 UTC
substitution of %D %U variables in 'template homedir' config option does not work as documented.

patch attached.
Comment 1 Andy Igoshin 2013-12-14 15:51:45 UTC
Created attachment 9526 [details]
fix for this big
Comment 2 Volker Lendecke 2013-12-15 09:29:14 UTC
Andrew, this is about the source4 winbind. How do you want to deal with it?
Comment 3 Andy Igoshin 2013-12-15 10:55:17 UTC
some explanations:

i have samba DC with rfc2307 attributes (uidNumber, gidNumber, loginShell) and
unixHomeDirectory. i use idmap_ldb:use rfc2307 = yes

home directories: /home/<realm>/<user>
roaming profiles: /home/<realm>/<user>/.winprofile
unix user name:   <user>@<realm>

<realm> is lowercased.

i try to configure it as (test with win7 client)
    path = /home/dom.domain.ru
    read only = no

    path = /home/dom.domain.ru/%U/.winprofile
    read only = no

home directory is ok.

profiles are almost. they work although in log i see strange messages - %U
can be substituted as win7 computer name with _ at end.

in documentation in section where there are examples of using %U it is supposed that %U
has a stable value. 
i'm concerned only about description of %U in VARIABLE SUBSTITUTIONS section.
i get the result of %U as documented (the value is unstable).

in searching of more stable solution i came to:

    path = %H/.winprofile
    read only = no

but %H is /home/DOM/<user>

so we came to template homedir = /home/dom.domain.ru/%U

(tested via wbinfo -i <user> . i have not run the real test with win7 client
since it is weekend now)

[it seems winbind nss info = rfc2307 can't be used in such construction when
this all is on DC]
Comment 4 Andreas Schneider 2014-10-28 10:41:04 UTC
Garming, could you please look into this issue?
Comment 5 Karolin Seeger 2014-11-27 10:55:39 UTC
Is this a showstopper for 4.2.0?
Comment 6 Stefan Metzmacher 2014-11-29 10:25:16 UTC
This is not a 4.2.0 blocker, it already be fixed by using the source3 winbindd
implementation by default.
Comment 7 Garming Sam 2015-08-28 02:08:56 UTC
I assume this should be closed?