Jump to content


Photo

new directory on cifs share permission problem


  • Please log in to reply
1 reply to this topic

#1 warnockm

warnockm
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 22 September 2006 - 08:29 PM

I have a very odd problem, but i'm sure the members of phpfreaks can help.  I have a linux server running PHP 5.1.  I mounted a windows filesharing using cifs.  The mounted directory is owned by www, my web service user.  I'm using PHP to create a directory (mkdir($dir, 0777) on the share and store files in there.  When i write them, i get a file permission error.  When i look at the permssions, i see it is own by root, even through it was created by php (www).

drwxr-xr-x 2 root root 0 Sep 22 16:11 new_dir

I understand why its not writable.  www can't write to this.  However, the interesting thing is, when i run the script again, and it doens't have to create the directory, the files store.  after the second run, the permissons change to:

drwxrwxrwx 1 root root 0 Sep 22 16:26 new_dir

Also, the colors in bash change to green/white, and dircolors say its: "STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)"

Why is it creating a directory owned by root.  and then why do the permissions change?  I'm doing nothing to change the permissions.  i just check if the dir exists, create it if it doesn't, and write files to the new dir.  Is it something w/ the way i mount the share?

thanks!

#2 warnockm

warnockm
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 25 September 2006 - 02:29 AM

no one has been replying on here.  Is it me or my questions??????




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users