LxCenter HyperVM & Kloxo Support

Forum



Members   Search      Help    Register    Login    Home
Home » LxCenter » LxCenter Announcements » Fix for Unzipping in file manager.
Fix for Unzipping in file manager. [message #47422] Mon, 24 November 2008 14:21 Go to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion

Lxadmin/HyperVM's file manager's unzipping code had an issue. It would unzip as root, and then chown the files to the particular user's ownership. This would work fine as long as the user was properly chrooted to his directory, but in the rare chance that user breaks out of his chroot, the unzip can be potential security hazard.

Now, unzip is 100% failsafe. The file manager now forks and creates a new process. In the new process it setuid to that particular user, and only then will it unzip the file. This means there is absolutely no way the it can cause any problem.

The reason why it was done the old way was that Windows does not have fork and setuid functions, and since the unzip function was shared between windows and Linux, it was not possible to implement it the proper way. Now, the file manager has separate code for unzipping in windows and linux and it will do it the right way on both OSes.

thanks.




Re: Fix for Unzipping in file manager. [message #48744 is a reply to message #47422] Wed, 03 December 2008 13:21 Go to previous messageGo to next message
com2 is currently offline com2  Spain
Messages: 1119
Registered: August 2007
Location: Spain
Senior Master
Developer
Lxhelp wrote on Tue, 25 November 2008 00:21


Now, the file manager has separate code for unzipping in windows and linux and it will do it the right way on both OSes.


Does that mean you could now implement tar.gz support to have further compatibility with Cpanel? Using zip was originally because of Windows compatibility, but I don't understand that really. I use WinRAR already for years and it perfectly supports both unpacking tar.gz and zip. Could you consider supporting both in file manager?
Re: Fix for Unzipping in file manager. [message #48746 is a reply to message #48744] Wed, 03 December 2008 13:30 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
I second that

Dragomir Denev
DGM
www.dgm.bg
Re: Fix for Unzipping in file manager. [message #48748 is a reply to message #48746] Wed, 03 December 2008 13:39 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
The file manager is 100% transparent. It automatically recognizes tgz or zip, and will do accordingly. It doesn't recognize tar.gz at present, since it contains 2 extensions.

tgz and zip are recognized.


On Wed, Dec 03, 2008 at 06:30:38PM -0000, Dragomir Denev wrote:
>
>
> I second that
> --
> Dragomir Denev
> DGM
> http://www.dgm.bg
>


Re: Fix for Unzipping in file manager. [message #48751 is a reply to message #48748] Wed, 03 December 2008 13:41 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
so do you say that you will make it recognize tar.gz soon?

Dragomir Denev
DGM
www.dgm.bg
Re: Fix for Unzipping in file manager. [message #48753 is a reply to message #47422] Wed, 03 December 2008 13:46 Go to previous messageGo to next message
com2 is currently offline com2  Spain
Messages: 1119
Registered: August 2007
Location: Spain
Senior Master
Developer
Isn't it sufficient to just transparently rename tar.gz to tgz, either automatically in the script or us manually? I can live with manual renaming. But some might not know (like me) that tar.gz and tgz are the same.
Re: Fix for Unzipping in file manager. [message #48757 is a reply to message #48751] Wed, 03 December 2008 13:58 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
It is not File manager's fault. PHP's core function that splits the file name will give the extension as .gz rather than .tar.gz.


On Wed, Dec 03, 2008 at 06:41:42PM -0000, Dragomir Denev wrote:
>
>
> so do you say that you will make it recognize tar.gz soon?


Re: Fix for Unzipping in file manager. [message #48758 is a reply to message #48751] Wed, 03 December 2008 14:00 Go to previous message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Actually, the file manager DOES recognize tar.gz.

In fact, you can rename a tar.gz to .zip, and the file manager will recognize that it is a tar and untar it properly. It doesn't rely on the extension but rather uses the magic headers to find out what's the type of archive.


On Wed, Dec 03, 2008 at 06:41:42PM -0000, Dragomir Denev wrote:
>
>
> so do you say that you will make it recognize tar.gz soon?


Previous Topic:Proper update success messages.
Next Topic:Tree View on the Left Panel.
Goto Forum:
  


Current Time: Mon May 20 20:49:33 EDT 2013

Total time taken to generate the page: 0.01163 seconds
.:: Contact :: Home :: Privacy ::.

Click here to lend your support to: LxCenter and make a donation at www.pledgie.com !

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software