server: Try writing to /proc/<pid>/mem in write_process_memory().

This commit is contained in:
Henri Verbeet 2011-09-21 21:01:43 +02:00 committed by Alexandre Julliard
parent a684b634c0
commit e7728c4132
1 changed files with 19 additions and 0 deletions

View File

@ -463,6 +463,25 @@ int write_process_memory( struct process *process, client_ptr_t ptr, data_size_t
set_error( STATUS_ACCESS_DENIED ); set_error( STATUS_ACCESS_DENIED );
goto done; goto done;
} }
if (len > 3)
{
char procmem[24];
int fd;
sprintf( procmem, "/proc/%u/mem", process->unix_pid );
if ((fd = open( procmem, O_WRONLY )) != -1)
{
ssize_t r = pwrite( fd, src, size, ptr );
close( fd );
if (r == size)
{
ret = 1;
goto done;
}
}
}
/* first word is special */ /* first word is special */
if (len > 1) if (len > 1)
{ {