cpio/cpio-default_tape_dev.patch
Martin Pluskal 22ed1491e1 Accepting request 826878 from home:dirkmueller:branches:Archiving
- update to 2.13:
  * CVE-2015-1197, CVE-2016-2037, CVE-2019-14866 
- remove patches (upstream):
  cpio-2.12-out_of_bounds_write.patch, cpio-2.12-CVE-2019-14866.patch,
  cpio-2.12-util.c_no_return_in_nonvoid_fnc.patch,
  cpio-check_for_symlinks.patch

OBS-URL: https://build.opensuse.org/request/show/826878
OBS-URL: https://build.opensuse.org/package/show/Archiving/cpio?expand=0&rev=81
2020-08-19 10:06:19 +00:00

29 lines
926 B
Diff

Index: src/mt.c
===================================================================
--- src/mt.c.orig
+++ src/mt.c
@@ -225,11 +225,18 @@ parse_opt (int key, char *arg, struct ar
{
tapedev = getenv ("TAPE");
if (tapedev == NULL)
-#ifdef DEFTAPE /* From sys/mtio.h. */
- tapedev = DEFTAPE;
-#else
- error (MT_EXIT_INVOP, 0, _("no tape device specified"));
-#endif
+
+/* Suse doesn't have /dev/tape as link to /dev/nst0 any more.
+Instead it uses udev and creates different names in /dev/tape/by-id/ directory.
+If it is SCSI tape storage then it creates /dev/tape/by-id/scsi--nst
+If it is USB device then it creates something not predictibable:
+/dev/tape/by-id/scsi-*HP_blabla*{VENDOR_SPECIFIC}*-nst
+So let's use old behave which was /dev/nst0.
+bnc#355241
+*/
+/* #ifdef DEFTAPE * From sys/mtio.h. * */
+# define DEFSUSETAPE "/dev/nst0"
+ tapedev = DEFSUSETAPE;
}
break;