summaryrefslogtreecommitdiff
path: root/sysutils/amanda-common/patches/patch-device-src_device.c
blob: 9705ce4cc4a3c4ba81f5e0bad17d0f4b63a01b77 (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
$NetBSD: patch-device-src_device.c,v 1.1 2015/03/27 23:45:29 gdt Exp $

This patch is from upstream, to improve error reporting when amanda is
configured without tape drive support and one tries to use a tape.

--- device-src/device.c.orig	2012-02-21 11:36:44.000000000 +0000
+++ device-src/device.c
@@ -423,17 +423,13 @@ handle_device_regex(const char * user_na
         regfree(&regex);
         return FALSE;
     } else if (reg_result == REG_NOMATCH) {
+        *driver_name = stralloc("tape");
+        *device = stralloc(user_name);
 #ifdef WANT_TAPE_DEVICE
 	g_warning(
 		"\"%s\" uses deprecated device naming convention; \n"
                 "using \"tape:%s\" instead.\n",
                 user_name, user_name);
-        *driver_name = stralloc("tape");
-        *device = stralloc(user_name);
-#else /* !WANT_TAPE_DEVICE */
-	*errmsg = newvstrallocf(*errmsg, "\"%s\" is not a valid device name.\n", user_name);
-	regfree(&regex);
-	return FALSE;
 #endif /* WANT_TAPE_DEVICE */
     } else {
         *driver_name = find_regex_substring(user_name, pmatch[1]);