[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #48314] find -type f matches symlinks in armel armhf and mipsel

From: Andreas Metzler
Subject: [bug #48314] find -type f matches symlinks in armel armhf and mipsel
Date: Sat, 25 Jun 2016 10:49:13 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0

Follow-up Comment #1, bug #48314 (project findutils):


this is https://bugs.debian.org/827724 originally submitted by Maximiliano
The new version of find has a weird behaviour, at least in the arches: armhf
armel and mipsel.
As simple test:

dir=$(mktemp -d)
cd $dir
ln -s a b
find -type f

Shows ./b while it shouldn't.

$ find -type l
find: Duplicate file type 'l' in the argument list to -type

Both examples work fine in amd64.

I haven't followed the code thoroughly, but it seems that the type is using a

float to hold a bit mask, maybe this is not so well behaved in all arches.

With the addition of multiple types in one -type option, the args union of the

predicate struct has grown and the new space is not being initialized.
(The initialization of args is done as a args.str = NULL, but args.types is a

bool types[FTYPE_COUNT]; with count being 8, that's 32 bytes vs 4 that are 
currently initialized in a 32 bits arch.

Replacing the xmalloc invocation by a xzalloc one "fixes" the issue as it 
initializes all of the predicate components.

I'm attaching a patch that does this.
This is against GIT head after 6c37ce48a1eb3d1f21a1848cc9c40f2cdb191e88.

(file #37569)

Additional Item Attachment:

File name: replace_xmalloc_with_xzalloc.diff Size:0 KB


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]