Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Unified Diff: remoting/host/x_server_pixel_buffer.cc

Issue 10854241: Make shared memory segment writable only by its rightful owner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/x_server_pixel_buffer.cc
===================================================================
--- remoting/host/x_server_pixel_buffer.cc (revision 155390)
+++ remoting/host/x_server_pixel_buffer.cc (working copy)
@@ -121,7 +121,7 @@
if (x_image_) {
shm_segment_info_->shmid = shmget(
IPC_PRIVATE, x_image_->bytes_per_line * x_image_->height,
- IPC_CREAT | 0666);
+ IPC_CREAT | 0600);
if (shm_segment_info_->shmid != -1) {
shm_segment_info_->shmaddr = x_image_->data =
reinterpret_cast<char*>(shmat(shm_segment_info_->shmid, 0, 0));
@@ -131,12 +131,19 @@
XSync(display_, False);
if (GetLastXServerError() != 0)
using_shm = false;
+ if (using_shm) {
+ VLOG(1) << "Using X shared memory segment "
+ << shm_segment_info_->shmid;
+ }
}
+ } else {
+ LOG(WARNING) << "Failed to get shared memory segment. "
+ "Performance may be degraded.";
}
}
if (!using_shm) {
- VLOG(1) << "Not using shared memory.";
+ LOG(WARNING) << "Not using shared memory. Performance may be degraded.";
Release();
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698