Module Name: src Committed By: reinoud Date: Tue Apr 26 14:59:37 UTC 2022
Modified Files: src/usr.sbin/makefs: udf.c Log Message: Fix endian bug that resulted in UniqueIDs of 0 in file identifiers; note that the the unique ID in a longad stored in a FID is 32 bit where in the file descriptor (fe/efe) its 64 bits long. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/makefs/udf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/makefs/udf.c diff -u src/usr.sbin/makefs/udf.c:1.27 src/usr.sbin/makefs/udf.c:1.28 --- src/usr.sbin/makefs/udf.c:1.27 Tue Apr 26 13:27:24 2022 +++ src/usr.sbin/makefs/udf.c Tue Apr 26 14:59:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: udf.c,v 1.27 2022/04/26 13:27:24 reinoud Exp $ */ +/* $NetBSD: udf.c,v 1.28 2022/04/26 14:59:37 reinoud Exp $ */ /* * Copyright (c) 2006, 2008, 2013, 2021, 2022 Reinoud Zandijk @@ -30,7 +30,7 @@ #endif #include <sys/cdefs.h> -__RCSID("$NetBSD: udf.c,v 1.27 2022/04/26 13:27:24 reinoud Exp $"); +__RCSID("$NetBSD: udf.c,v 1.28 2022/04/26 14:59:37 reinoud Exp $"); #include <stdio.h> #include <stdlib.h> @@ -666,13 +666,13 @@ udf_create_new_file(struct stat *st, uni if (error) errx(error, "can't create fe"); *dscr = (union dscrptr *) fe; - icb->longad_uniqueid = fe->unique_id; + icb->longad_uniqueid = udf_rw32(udf_rw64(fe->unique_id)); } else { error = udf_create_new_efe(&efe, filetype, st); if (error) errx(error, "can't create fe"); *dscr = (union dscrptr *) efe; - icb->longad_uniqueid = efe->unique_id; + icb->longad_uniqueid = udf_rw32(udf_rw64(efe->unique_id)); } return 0;