icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Coding and Programming » files and directories owned by the nobody account

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old April 15th, 2005, 10:25 AM   #1 (permalink)
Destroyer of Evil Robots
Excelling Contributor
 
tch3's Avatar
 
Joined in Oct 2003
Lives in Atlanta, GA
760 posts
Gave thanks: 17
Thanked 9 times
files and directories owned by the nobody account

I've seen a couple of differnent installations of some packages from Fantastico which will create files and directories owned by the nobody account.

This is one example, I installed drupal and the $DRUPAL/files/pictures directory is owned by nobody and permissions are set to 700. This creates a problem; I uninstalled drupal and it left behind those directories and I am unable to delete them.

I have written support to assist me in getting rid of the no longer needed files/directories. However, I was curious is that ownership/permissions set absolutely necessary? Perhaps at the install, the directory ownership should be set to the account holder and make those permissions 1777 instead? Or maybe there should be a tool somewhere we can run to reset those permissions so we can remove the files as needed.

Clair
tch3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 15th, 2005, 11:19 AM   #2 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
[php]
<?php
rmdir( './dirname/' );
?>
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 15th, 2005, 11:32 AM   #3 (permalink)
Destroyer of Evil Robots
Excelling Contributor
 
tch3's Avatar
 
Joined in Oct 2003
Lives in Atlanta, GA
760 posts
Gave thanks: 17
Thanked 9 times
Thanks, that worked like a charm. I have no idea if there were any files in the directory. Will that work if the directory's not empty?

Clair
tch3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 15th, 2005, 11:53 AM   #4 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
PHP Code:
<?php
function delDir($dirName) {
   if(empty(
$dirName)) {
       return 
true;
   }
   if(
file_exists($dirName)) {
       
$dir dir($dirName);
       while(
$file $dir->read()) {
           if(
$file != '.' && $file != '..') {
               if(
is_dir($dirName.'/'.$file)) {
                   
delDir($dirName.'/'.$file);
               } else {
                   @
unlink($dirName.'/'.$file) or die('File '.$dirName.'/'.$file.' couldn\'t be deleted!');
               }
           }
       }
       
$dir->close();
       @
rmdir($dirName) or die('Folder '.$dirName.' couldn\'t be deleted!');
   } else {
       return 
false;
   }
   return 
true;
}
?>
no, but that will.
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 15th, 2005, 12:07 PM   #5 (permalink)
Destroyer of Evil Robots
Excelling Contributor
 
tch3's Avatar
 
Joined in Oct 2003
Lives in Atlanta, GA
760 posts
Gave thanks: 17
Thanked 9 times
Great! Thanks!

Now, I hate to be a totally dummy ( I know less than nothing about php. ), but where do I feed this script the directory name to be removed?

Clair
tch3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On