|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
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
|
|
|
|
Joined: Aug 2000
Posts: 335
Member
|
Member
Joined: Aug 2000
Posts: 335 |
How about posting a section of code which includes line 744? Even if there's nothing wrong with the code, it might provide a clue, or suggest where to look for more info.
|
|
|
|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
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
|
|
|
|
Joined: Aug 2000
Posts: 335
Member
|
Member
Joined: Aug 2000
Posts: 335 |
Actually, I wanted to see several lines of the surrounding code, maybe lines 739-749.
|
|
|
|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
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
|
|
|
|
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?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
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
|
|
|
|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
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
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
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
|
|
|
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.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|