Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I am running a routine su'd to another user that does not have access to $PWD.

The other user *does* have full rwx access to *all* the directories in the @directories_to_search list.

However, I keep getting the error:
Can't cd to /home/present_working_directory: Permission denied

The error seems to occur *after* the first run through \&wanted. So, it seems like it is trying to go (back?) to $PWD after it finishes going through \&wanted.

Note this error goes away if I run the routine from *any* directory that the su'd user can chdir to (even if that direcotry has nothing to do with the search list).

Am I missing something obvious here?

Note: I would prefer not to have to use the no_chdir option since I do want to chdir to directories where files are indeed found.

I tried googling but didn't find anything on this.


In reply to Why does File::Find try to chdir to $PWD (and fail) even if $PWD is not itself in search list? by puterboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-19 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found