Jump to content

new directory on cifs share permission problem


warnockm

Recommended Posts

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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.