phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

How to change file ownership?


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Mon Jun 07, 2010 9:53 pm 
Post subject: How to change file ownership?

Hi!

I have some files and folders on my FTP account wich have owner 0. icon_eek.gif Some of them have owner friendcc (that is me) and some have 0 (probably nobody). So I can't overwrite them or delete them wich isn't good.
A temporary solution is to rename folder woned by this 0 dude and create a new folder with the corect name and upload to that one. But not a very good solution since would not be easy to copy over half my files and folders, especially since I am not able to delete the original ones.

Any ideas (besides contacting server administrator)?
Thanks!
Daniel

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Wed Jun 09, 2010 7:07 am 
Post subject: Re: How to change file ownership?

Hi Daniel,

it might be that owner 0 is a script-upload.
For example if you upload files with php (attachment mod).
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Jun 09, 2010 1:27 pm 
Post subject: Re: How to change file ownership?

It could be. In some folder I have files with long names wich begin with .pureftpd-upload.
The server's hard disk burned a month or two ago and when the server administrator restored my files is possible that he used some script.
But I have the main account. Isn't there some trick to change ownership? icon_sad.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Thu Jun 10, 2010 6:08 am 
Post subject: Re: How to change file ownership?

Contact the server administrator. I don't know why you're avoiding that, because it's probably the best thing to do in this situation.
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Sat Jun 12, 2010 9:50 am 
Post subject: Re: How to change file ownership?

I am avoiding because he's free hosting me... Everyone else has to pay. Also, he was dissapointed when finding some hacking tools uploaded by me. icon_redface.gif
Now I'm ashamed by bothering him too much, He's free hosting me for about 3 years and even payed for my domains because I don't have a credit card.

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sat Jun 12, 2010 4:01 pm 
Post subject: Re: How to change file ownership?

Hacking tools? Sounds interesting indeed! icon_mrgreen.gif
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Tue Jun 15, 2010 6:06 pm 
Post subject: Re: How to change file ownership?

Ownership of files may only be changed by the super-user (root).

If you are root, use the chown command.

Quote:
0 (probably nobody).
The root user ID is 0.
_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
Slackervaara
Board Member



Joined: 01 Jan 2009

Posts: 70



PostPosted: Wed Jun 16, 2010 6:05 am 
Post subject: Re: How to change file ownership?

I have seen that some uses scripts to change ownership of files.
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Sat Jul 10, 2010 11:22 am 
Post subject: Re: How to change file ownership?

I've tryed a script, but did only worse. icon_sad.gif
The script is called "cleanup.php":
Code:
<?php

/**
* This file attempts to recursively make all files in the parent directory
* (i.e. the singapore root directory) writable. This will,  in general,  only
* succeed on server-owned content hence making it deletable by FTP users.
*
* @author Tamlyn Rhodes <tam at zenology dot co dot uk>
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License
* @copyright (c)2004 Tamlyn Rhodes
* @version $Id: cleanup.php, v 1.2 2004/10/11 05:25:18 tamlyn Exp $
*/

/**
* Recursively attempts to make all files and directories in $dir writable
*
* @param string  full directory name (must end with /)
*/
function makeWritable($dir)
{
  if (is_dir($dir)) {
    $d = dir($dir);
    while (($file = $d->read()) !== false) {
      if ($file == '.' || $file == '..') continue;
      $fullfile = $d->path . $file;
      if(@chmod($fullfile, 0777))
        echo "Made $fullfile writable.<br />";
      if (is_dir($fullfile))
        makeWritable($fullfile."/");
    }
  }
}



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>cleanup script</title>
<link rel="stylesheet" type="text/css" href="tools.css" />
</head>

<body>

<h1>cleanup script</h1>

<p><?php
  //start with parent directory (singapore root)
  makeWritable("../");
?></p>

<p>All operations complete. <a href="index.html">Return</a> to tools.</p>

</body>
</html>

I thought it would ask me what directory I want to change persmisions, but it didn't, it just made all my directorys in the public_html folder writable. Now I', changing them back.
I am very dissapointed about who created this. icon_sad.gif

LATER EDIT: I guess I'ved changed them back, at least the ones from public_html, but now I get an error. When I go to Admin Panel, it gives me that annoying 500 - Internal Server Error. icon_cry.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0204 seconds using 15 queries. (SQL 0.0023 Parse 0.0006 Other 0.0175)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo