summaryrefslogtreecommitdiff
path: root/security/lastpass-cli/patches/patch-upload-queue.c
blob: d214f37363bdd9324ff3525ba41ebd1ea975e992 (plain)
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
$NetBSD: patch-upload-queue.c,v 1.1 2017/08/16 15:18:24 jperkin Exp $

SunOS compatibility.

--- upload-queue.c.orig	2017-06-28 12:50:49.000000000 +0000
+++ upload-queue.c
@@ -110,8 +110,12 @@ static void upload_queue_cleanup_failure
 
 	while ((entry = readdir(dir))) {
 		_cleanup_free_ char *fn = NULL;
-
+#ifdef __sun
+		stat(entry->d_name, &sbuf);
+		if (sbuf.st_mode != S_IFREG)
+#else
 		if (entry->d_type != DT_REG && entry->d_type != DT_UNKNOWN)
+#endif
 			continue;
 
 		for (p = entry->d_name; *p; ++p) {
@@ -172,11 +176,19 @@ static char *upload_queue_next_entry(uns
 	char *result, *p;
 	DIR *dir = opendir(base_path);
 	struct dirent *entry;
+#ifdef __sun
+	struct stat s;
+#endif
 
 	if (!dir)
 		return NULL;
 	while ((entry = readdir(dir))) {
+#ifdef __sun
+		stat(entry->d_name, &s);
+		if (s.st_mode != S_IFREG)
+#else
 		if (entry->d_type != DT_REG && entry->d_type != DT_UNKNOWN)
+#endif
 			continue;
 
 		for (p = entry->d_name; *p; ++p) {