OCSInventory-NG / UnixAgent

This is the OCS unified agent for Unix operating systems
http://www.ocsinventory-ng.org/en/
GNU General Public License v2.0
89 stars 83 forks source link

Fixed VirtualBox Script to Fetch VMs For The Current User #386

Closed hamzashariq7 closed 1 year ago

hamzashariq7 commented 2 years ago

Must read before submitting

Please, take a look to our contributing guidelines before submitting your pull request. There's some simple rules that will help us to speed up the review process and avoid any misunderstanding

Contributors GuideLines

Status

READY

Description

Virtualbox stores a list of VMs separately for each user. Since the unix agent is run as root, OCS returns the list of VMs for the root user (which is often empty).

This is undesirable since the VMs the user is looking for are more likely to be installed for the current user and not root.

I've fixed this by running the command as the current user instead of root, so that the proper list of VMs is returned.

Related Issues

384

Todos

Test environment

If some tests has been already made, please give us your test environment' specs

General informations

Operating system :
Perl version :

OCS Inventory informations

Unix agent version :

Deploy Notes

Notes regarding deployment the contained body of work. These should note any dependencies changes, logical changes, etc.

1.

Impacted Areas in Application

List general components of the application that this PR will affect:

*

gillesdubois commented 1 year ago

Hi,

Thanks for your help and contribution we managed to validate your modification. I'm merging.

Regards, Gilles.