Writing to outside directory

Discussion in 'General' started by Ventzy, Nov 14, 2011.

  1. Ventzy

    Ventzy New Member

    I have web site with user web1:client1 and directory /usr/local/app/uploads/images with owner myuser:myuser. In this web site there is upload form, which must write images to /usr/local/app/uploads/images.

    As I prefer to keep all files under websites directory, from application's point of view, I created symlink /usr/local/app/uploads -> /var/www/clients/client1/web1/web/uploads, and make script write to /var/www/clients/client1/web1/web/uploads/images.

    If the original dir /usr/local/app/uploads have 777 rights, it works. As I don't want this, I added the user web1 to the group myuser and change rights to 775. But it does not works (no write permissions).

    Code:
    # groups web1
    web1 : client1 myuser sshusers
    In the script I tried to write file in the original /usr/local/app/uploads/images directory directly, but it does not work either.

    Any ideas?

    In shell, I tired to swith user to web1 and try to write file manually, but when execute "su web1" logged as root, nothing happens - the console continues to show root as logged. If execute "su web1" logged as "myuser", I have prompted for password, which I don't know.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Check that you added the path /usr/local/app/uploads/images to the open_basedirs of this website, separated by :

    2) run:

    chown web1:client1 /usr/local/app/uploads

    If another user should access the files in that directory, then add this user to the client1 group.

    This test can not work, as the user web1 has no password and no shell, so it can not be used to login on the shell.
     

Share This Page