Unzipping script

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
Boby Dimitrov
Registered User
Posts: 235
Joined: Fri Jul 06, 2001 12:40 pm
Location: Bulgaria
Name: Borislav Dimitrov

Unzipping script

Post by Boby Dimitrov »

Here's the idea... Uploading the unzipped forum files is a pain in the a**. There are about 550 files, total size above 2 megs (latest cvs that is). Most of the places I intend to use the forum won't allow me shell access, so I can just upload the file and unzip it on the remote server.

I was wondering if someone is willing to make up a php script that will unzip/untar/etc an archive, if such thing is possible (i guess it is). And this is an example workflow: user downloads, say, final phpBB2, coming as a tar.gzip archive (or plain zip) to his home pc, user uploads the unzip script and the archive to his hosting space, user runs the script, script unzips the archive, user runs the installer.

Anyone...?
User avatar
SHS`
Former Team Member
Posts: 6615
Joined: Wed Jul 04, 2001 9:13 am
Location: Yellow Beach, Nine Dragons, Hong Kong
Name: Jonathan Stanley
Contact:

Post by SHS` »

I was thinking this just the other day. Should be simple enough, as it can probably use the PHP exec() function.

I was going to have a look at it this weekend, but no doubt will be beaten to it by someone know actually knows how to code in PHP, as opposed to stumbling about with a manual. :D
Jonathan “SHS`” Stanley • 史德信
Image
User avatar
psoTFX
Former Team Member
Posts: 7425
Joined: Tue Jul 03, 2001 8:50 pm

Post by psoTFX »

Remember ... the user/group being used to run the webserver will end up owning the unzipped files (meaning you'll probably not be able to remove them or do much else with them via shell or FTP, anyone else running on the same host could overwrite them, etc.).

It's one heck of a security issue this so ensure you're familiar with how it work out your host. We don't want to see people complaining about phpBB security if anything goes wrong here "nothing to do with us guv" springs to mind :)
User avatar
SHS`
Former Team Member
Posts: 6615
Joined: Wed Jul 04, 2001 9:13 am
Location: Yellow Beach, Nine Dragons, Hong Kong
Name: Jonathan Stanley
Contact:

Post by SHS` »

Oopps, that completely skipped my mind. Of course.... :o

In that case, is there any other way of doing it?? I get quite annoyed at the amount of time it takes to send loads of small files via ftp. It's just so much quicker to send a gziped tarball (or whatever) and unpack it from the shell.
Jonathan “SHS`” Stanley • 史德信
Image
Boby Dimitrov
Registered User
Posts: 235
Joined: Fri Jul 06, 2001 12:40 pm
Location: Bulgaria
Name: Borislav Dimitrov

Post by Boby Dimitrov »

SHS, that's exactly what I meant - sending over 500 files with total size of 2.2 megs is a major time consuming task... Really, is there any workaround for the user privilegies...?
User avatar
paulca
Registered User
Posts: 53
Joined: Fri Sep 07, 2001 7:57 pm
Location: Dublin
Contact:

zip extensions...

Post by paulca »

The potential for being able to upload zip files and unpacking / manipulating them is enormous. ..

have a look on www.php.net ?? But as far as I remember, some sort of zip extensions is needed....
sj26
Registered User
Posts: 447
Joined: Fri Dec 14, 2001 4:06 pm
Location: /dev/cpu/[0-9]+ :D
Contact:

Post by sj26 »

telnet, ssh, etc...
User avatar
paulca
Registered User
Posts: 53
Joined: Fri Sep 07, 2001 7:57 pm
Location: Dublin
Contact:

not..

Post by paulca »

not without shell access...
Boby Dimitrov
Registered User
Posts: 235
Joined: Fri Jul 06, 2001 12:40 pm
Location: Bulgaria
Name: Borislav Dimitrov

Post by Boby Dimitrov »

sj26, if you've read the first paragraph from my first post, you'd know telnet is not an option.

paulca, i've checked all *zip related functions of php, but sadly my php knowledge is not enough to create such script; after all, that's why I'm asking for help.
Gud
Former Team Member
Posts: 597
Joined: Fri Sep 07, 2001 11:02 am

Post by Gud »

Can't you just do the zip-script, and then a chmod script? :?
Pit
Security Consultant
Posts: 2056
Joined: Sat Oct 13, 2001 8:17 pm
Location: kµlt øƒ Ø™
Contact:

Post by Pit »

I don't think so.
Image
super fun rainbow colour sig
Gud
Former Team Member
Posts: 597
Joined: Fri Sep 07, 2001 11:02 am

Post by Gud »

The Black Pit wrote: I don't think so.


Why not?
AlieXai
Registered User
Posts: 157
Joined: Thu Jul 05, 2001 4:47 am

Post by AlieXai »

Because you would be changing mode, not owner...
Locked

Return to “2.0.x Support Forum”