[Samba] Windows User Profile corruption on a member server
mjt at tls.msk.ru
Sat Feb 12 10:16:46 UTC 2022
This is a second but very bad issue we had after converting our
NT4-style domain to AD.
A small background: an AD DC server from classicupgrade, running
as domain controller. And a separate file server, joined to the
domain with fresh settings (nothing in /var/lib/samba/ etc).
At the time of testing we had mixed users - since historically
all our users were both local users and "samba users", we kept
local users in parallel with the AD users, keeping the same uids.
I *think* this should not matter in this context, but I'd mention
this just in case.
The problem is that once we joined the fileserver (actually it
was our old main server but we removed all samba data from it
before joining it to the domain) into AD, we started seeing
user profile corruptions - some files changed contents in
various ways when syncronising profile. I can't say if the
prob is specific to user profiles or general, so far we only
faced it with profiles only.
It doesn't happen on every login/logout, - one may perform
5-10 logins/logouts (with profile copying from/to server),
and everything will be normal (seemingly). And the next time
some files appear corrupt.
For some reason the most often corrupt file was one or two
files presenting applications pinned to the taskbar, - again,
I've no idea why this place specially, maybe it was just
because it's easy to see. For example, "windows explorer"
pinned to the user taskbar is a .lnk file in this location
in the profile:
AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\File Explorer.lnk
Usually it is a normal shortcut, but it becomes something
else entirely. An example of this file is attached to
this email (in .zip archive), - it is some binary file
83 bytes long. The archive contains both the original
file as it was and the corrupt file after profile
corruption (in good/ and bad/ subdirs).
We've seen other cases of corruption too, - for example
Thunderbird calendar database - which is also resides in
the user profile and is syncronized on logon/logoff.
The interesting thing is that this corruption has become
frequent only after converting this server from the single
NT4-style domain server to an AD member server (without
any old samba data on it). Before conversion to AD there
was no single case of file corruption observed in more
than 10 years.
I joined another freshly installed test server to the
same domain and configured a test user in the AD so that
his user profile is on this server. And starting with a
freshly created profile, after a few logins/logouts, I
see the same corruption again.
There's nothing related in the event log on windows as
far as I can see, and there are no errors on the samba
It *seems* like the corruption happens when copying the
profile from samba to windows, but I'm not 100% sure.
I *think* I've seen the case where this "File Explorer"
file was bad in the local copy but at the same time was
ok on server (and become bad on server too after logout).
I plan to debug this further because it is a really serious
case and it is the first time in many years I see file
corruption on samba. For now, due to this very issue,
I had to restore our NT4-style server to its original
pre-AD style (and profile corruption immediately stopped).
Thinking about the "duplicate users" thing again, - there
*should* be no difference here as long as windows accepts
this user profile as belonging to the right user, right?
Any hints about how to debug this further are greatly
More information about the samba