Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Warning: getmypid has been disabled  (Read 30145 times)

0 Members and 1 Guest are viewing this topic.

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Warning: getmypid has been disabled
« on: June 12, 2004, 01:22:38 am »

When I try to upload files I gt the following errors returbed:
In the header:
---------------------------------------
Warning: getmypid, getmyuid, getmygid, getopt, getrusage, assert_options, assert, dl, mysql_pconnect, shell_exec, phpinfo() has been disabled for security reasons in /home/content/t/u/r/turtleboy212/html/foto/foto-gallery/upload.php on line 1182
---------------------------------------

In the body
---------------------------------------
Warning: getmypid, getmyuid, getmygid, getopt, getrusage, assert_options, assert, dl, mysql_pconnect, shell_exec, phpinfo() has been disabled for security reasons in /home/content/t/u/r/turtleboy212/html/foto/foto-gallery/upload.php on line 497

Warning: getmypid, getmyuid, getmygid, getopt, getrusage, assert_options, assert, dl, mysql_pconnect, shell_exec, phpinfo() has been disabled for security reasons in /home/content/t/u/r/turtleboy212/html/foto/foto-gallery/upload.php on line 497

Warning: getmypid, getmyuid, getmygid, getopt, getrusage, assert_options, assert, dl, mysql_pconnect, shell_exec, phpinfo() has been disabled for security reasons in /home/content/t/u/r/turtleboy212/html/foto/foto-gallery/upload.php on line 497
---------------------------------------

The File is still uploaded though, and when I got tot the next page (naming and putting  description),
it returns this error in the header:
---------------------------------------
Warning: getmypid, getmyuid, getmygid, getopt, getrusage, assert_options, assert, dl, mysql_pconnect, shell_exec, phpinfo() has been disabled for security reasons in /home/content/t/u/r/turtleboy212/html/foto/foto-gallery/upload.php on line 2387
---------------------------------------

The file upload and everything else is successful, I'm just thinking the program is trying to pull some information my server won't allow. Since my site is hosted by another company, I'm pretty sure I can't change anything server-side.. so is there anything I can edit in the upload.php safely to remove these ugly warnings?

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Re: Server Warning when thrying to upload files
« Reply #1 on: June 12, 2004, 01:56:14 am »

Your host has disabled getmypid, which is used to get the thread's process number from the server (as no two users can have the same process number at the same time).  This is combined with the time to create a unique identifying string for temporary files.

You can try substituting mt_rand(0, 32000) for getmypid.

The relevant code on 497 and 1182 will look like this:

Code: [Select]
        $unique_ID = substr(md5(microtime().getmypid()), 0, 8);

Change it to:

Code: [Select]
        $unique_ID = substr(md5(microtime().mt_rand(0, 32000)), 0, 8);

If you are using less than PHP 4.2, you will need to make it look like this:

Code: [Select]
        mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);
        $unique_ID = substr(md5(microtime().mt_rand(0, 32000)), 0, 8);

Please report if this is helpful to you. 
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Re: Warning: getmypid has been disabled
« Reply #2 on: June 12, 2004, 02:41:01 am »

Ok I replaced the code on lines 497, 1182, and 2387 with what you suggested. And everything works fine now.

You might want to add that on lines 1182 and 2387 the code starts with '$seed' instead of '$unique_id'

Thanks for the help.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Warning: getmypid has been disabled
« Reply #3 on: June 17, 2004, 12:31:47 am »

@Hyperion and devs: since many webhosts react on script kiddy attacks against PHP weaknesses with "hardened" policies we might encounter such issues more frequently in the future, so I suggest we might want to consider adding checking routines wether getmypid() has been disabled and use random numbers instead as a fall back.

GauGau
Logged

Pim

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Warning: getmypid has been disabled
« Reply #4 on: September 17, 2004, 07:59:36 pm »

Hi Guys,

I have the same problems, but I am not a whizz kid, so I do not understand a thing in the offered solution. Is there a way to solve this?

Error message:

Warning: getmypid, dl, leak, chgrp() has been disabled for security reasons in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 1186


Warning: getmypid, dl, leak, chgrp() has been disabled for security reasons in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 501


Thanks very much!

Pim.


Logged

Nibbler

  • Guest
Re: Warning: getmypid has been disabled
« Reply #5 on: September 17, 2004, 08:09:38 pm »

You need to download the copy of upload.php from your server, and use a simple text editor eg notepad to find and change

Code: [Select]
        $unique_ID = substr(md5(microtime().getmypid()), 0, 8);

to

Code: [Select]
        $unique_ID = substr(md5(microtime().mt_rand(0, 32000)), 0, 8);

then upload the changed file to your server, overwriting the old one.
Logged

Pim

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Warning: getmypid has been disabled
« Reply #6 on: September 18, 2004, 08:02:24 pm »

Hmm I did this (easy - even for me!!), but it gave me more problems:

Warning: is_dir(): Stat failed for ./albums/edit/. (errno=13 - Permission denied) in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 432

Warning: filemtime(): Stat failed for ./albums/edit/. (errno=13 - Permission denied) in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 440

Warning: unlink(./albums/edit/.): Permission denied in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 453

Warning: is_dir(): Stat failed for ./albums/edit/.. (errno=13 - Permission denied) in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 432

Warning: filemtime(): Stat failed for ./albums/edit/.. (errno=13 - Permission denied) in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 440

Warning: unlink(./albums/edit/..): Permission denied in /data/members/paid/t/o/tocn.info/htdocs/album/upload.php on line 453


This appears when I go to Upload File.
Logged

Nibbler

  • Guest
Re: Warning: getmypid has been disabled
« Reply #7 on: September 18, 2004, 08:06:26 pm »

That is an unrelated problem, please search the board.
Logged

dragonfire

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
upload error (1 of the 1000)
« Reply #8 on: September 30, 2004, 05:12:29 pm »

i've got one anoying error...
i had 3 errors, i searched the forum, lost 2 errors, now i'm stuck with 1 annoying error


Code: [Select]
Warning: getmypid, dl, leak, listen, chown, chmod, chgrp, realpath, tmpfile, link, mb_send_mail() has been disabled for security reasons in /data/members/free/tripod/nl/l/a/u/laurenz/htdocs/upload.php on line 1183
i've searched everywhere...
i used this bit it didn't work for me...

if you say that i have to search the forum, i already did, so help me with searching plz then...

i beg you guys, i hope i can trust you people :)
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Warning: getmypid has been disabled
« Reply #9 on: September 30, 2004, 05:19:45 pm »

Merged with the thread you quoted, although it did not work for you.
Please post problems on the correct board.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

dragonfire

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Warning: getmypid has been disabled
« Reply #10 on: September 30, 2004, 05:42:44 pm »

Merged with the thread you quoted, although it did not work for you.
Please post problems on the correct board.
yeah yeah, plz, just give me one answer!!!
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Warning: getmypid has been disabled
« Reply #11 on: September 30, 2004, 05:49:47 pm »

If I had the answer I would have posted it.  But being frustrated is no excuse for being rude, or not posting in the correct place, where you are most likely to get the help you need in the first place. >:(
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

dragonfire

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Warning: getmypid has been disabled
« Reply #12 on: September 30, 2004, 06:20:33 pm »

If I had the answer I would have posted it. But being frustrated is no excuse for being rude, or not posting in the correct place, where you are most likely to get the help you need in the first place. >:(
ok, srry that i was so mean, but i had hurry :(
i had to go to my guitar lesson...
sorry...i mean this...

but can you help me plz then?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Warning: getmypid has been disabled
« Reply #13 on: September 30, 2004, 06:26:04 pm »

The problem was due to Tripod's settings. Try this:
http://forum.coppermine-gallery.net/index.php?topic=7289.0

If you still have problems, search the board for Tripod and you'll see the various issues with using Tripod.
Logged

dragonfire

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Warning: getmypid has been disabled
« Reply #14 on: September 30, 2004, 08:20:32 pm »

The problem was due to Tripod's settings. Try this:
http://forum.coppermine-gallery.net/index.php?topic=7289.0

If you still have problems, search the board for Tripod and you'll see the various issues with using Tripod.
it won't work...i find to times that sort of text...do i have to change both?
can't you post an working version?
or is it the problem that i use version 1.3.0 and not 1.3.2???

help me!!!
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Warning: getmypid has been disabled
« Reply #15 on: September 30, 2004, 08:33:36 pm »

or is it the problem that i use version 1.3.0 and not 1.3.2???
It might help to use the latest version.
Logged

Nibbler

  • Guest
Re: Warning: getmypid has been disabled
« Reply #16 on: September 30, 2004, 09:46:41 pm »

dragonfire: simply change the code in all occurences as described in upload.php and image_processor.php

Code: [Select]
substr(md5(microtime().getmypid()), 0, 8);becomes
Code: [Select]
substr(md5(uniqid("")), 0, 8);

[note: applied to dev branch.]
Logged

laubert

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
Re: Warning: getmypid has been disabled
« Reply #17 on: June 30, 2005, 01:25:20 pm »

Hi,

I also found the line :
$seed = substr(md5(microtime().getmypid()), 0, 8);
three times in upload.php.

Can I change the three :
substr(md5(microtime().getmypid()), 0, 8)
by
substr(md5(microtime().mt_rand(0, 32000)), 0, 8)

?



Oops, of course there are no smilies but number eight in the file
Thank you. :D
Logged

Nibbler

  • Guest
Re: Warning: getmypid has been disabled
« Reply #18 on: June 30, 2005, 01:31:11 pm »

Yes, you can use any method you like to get a random string.
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.