Previous Thread
Next Thread
Print Thread
Rate Thread
#103758 06/06/2002 4:47 AM
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
Moderator / Code Fixer
Offline
Joined: Oct 2000
Posts: 743
Hi, Ive moved a script from my old web host to a new one, all was fine prior to the move. Although now when I try and run the script I get the error
Too many arguments for chdir /www/myfile.cgi at line 744 near ... etc...

I know there is no problem with the script so Im wondering what else could be causing the problem?

Thanks


I can't afford a good signature editor frown
Sponsored Links
#103759 06/06/2002 7:47 AM
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
How about posting a section of code which includes line 744? wink

Even if there's nothing wrong with the code, it might provide a clue, or suggest where to look for more info.

#103760 06/06/2002 5:23 PM
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
Moderator / Code Fixer
Offline
Joined: Oct 2000
Posts: 743
Sure here you go dave, thanks

Too many arguments for chdir at /root/www/Bass/Image/image.cgi line 744, near ""$image_dir/$in{'I_Select'}")"


I can't afford a good signature editor frown
#103761 06/06/2002 7:30 PM
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
Actually, I wanted to see several lines of the surrounding code, maybe lines 739-749.

#103762 06/13/2002 11:06 PM
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
Moderator / Code Fixer
Offline
Joined: Oct 2000
Posts: 743
Its ok, dave, after pulling my hair out, Ive worked it out.

The code was written like this
chdir(IDIR,"$image_dir/$in{'I_Select'}");

which worked just fine on the server it was previously on.

Now ive just changed it to
chdir("$image_dir/$in{'I_Select'}");

and thats done the trick!

Thanks!


I can't afford a good signature editor frown
Sponsored Links
#103763 06/14/2002 8:19 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
quote:
Originally posted by BassTeQ:
The code was written like this
chdir(IDIR,"$image_dir/$in{'I_Select'}");

which worked just fine on the server it was previously on.

actually, chdir command format is => chdir( EXPRESSION ) Filehandle has no meaning... Maybe it was an old Perl version or something?

#103764 06/14/2002 9:53 AM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
quote:

Now ive just changed it to
chdir("$image_dir/$in{'I_Select'}");

If that %in hash is what I think it is (hash containing user's form submitted data) then you'd best make sure you've untainted the data in it, otherwise that chdir line right there will be one massive security hole for you.

Never pass something through to system operations unless the data has been thouroughly checked first.


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#103765 06/15/2002 3:40 AM
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
Moderator / Code Fixer
Offline
Joined: Oct 2000
Posts: 743
Thanks for the tips guys, its for a local intranet, not available to the public so security isnt a major issue. But thanks for the suggestions!

I think it may have been an older version of perl on the other system, which possibly suppored the FILDHANDLE as part of the expression?

Cheers


I can't afford a good signature editor frown
#103766 06/15/2002 12:25 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Security is ALWAYS a major issue. ALWAYS.


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)