This file is indexed.

/usr/share/perl5/Apache/Ocsinventory/Interface/Updates.pm is in ocsinventory-server 2.0.5-1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package Apache::Ocsinventory::Interface::Updates;

use Apache::Ocsinventory::Map;
use Apache::Ocsinventory::Server::System;
use Apache::Ocsinventory::Interface::Database;

use strict;

require Exporter;

our @ISA = qw /Exporter/;

our @EXPORT = qw //;

sub delete_computers_by_id {
  my $computerIds = shift ;
  my $dbh = &get_dbh_write ;

  for my $hardwareId (@{$computerIds}){
    # We lock the computer to avoid race condition
    next if &_lock($hardwareId, $dbh) ;

    for my $section ( keys %DATA_MAP ){
      my $hardwareIdField = get_table_pk($section) ;

      # delOnReplace is used here even if the section is not "auto"
      # "auto" is only useful for the import phases
      next if !$DATA_MAP{ $section }->{delOnReplace} ;
      do_sql("DELETE FROM $section WHERE $hardwareIdField=$hardwareId") ;
    }
    &_unlock($hardwareId, $dbh) ;
  }
  return 'OK' ;
}
1;