--- generate.incl.orig	2007-01-05 13:05:38.000000000 +1100
+++ generate.incl	2007-01-05 14:18:23.000000000 +1100
@@ -772,28 +772,20 @@
 					fputs($ac_smb_fp, "\tguest ok = no\n");
 					fputs($ac_smb_fp, "\thosts allow =" . $samba_networks . "\n");
 					fputs($ac_smb_fp, "\thosts readonly allow =" . $samba_readonly_networks . "\n");
-					
+
 					if (!$ac_is_snapshot)
 					{
-					
 						/* First clean up any existing @GMT-timestamp entries */
-					
-						$ac_snap_handle = opendir($ac_mountpoint . $ac_file);
-
-						while ($ac_snap_file = readdir($ac_snap_handle))
-							if ((strlen($ac_snap_file) > 5) && (substr($ac_snap_file, 0, "5") == "@GMT-"))
-								exec("/usr/bin/sudo /bin/rm -f " . escapeshellarg($ac_mountpoint . $ac_file . "/" . $ac_snap_file));
-
-						closedir($ac_snap_handle);
+						exec("/usr/bin/sudo /usr/bin/find " . escapeshellarg($ac_mountpoint . $ac_file) . " -maxdepth 1 -type l -name '@GMT-*' -delete");
 					
 						$use_shadow_copy = FALSE;
 
 						for ($ac_si = 0; $ac_si < count($ac_snapshots_id); $ac_si++)
 						{
-							if (($ac_snapshots_vgname[$ac_si] == $ac_vg) && ($ac_snapshots_lvname[$ac_si] == $ac_lv) && ($ac_snapshots_shared[$ac_si] == "yes"))
+							if (($ac_snapshots_vgname[$ac_si] == $ac_vg) && ($ac_snapshots_lvname[$ac_si] == $ac_lv))
 							{
 								$ac_snap_mountpoint = "/mnt/snapshots/" . $ac_snapshots_vgname[$ac_si] . "/" . $ac_snapshots_lvname[$ac_si] . "/" . $ac_snapshots_id[$ac_si] . "/";
-								$ac_snap_timestamp = date("Y.m.d-H.i.s", strtotime($ac_snapshots_timestamp[$ac_si]));
+								$ac_snap_timestamp = gmdate("Y.m.d-H.i.s", strtotime($ac_snapshots_timestamp[$ac_si]));
 
 								if (is_dir($ac_snap_mountpoint))
 								{
@@ -1028,23 +1020,16 @@
 					{
 					
 						/* First clean up any existing @GMT-timestamp entries */
-					
-						$ac_snap_handle = opendir($ac_mountpoint . $ac_file);
-
-						while ($ac_snap_file = readdir($ac_snap_handle))
-							if ((strlen($ac_snap_file) > 5) && (substr($ac_snap_file, 0, "5") == "@GMT-"))
-								exec("/usr/bin/sudo /bin/rm -f " . escapeshellarg($ac_mountpoint . $ac_file . "/" . $ac_snap_file));
-
-						closedir($ac_snap_handle);
+						exec("/usr/bin/sudo /usr/bin/find " . escapeshellarg($ac_mountpoint . $ac_file) . " -maxdepth 1 -type l -name '@GMT-*' -delete");
 					
 						$use_shadow_copy = FALSE;
 
 						for ($ac_si = 0; $ac_si < count($ac_snapshots_id); $ac_si++)
 						{
-							if (($ac_snapshots_vgname[$ac_si] == $ac_vg) && ($ac_snapshots_lvname[$ac_si] == $ac_lv) && ($ac_snapshots_shared[$ac_si] == "yes"))
+							if (($ac_snapshots_vgname[$ac_si] == $ac_vg) && ($ac_snapshots_lvname[$ac_si] == $ac_lv))
 							{
 								$ac_snap_mountpoint = "/mnt/snapshots/" . $ac_snapshots_vgname[$ac_si] . "/" . $ac_snapshots_lvname[$ac_si] . "/" . $ac_snapshots_id[$ac_si] . "/";
-								$ac_snap_timestamp = date("Y.m.d-H.i.s", strtotime($ac_snapshots_timestamp[$ac_si]));
+								$ac_snap_timestamp = gmdate("Y.m.d-H.i.s", strtotime($ac_snapshots_timestamp[$ac_si]));
 
 								if (is_dir($ac_snap_mountpoint))
 								{
