From owner-freebsd-questions@freebsd.org Thu Mar 2 12:44:33 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BEBCCF1F31 for ; Thu, 2 Mar 2017 12:44:33 +0000 (UTC) (envelope-from hans@stare.cz) Received: from mx.stare.cz (ns.stare.cz [79.98.77.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEEFE06 for ; Thu, 2 Mar 2017 12:44:32 +0000 (UTC) (envelope-from hans@stare.cz) Received: from www.stare.cz (localhost [127.0.0.1]) by www.stare.cz (OpenSMTPD) with ESMTP id 8f11ffdf for ; Thu, 2 Mar 2017 13:44:29 +0100 (CET) Date: Thu, 2 Mar 2017 13:44:29 +0100 From: Jan Stary To: freebsd-questions@freebsd.org Subject: cpio - Cannot extract through symlink Message-ID: <20170302124428.GA70192@www.stare.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 12:44:33 -0000 This is 11.0-RELEASE-p1 (i386) on an old HP Compaq (dmesg below). I am having problems trying to copy files with cpio: $ cd /tmp $ touch foo $ ls foo foo $ ls foo | cpio -pud ~ cpio: foo: Cannot extract through symlink /home/hans/foo 0 blocks What "symlink"? The cpio(1) only mentions symlinks in -L, imho not relevant here, it's a regular file, and --insecure --insecure (i and p mode only) Disable security checks during extraction or copying. This allows extraction via symbolic links, absolute paths, and path names containing `..' in the name. Yes, it works with $ ls foo | cpio --insecure -pud ~ but I would very much like to avoid the unportable --insecure. How is /tmp/foo supposed to get copied to $HOME 'via symlink' anyway? Am I missing something obvious? Jan Copyright (c) 1992-2016 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 03:40:55 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0) VT(vga): resolution 640x480 CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2994.45-MHz 686-class CPU) Origin="GenuineIntel" Id=0xf34 Family=0xf Model=0x3 Stepping=4 Features=0xbfebfbff Features2=0x441d TSC: P-state invariant real memory = 2148007936 (2048 MB) avail memory = 2068619264 (1972 MB) Event timer "LAPIC" quality 400 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 1 package(s) x 2 hardware threads random: unblocking device. ioapic0: Changing APIC ID to 1 ioapic0 irqs 0-23 on motherboard random: entropy device external interface kbd1 at kbdmux0 module_register_init: MOD_LOAD (vesa, 0xc1295360, 0) error 19 vtvga0: on motherboard cryptosoft0: on motherboard acpi0: on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 atrtc0: port 0x70-0x71 irq 8 on acpi0 Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0xf808-0xf80b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 ACPI BIOS Error (bug): \134_SB.PCI0._OSC: Excess arguments - ASL declared 5, ACPI requires 4 (20160527/nsarguments-192) pcib0: _OSC failed: AE_BUFFER_OVERFLOW pci0: on pcib0 vgapci0: port 0x1800-0x1807 mem 0xcfe00000-0xcfe7ffff,0xe0000000-0xefffffff,0xcff00000-0xcff3ffff irq 16 at device 2.0 on pci0 agp0: on vgapci0 agp0: aperture size is 256M, detected 7932k stolen memory vgapci0: Boot video device vgapci1: mem 0xcfe80000-0xcfefffff at device 2.1 on pci0 pcib1: at device 28.0 on pci0 pcib1: [GIANT-LOCKED] pcib2: irq 17 at device 28.1 on pci0 pcib2: [GIANT-LOCKED] pci1: on pcib2 bge0: mem 0xf0400000-0xf040ffff irq 17 at device 0.0 on pci1 bge0: CHIP ID 0x00004001; ASIC REV 0x04; CHIP REV 0x40; PCI-E miibus0: on bge0 brgphy0: PHY 1 on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow bge0: Ethernet address: 00:12:79:6c:ab:72 uhci0: port 0x1440-0x145f irq 20 at device 29.0 on pci0 usbus0 on uhci0 uhci1: port 0x1460-0x147f irq 18 at device 29.1 on pci0 usbus1 on uhci1 uhci2: port 0x1480-0x149f irq 21 at device 29.2 on pci0 usbus2 on uhci2 uhci3: port 0x14a0-0x14bf irq 22 at device 29.3 on pci0 usbus3 on uhci3 ehci0: mem 0xcff40000-0xcff403ff irq 20 at device 29.7 on pci0 usbus4: EHCI version 1.0 usbus4 on ehci0 pcib3: at device 30.0 on pci0 pci2: on pcib3 pcm0: port 0x1000-0x10ff,0x1400-0x143f mem 0xcff40400-0xcff405ff,0xcff40600-0xcff406ff irq 21 at device 30.2 on pci0 pcm0: isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x14e0-0x14ef irq 17 at device 31.1 on pci0 ata0: at channel 0 on atapci0 ata1: at channel 1 on atapci0 atapci1: port 0x1818-0x181f,0x1830-0x1833,0x1820-0x1827,0x1834-0x1837,0x14f0-0x14ff irq 19 at device 31.2 on pci0 ata2: at channel 0 on atapci1 ata3: at channel 1 on atapci1 acpi_button0: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] ppc0: port 0x378-0x37f,0x778-0x77d irq 7 drq 3 on acpi0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/13 bytes threshold ppbus0: on ppc0 lpt0: on ppbus0 lpt0: Interrupt-driven port ppi0: on ppbus0 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fd0: <1440-KB 3.5" drive> on fdc0 drive 0 pmtimer0 on isa0 orm0: at iomem 0xc0000-0xca7ff,0xca800-0xcb7ff,0xcb800-0xcd7ff pnpid ORM0000 on isa0 usbus0: 12Mbps Full Speed USB v1.0 Timecounters tick every 1.000 msec nvme cam probe device init usbus1: 12Mbps Full Speed USB v1.0 usbus2: 12Mbps Full Speed USB v1.0 ugen0.1: at usbus0 uhub0: on usbus0 ugen1.1: at usbus1 uhub1: on usbus1 ugen2.1: at usbus2 uhub2: on usbus2 usbus3: 12Mbps Full Speed USB v1.0 usbus4: 480Mbps High Speed USB v2.0 ugen3.1: at usbus3 uhub3: on usbus3 ugen4.1: at usbus4 uhub4: on usbus4 uhub0: 2 ports with 2 removable, self powered uhub1: 2 ports with 2 removable, self powered uhub2: 2 ports with 2 removable, self powered uhub3: 2 ports with 2 removable, self powered cd0 at ata0 bus 0 scbus0 target 1 lun 0 cd0: Removable CD-ROM SCSI device cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present ada0 at ata0 bus 0 scbus0 target 0 lun 0 ada0: ATA-6 device ada0: Serial Number WD-WCAJC3465929 ada0: 100.000MB/s transfers (UDMA5, PIO 8192bytes) ada0: 38146MB (78125000 512 byte sectors) SMP: AP CPU #1 Launched! Timecounter "TSC-low" frequency 1497226642 Hz quality 1000 Trying to mount root from ufs:/dev/ada0s1a [rw]... uhub4: 8 ports with 8 removable, self powered bge0: link state changed to DOWN bge0: link state changed to UP