tags #660372 + patch
thanks

--- /usr/bin/rsnapshot.orig	2012-02-18 18:36:24.000000000 +0100
+++ /usr/bin/rsnapshot	2012-02-18 18:45:49.000000000 +0100
@@ -4039,7 +4039,16 @@
 	
 	print_cmd($cmd);
 	if (0 == $test) {
+		my $pre_systemcall_cwd = cwd();
+
+		# run $cmd from $HOME, allows unmounting of the snapshot root by
+		# cmd_postexec config option
+		chdir();
 		$return = system($cmd);
+
+		# return to the directory we were in before executing $cmd
+		chdir($pre_systemcall_cwd);
+
 		if (!defined($return)) {
 			print_err("Warning! exec_cmd(\"$cmd\") returned undef", 2);
 		}

Attachment: pgpJz81sVdmxZ.pgp
Description: Digitale PGP-Unterschrift



Reply via email to