From 63b1e84727a2b90f1b0204d33eb99fe0c3aa8155 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 9 Nov 2015 09:05:09 +0000 Subject: [PATCH] MFstable/10 r290591: MFC r289899: Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field Bug 203648 Submitted by: Thomas Schmitt Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division git-svn-id: svn://svn.freebsd.org/base/stable/9@290593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/makefs/cd9660/iso9660_rrip.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index 5382857c6..749747ba5 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,13 +656,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *pn_field, fsnode *fnode) pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_dev) > 32) - cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, + if (sizeof (fnode->inode->st.st_rdev) > 4) + cd9660_bothendian_dword( + (uint64_t)fnode->inode->st.st_rdev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } -- 2.45.0