File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ Revision history for GLPI agent
44
55core:
66* On windows, permit to use libxml2 built libraries in different threads
7+ * Reset target id after loading saved state to avoir re-using same id after a
8+ target configuration update
79
810inventory:
911* PR #931: Added DrWeb & Karpersky Endpoint for Linux antivirus support on linux
Original file line number Diff line number Diff line change @@ -43,12 +43,6 @@ sub _init {
4343
4444 my $logger = $self -> {logger };
4545
46- # target identity
47- $self -> {id } = $params {id };
48-
49- # Initialize logger prefix
50- $self -> {_logprefix } = " [target $self ->{id}]" ;
51-
5246 $self -> {storage } = GLPI::Agent::Storage-> new(
5347 logger => $self -> {logger },
5448 oldvardir => $params {oldvardir } // " " ,
@@ -60,6 +54,12 @@ sub _init {
6054 # handle persistent state
6155 $self -> _loadState();
6256
57+ # Always reset target identity to avoid reusing if after a target reconfiguration
58+ $self -> {id } = $params {id };
59+
60+ # Initialize logger prefix after id has been eventually reset
61+ $self -> {_logprefix } = " [target $self ->{id}]" ;
62+
6363 # Update maxDelay from provided config when not a server
6464 unless ($self -> isType(' server' )) {
6565 $self -> setMaxDelay($keepMaxDelay );
You can’t perform that action at this time.
0 commit comments