Help needed
| From: | Javi - NeoDigit | Date: | Fri, 24 Aug 2001 18:08:13 +0000 |
| Subject: | Help needed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-64302@lists.php.net to get a copy of this message | ||
I'm using copy() and the final owner is "nobody", I'm opening a socket
connection with fsockopen() so I have a validate user.
I want the validated user to be the owner of the new file
That`s de code:
- open the socket
- validate user
- change dir chmod so we can write
- write the file (with "nobody" owner and I need the "user" owner)
- change back dir chmod
- close connection
----------------------------------
$tftp = fsockopen("ftp.dominio.com", 21, $errno, $errstr, 60) or
die("Fallode Conexión");
socket_set_blocking($tftp, false);
fputs($tftp, "user $login\n");
fputs($tftp, "pass $password\n");
$ruta = "/www/".$direc;
fputs($tftp, "SITE chmod 0777 $ruta\n");
copy ("file1.php", "file2.php");
fputs($tftp, "SITE chmod $perm $ruta\n");
sleep(1);
fclose($tftp);
------------------------------------
Thanks for helping
Javi