File: 612741.patch

package info (click to toggle)
cksfv 1.3.14-3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 392 kB
  • sloc: ansic: 819; sh: 314; makefile: 28
file content (41 lines) | stat: -rw-r--r-- 983 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: Sébastien Noel <sebastien@twolife.be>
Subject: clarify usage of "-g" option

fix debian bug #612741

--- a/cksfv.1
+++ b/cksfv.1
@@ -52,8 +52,9 @@
 .B \-f file
 Verify checksums in the sfv file
 .TP
-.B \-g path
-Go to the path name directory and verify checksums in the sfv file
+.B \-g file
+Change current directory to the path name of the file and verify checksums
+in the sfv.
 .TP
 .B \-i
 Ignore case in filenames. This is used in the checksum verification mode.
--- a/src/readsfv.c
+++ b/src/readsfv.c
@@ -84,6 +84,18 @@
 	    fprintf(stderr, "cksfv: %s: %s\n", fn, strerror(errno));
 	return 1;
     }
+    if (fstat(fileno(fd), &st)) {
+	if (!TOTALLY_QUIET)
+	    fprintf(stderr, "cksfv: can not fstat %s: %s\n", fn, strerror(errno));
+	fclose(fd);
+	return 1;
+    }
+    if (S_ISDIR(st.st_mode)) {
+	if (!TOTALLY_QUIET)
+	    fprintf(stderr, "cksfv: %s: Is a directory\n", fn);
+	fclose(fd);
+	return 1;
+    }
 
     if (chdir(dir) != 0) {
 	if (!TOTALLY_QUIET)