From: Sergey Matveev <stargrave@stargrave.org>
Date: Sun, 20 Sep 2015 18:59:39 +0000 (+0300)
Subject: Preset destination value is dangerous
X-Git-Tag: v0.1.0~10
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b5c292bae9c9b1ea188ba300775a5e28d80829f9;p=syncer.git

Preset destination value is dangerous
---

diff --git a/syncer.go b/syncer.go
index 3d96ccd..3a9e68a 100644
--- a/syncer.go
+++ b/syncer.go
@@ -35,7 +35,7 @@ import (
 var (
 	blkSize   = flag.Int64("blk", 2*1<<10, "Block size (KiB)")
 	statePath = flag.String("state", "state.bin", "Path to statefile")
-	dstPath   = flag.String("dst", "/dev/ada0", "Path to destination disk")
+	dstPath   = flag.String("dst", "", "Path to destination disk")
 	srcPath   = flag.String("src", "/dev/da0", "Path to source disk")
 )
 
@@ -54,6 +54,10 @@ func main() {
 	flag.Parse()
 	bs := *blkSize * int64(1<<10)
 
+	if *dstPath == "" {
+		log.Fatalln("Not destination is specified")
+	}
+
 	// Open source, calculate number of blocks
 	var size int64
 	src, err := os.Open(*srcPath)