summaryrefslogtreecommitdiff
path: root/pkg/bindings/images/build_unix.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-05-20 16:09:40 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-05-22 05:27:03 -0400
commitf22791aec7b4d942872ca21539a44d0375b73949 (patch)
tree6db26ccde1ea0defb78d21109be6b4d6997cf080 /pkg/bindings/images/build_unix.go
parent490915c68e6fce48508d42d138ac1c92c877abe7 (diff)
downloadpodman-f22791aec7b4d942872ca21539a44d0375b73949.tar.gz
podman-f22791aec7b4d942872ca21539a44d0375b73949.tar.bz2
podman-f22791aec7b4d942872ca21539a44d0375b73949.zip
Handle hard links in remote builds
Fixes: https://github.com/containers/podman/issues/9893 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/bindings/images/build_unix.go')
-rw-r--r--pkg/bindings/images/build_unix.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/bindings/images/build_unix.go b/pkg/bindings/images/build_unix.go
new file mode 100644
index 000000000..0afb1deb6
--- /dev/null
+++ b/pkg/bindings/images/build_unix.go
@@ -0,0 +1,16 @@
+// +build !windows
+
+package images
+
+import (
+ "os"
+ "syscall"
+)
+
+func checkHardLink(fi os.FileInfo) (devino, bool) {
+ st := fi.Sys().(*syscall.Stat_t)
+ return devino{
+ Dev: uint64(st.Dev),
+ Ino: uint64(st.Ino),
+ }, st.Nlink > 1
+}