Page 1 of 1

WSUS Offline just removed my profile, at least what it could

PostPosted: 04.02.2015, 10:08
by LogicDaemon
Yesterday evening I started
Code: Select all
cmd\DoUpdate.cmd /nobackup /instielatest /updatercerts /updatecpp /instdotnet35 /instdotnet4 /updatetsc /autoreboot

on my Win 8.1 Pro 32-bit and gone to sleep.

Today I've seen account selection screen, where were WOUTempAdmin account listed (and it was said "logged in", so autologin worked, but after that session locked due to user idleness), but I couldn't login with it (I didn't know its password).

So I just logged in with my account, but, before I managed to start procexp to see what's happening, console window appeared with usual wsusoffline after-reboot cleanup, and then windows restarted.

After reboot, There still was WOUTempAdmin account listed, but no auto-login happened. So I just logged in my usual account, and even before shell (explorer.exe) get displayed, console window appeared with running filenames. I thought, WTF, has Microsoft come to updating this way again? (this was after installing update rollups). After a minute I suspected something goes wrong, because it was my files, and some access errors, opened task manager, then procexp from it (because shell still wasn't onscreen, and it didn't react to Win+R), and found it's
Code: Select all
rd /s /q "full path to my profile"
running!

Reset, cold sweat, etc.

It was running under RunOnce.exe.
And I guess it was scheduled by WSUS Offline when I logged in with my account when WOUTempAdmin didn't finish yet. WSUSOffline thought it's my account is temporary, and decided to kill it. Another witness of this is that Users\WOUTempAdmin dir is still intact.

Currently I'm recovering from backups, but I propose adding some sanity checks before running rd /s /q (both automated, like checking username, and interactive, like displaying «I'm going to remove "path" if you won't close this window in 30 seconds»).

At least check "%USERNAME%" before running RD /S /Q, like that:
Code: Select all
%comspec% /C IF /I "%USERNAME%"=="WOUTempAdmin" RD /S /Q …

But also, you can read WOUTempAdmin profile path from
Code: Select all
REG ADD "HKEY_CURRENT_USER\Software\Sysinternals\PsGetSid" /v "EulaAccepted" /t REG_DWORD /d 1 /f
FOR /F "usebackq tokens=1 delims=" %%Z IN (`psgetsid.exe WOUTempAdmin`) DO IF NOT "%%Z"=="" SET SID=%%Z
FOR /F "usebackq tokens=2*" %%Y IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%SID%" /v "ProfileImagePath"`) DO SET ProfileImagePath=%%Z
instead of just using %USERPROFILE%. To get SID from USERNAME, you can use http://live.sysinternals.com/psgetsid.exe (which can be downloaded similarly to autologon.exe).

(though note, I didn't read actual script code, so maybe my code-suggestions are invalid, yet they'll help you get the picture)

--
This is latest current wsusoffline, ver. 9.51.

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 05.02.2015, 17:44
by WSUSUpdateAdmin
Hi!

First of all: Thanks for you detailed description and sorry for inconvenience!

I'll try to reproduce, understand and fix what happened, but yesterday my notebook's HDD fell down and crashed :(, so please be patient.

Kind regards
Torsten Wittrock

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 05.02.2015, 22:10
by boco
@WSUSUpdateAdmin: Oww, that sucks... :(

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 09.02.2015, 17:10
by WSUSUpdateAdmin
Hi!

Ouch, that's a serious one (came in by v. 9.4.1, I guess). :shock:
Fixed in http://trac.wsusoffline.net/browser/trunk (r642): '- Fix: CleanupRecall.cmd script could erroneously delete a user profile different from WOUTempAdmin (Thanks to "LogicDaemon")'
See also diff.

A new release has to come soon, of course.

Sorry and thanks again!

Kind regards,
Torsten

@boco: Indeed, yes...

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 11.02.2015, 13:31
by Stiefel94
Hallo,

wäre es nicht besser die Version welche fehlerhaft ist solange zurückzuziehen?
Weil es gibt viele Unternehmen die den WSUSOffline Updater einsetzen. Und da ist es nicht so schön wenn erst mal das ganze Benutzerverzeichnis gelöscht wird.
Außerdem habe ich eine weitere Frage, da wir diesen Fall jetzt auch schon 2 mal hatten.
Und zwar wollte ich wissen ob es sein kann, dass der RUNONCE Eintrag erst später ausgeführt wird?
Weil bei den 2 Fällen welche wir hatten liefen die Rechner ca. 2 Wochen normal und dann kam erst das beschriebene Problem.

Grüße Stiefel

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 12.02.2015, 00:12
by WSUSUpdateAdmin
Moin!

Stiefel94 wrote:wäre es nicht besser die Version welche fehlerhaft ist solange zurückzuziehen?

Nicht nötig: http://download.wsusoffline.net/wsusoffline952.zip

Stiefel94 wrote:[...]Außerdem habe ich eine weitere Frage, da wir diesen Fall jetzt auch schon 2 mal hatten.
Und zwar wollte ich wissen ob es sein kann, dass der RUNONCE Eintrag erst später ausgeführt wird?
Weil bei den 2 Fällen welche wir hatten liefen die Rechner ca. 2 Wochen normal und dann kam erst das beschriebene Problem.


Das halte ich für ausgeschlossen, da der Eintrag unter HKLM\... vorgenommen wird.
Wenn es sich dennoch so unerwartet/falsch verhält, ist es Microsofts Problem.

GTW

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 12.02.2015, 08:24
by WSUSUpdateAdmin
Moin!

Noch etwas: Dieses Fehlverhalten, so unangenehm es auch sein mag, tritt bzw. trat in einem "normalen" Ablauf gar nicht auf - sonst wäre es wohl auch viel früher entdeckt worden.

Gruß
Torsten Wittrock

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 13.02.2015, 00:41
by LogicDaemon
Thanks for fast response and quick fix!

Re: WSUS Offline just removed my profile, at least what it c

PostPosted: 13.02.2015, 08:29
by WSUSUpdateAdmin
:)