diff --git lin_monitor src workplaceagent agenthosts plugins mobileplu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
diff --git a/lin_monitor/src/workplaceagent/agenthosts/plugins/mobileplugin/mobileplugin.cpp b/lin_monitor/src/workplaceagent/agenthosts/plugins/mobileplugin/mobileplugin.cpp
index 35fd983e..a818a63f 100644
--- a/lin_monitor/src/workplaceagent/agenthosts/plugins/mobileplugin/mobileplugin.cpp
+++ b/lin_monitor/src/workplaceagent/agenthosts/plugins/mobileplugin/mobileplugin.cpp
@@ -67,7 +67,8 @@ void MobilePlugin::intercept_libmtp() {
// Build LibMTP variant with symbols renamed, to faciliate interception
fs::path libmtp_patched = "/usr/lib/libmtp.so.pakrm";
- fs::copy_file(libmtp, libmtp_patched, fs::copy_options::overwrite_existing);
+ fs::remove(libmtp_patched);
+ fs::copy_file(libmtp, libmtp_patched);
patch_libmtp(libmtp_patched);
// Provide our wrapper in place of the system LibMTP