FreeBSD Bugzilla – Attachment 122800 Details for
Bug 166056
[patch][bin] find(1) fails with .: permission denied, even when using absolute paths
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.56 KB, created by
Matthew Story
on 2012-03-13 19:10:03 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Matthew Story
Created:
2012-03-13 19:10:03 UTC
Size:
1.56 KB
patch
obsolete
>Index: function.c >=================================================================== >--- function.c (revision 232929) >+++ function.c (working copy) >@@ -644,7 +644,8 @@ > /* NOTREACHED */ > case 0: > /* change dir back from where we started */ >- if (!(plan->flags & F_EXECDIR) && fchdir(dotfd)) { >+ if (!(plan->flags & F_EXECDIR) && !(ftsoptions&FTS_NOCHDIR) >+ && fchdir(dotfd)) { > warn("chdir"); > _exit(1); > } >Index: find.c >=================================================================== >--- find.c (revision 232929) >+++ find.c (working copy) >@@ -179,7 +179,7 @@ > > tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL)); > if (tree == NULL) >- err(1, "ftsopen"); >+ err(1, "fts_open"); > > for (rval = 0; (entry = fts_read(tree)) != NULL;) { > if (maxdepth != -1 && entry->fts_level >= maxdepth) { >Index: main.c >=================================================================== >--- main.c (revision 232929) >+++ main.c (working copy) >@@ -63,7 +63,7 @@ > > time_t now; /* time find was run */ > int dotfd; /* starting directory */ >-int ftsoptions; /* options for the ftsopen(3) call */ >+int ftsoptions; /* options for the fts_open(3) call */ > int isdeprecated; /* using deprecated syntax */ > int isdepth; /* do directories on post-order visit */ > int isoutput; /* user specified output operator */ >@@ -150,8 +150,10 @@ > usage(); > *p = NULL; > >- if ((dotfd = open(".", O_RDONLY, 0)) < 0) >- err(1, "."); >+ if ((dotfd = open(".", O_RDONLY, 0)) < 0) { >+ warn("."); >+ ftsoptions |= FTS_NOCHDIR; >+ } > > exit(find_execute(find_formplan(argv), start)); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 166056
:
122800
|
122801