cpio - Cannot extract through symlink

Jan Stary hans at stare.cz
Thu Mar 2 12:44:33 UTC 2017

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
 $ 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

	(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?


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 at 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
  TSC: P-state invariant
real memory  = 2148007936 (2048 MB)
avail memory = 2068619264 (1972 MB)
Event timer "LAPIC" quality 400
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 <Version 2.0> irqs 0-23 on motherboard
random: entropy device external interface
kbd1 at kbdmux0
module_register_init: MOD_LOAD (vesa, 0xc1295360, 0) error 19
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
acpi0: <COMPAQ CPQ0968> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> 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: <ACPI Host-PCI bridge> 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: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0x1800-0x1807 mem 0xcfe00000-0xcfe7ffff,0xe0000000-0xefffffff,0xcff00000-0xcff3ffff irq 16 at device 2.0 on pci0
agp0: <Intel 82915G (915G GMCH) SVGA controller> on vgapci0
agp0: aperture size is 256M, detected 7932k stolen memory
vgapci0: Boot video device
vgapci1: <VGA-compatible display> mem 0xcfe80000-0xcfefffff at device 2.1 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pcib2: <ACPI PCI-PCI bridge> irq 17 at device 28.1 on pci0
pci1: <ACPI PCI bus> on pcib2
bge0: <Broadcom NetXtreme Gigabit Ethernet Controller, ASIC rev. 0x004001> mem 0xf0400000-0xf040ffff irq 17 at device 0.0 on pci1
bge0: CHIP ID 0x00004001; ASIC REV 0x04; CHIP REV 0x40; PCI-E
miibus0: <MII bus> on bge0
brgphy0: <BCM5750 1000BASE-T media interface> 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: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A> port 0x1440-0x145f irq 20 at device 29.0 on pci0
usbus0 on uhci0
uhci1: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-B> port 0x1460-0x147f irq 18 at device 29.1 on pci0
usbus1 on uhci1
uhci2: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-C> port 0x1480-0x149f irq 21 at device 29.2 on pci0
usbus2 on uhci2
uhci3: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D> port 0x14a0-0x14bf irq 22 at device 29.3 on pci0
usbus3 on uhci3
ehci0: <Intel 82801FB (ICH6) USB 2.0 controller> mem 0xcff40000-0xcff403ff irq 20 at device 29.7 on pci0
usbus4: EHCI version 1.0
usbus4 on ehci0
pcib3: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib3
pcm0: <Intel ICH6 (82801FB)> port 0x1000-0x10ff,0x1400-0x143f mem 0xcff40400-0xcff405ff,0xcff40600-0xcff406ff irq 21 at device 30.2 on pci0
pcm0: <Analog Devices AD1981B AC97 Codec>
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH6 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x14e0-0x14ef irq 17 at device 31.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
atapci1: <Intel ICH6 SATA150 controller> port 0x1818-0x181f,0x1830-0x1833,0x1820-0x1827,0x1834-0x1837,0x14f0-0x14ff irq 19 at device 31.2 on pci0
ata2: <ATA channel> at channel 0 on atapci1
ata3: <ATA channel> at channel 1 on atapci1
acpi_button0: <Power Button> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
ppc0: <Parallel port> 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: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
pmtimer0 on isa0
orm0: <ISA Option ROMs> 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: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <Intel> at usbus1
uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <Intel> at usbus2
uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
usbus3: 12Mbps Full Speed USB v1.0
usbus4: 480Mbps High Speed USB v2.0
ugen3.1: <Intel> at usbus3
uhub3: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen4.1: <Intel> at usbus4
uhub4: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> 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: <LITEON DVD-ROM LTD163 GDHF> 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: <WDC WD400BB-75FJA1 14.03G14> 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

More information about the freebsd-questions mailing list