/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 2002 Poul-Henning Kamp4* Copyright (c) 2002 Networks Associates Technology, Inc.5* All rights reserved.6*7* This software was developed for the FreeBSD Project by Poul-Henning Kamp8* and NAI Labs, the Security Research Division of Network Associates, Inc.9* under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the10* DARPA CHATS research program.11*12* Redistribution and use in source and binary forms, with or without13* modification, are permitted provided that the following conditions14* are met:15* 1. Redistributions of source code must retain the above copyright16* notice, this list of conditions and the following disclaimer.17* 2. Redistributions in binary form must reproduce the above copyright18* notice, this list of conditions and the following disclaimer in the19* documentation and/or other materials provided with the distribution.20* 3. The names of the authors may not be used to endorse or promote21* products derived from this software without specific prior written22* permission.23*24* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND25* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE26* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE27* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE28* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL29* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS30* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)31* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT32* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY33* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF34* SUCH DAMAGE.35*/3637#include <sys/param.h>38#include <sys/time.h>39#include <sys/stdint.h>4041#include <ufs/ufs/dinode.h>42#include <ufs/ufs/dir.h>43#include <ufs/ffs/fs.h>4445#include <err.h>46#include <string.h>4748#include "fsck.h"4950/*51* Scan each entry in an ea block.52*/53int54eascan(struct inodesc *idesc, struct ufs2_dinode *dp)55{56#if 157return (0);58#else59struct bufarea *bp;60u_int n;61u_char *cp;62long blksiz;6364printf("Inode %ju extsize %ju\n",65(intmax_t)idesc->id_number, (uintmax_t)dp->di_extsize);66if (dp->di_extsize == 0)67return 0;68if (dp->di_extsize <= sblock.fs_fsize)69blksiz = sblock.fs_fsize;70else71blksiz = sblock.fs_bsize;72bp = getdatablk(dp->di_extb[0], blksiz, BT_EXTATTR);73if (bp->b_errs)74return (STOP);75printf("blksiz = %ju\n", (intmax_t)blksiz);76cp = (u_char *)bp->b_un.b_buf;77for (n = 0; n < blksiz; n++) {78printf("%02x", cp[n]);79if ((n & 31) == 31)80printf("\n");81}82brelse(bp);83return (STOP);84#endif85}868788