Bug #2555

The Windows file NTUSER.DAT is truncated to 256KB

Added by Tomás Abad about 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:06/18/2014
Priority:NormalDue date:
Assignee:Guillaume Rousse% Done:

100%

Category:inventory
Target version:2.3.9
For junior contributor:No

Description

... if an inventory task coincides with the start of the session (login) of a user who has a roaming user profile.

The environment

Desktop equipments with Microsoft Windows XP SP3, two types,

  • (x10) FusionInventory Agent 2.3.8 (official version) (Desktop Type A)
  • (> 1000) FusionInventory Agent 2.3.8 (patched, see below) (Desktop Type B)

The patched FIAs 2.3.8 (Desktops Type B) ignore the _loadUserSoftware function of the lib/FusionInventory/Agent/Task/Inventory/Win32/Softwares.pm file. This is the patch

--- Softwares.pm.org    2014-06-18 20:24:17.000000000 +0200
+++ Softwares.pm.new    2014-06-18 20:26:18.000000000 +0200
@@ -122,6 +122,7 @@
 }

 sub _loadUserSoftware {
+    return;
     my (%params) = @_;

     my $inventory = $params{inventory};

The test

During more than fifteen days, the users have been opening their sessions in these desktop computers (Types A & B). Practically, all of these users have roaming profiles.

In those desktop equipments with FIA patched (Type B), we never have had problems with the NTUSER.DAT file, in contrast to the desktop equipments with FIAs not patched (Type A).

This is that happens in desktop equipments with FIAs not patched.

  1. The desktop equipment is powered on.
  2. The system starts the FusionInventory-Agent Windows Service.
  3. The login screen appears and the user starts its session immediately.
  4. The user session takes long time to open (more than 15 minutes).
  5. The user session opens but the user profile is corrupted (NTUSER.DAT has 256KB).

After step 3, the inventory task of FIA is running (started after step 2) while the user profile (NTUSER.DAT) is under construction. I think the problem is in this part of the code (lib/FusionInventory/Agent/Task/Inventory/Win32/Softwares.pm file), lines 158 and 159.

155         my $user = basename($profilePath);
156         ## no critic (ProhibitBitwise)
157         my $userKey = $is64bit ?
158             $Registry->Load($profilePath.'\ntuser.dat', { Access=> KEY_READ | KEY_WOW64_64 } ) :
159             $Registry->Load($profilePath.'\ntuser.dat', { Access=> KEY_READ } )                ;
160
161         my $softwaresKey =
162             $userKey->{"SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall"};
163

The code try to read a file under construction (it’s a roaming user profile). The question is to knows what locks to what, whether FIA to Windows OS or Windows OS to FIA.

This happens with the complete FIA 2.3.x series (see Could the agent 2.3.4 corrupts the roaming user profiles in Windows?)


Related issues

Related to fusioninventory-agent-windows-installer - Tasks #2608: Add support to the new --scan-profiles option (CLI) Closed 07/16/2014

History

#1 Updated by Guillaume Rousse almost 3 years ago

  • Category set to inventory
  • Assignee set to Guillaume Rousse
  • Target version set to 2.3.9

should be fixed with commit #085a3df. An explicit scan-profiles option is now required to scan user profiles for software, the same say as scan-homedirs is required for virtual machines in home directories.

#2 Updated by Guillaume Rousse almost 3 years ago

  • Status changed from New to Resolved

#3 Updated by Guillaume Rousse almost 3 years ago

  • % Done changed from 0 to 100

#4 Updated by Anonymous almost 3 years ago

Applied in changeset commit:d1dec24baa5fcabfe710b5d9bbd134c4bf750d16.

#5 Updated by Anonymous almost 3 years ago

Applied in changeset commit:085a3df8fe0380412fe8e7ca517bcd521d2bd28a.

#6 Updated by Tomás Abad almost 3 years ago

That is a good solution at the moment because the problem is there, isn't it?

#7 Updated by Guillaume Rousse almost 3 years ago

  • Status changed from Resolved to Closed

#8 Updated by Tomás Abad almost 3 years ago

  • Related to Tasks #2608: Add support to the new --scan-profiles option (CLI) added

Also available in: Atom PDF