From f467e6fb55e715a0da64a29d216372cfaf9d4943 Mon Sep 17 00:00:00 2001 From: John Sonnenschein Date: Tue, 9 Sep 2008 17:44:53 -0700 Subject: 6746142 find(1) fails to correctly strip path names when given the -acl flag 6395580 find(1): -xattr and -acl confused when -exec is present --- usr/src/cmd/find/find.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr/src/cmd/find/find.c b/usr/src/cmd/find/find.c index df319b5a6e..d8449c85a4 100644 --- a/usr/src/cmd/find/find.c +++ b/usr/src/cmd/find/find.c @@ -23,7 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -974,7 +973,8 @@ struct FTW *state; val = 1; break; case XATTR: - filename = gettail(name); + filename = (walkflags & FTW_CHDIR) ? + gettail(name) : name; val = (pathconf(filename, _PC_XATTR_EXISTS) == 1); break; case ACL: @@ -983,8 +983,9 @@ struct FTW *state; * already chdir()ed into the directory (performed in * nftw()) of the file */ - filename = gettail(name); - val = acl_trivial(name); + filename = (walkflags & FTW_CHDIR) ? + gettail(name) : name; + val = acl_trivial(filename); break; } /* -- cgit v1.2.3