| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "debug.h" | 5 #include "debug.h" |
| 6 #include "sandbox_impl.h" | 6 #include "sandbox_impl.h" |
| 7 | 7 |
| 8 namespace playground { | 8 namespace playground { |
| 9 | 9 |
| 10 long Sandbox::sandbox_ioctl(int d, int req, void *arg) { | 10 long Sandbox::sandbox_ioctl(int d, int req, void *arg) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 die("Failed to read parameters for ioctl() [process]"); | 41 die("Failed to read parameters for ioctl() [process]"); |
| 42 } | 42 } |
| 43 int rc = -EINVAL; | 43 int rc = -EINVAL; |
| 44 switch (ioctl_req.req) { | 44 switch (ioctl_req.req) { |
| 45 case TCGETS: | 45 case TCGETS: |
| 46 case TIOCGWINSZ: | 46 case TIOCGWINSZ: |
| 47 SecureMem::sendSystemCall(threadFdPub, false, -1, mem, __NR_ioctl, | 47 SecureMem::sendSystemCall(threadFdPub, false, -1, mem, __NR_ioctl, |
| 48 ioctl_req.d, ioctl_req.req, ioctl_req.arg); | 48 ioctl_req.d, ioctl_req.req, ioctl_req.arg); |
| 49 return true; | 49 return true; |
| 50 default: | 50 default: |
| 51 std::cerr << "Unsupported ioctl: 0x" << std::hex << ioctl_req.req << | 51 if (Debug::isEnabled()) { |
| 52 std::endl; | 52 char buf[80]; |
| 53 sprintf(buf, "Unsupported ioctl: 0x%04X\n", ioctl_req.req); |
| 54 Debug::message(buf); |
| 55 } |
| 53 SecureMem::abandonSystemCall(threadFd, rc); | 56 SecureMem::abandonSystemCall(threadFd, rc); |
| 54 return false; | 57 return false; |
| 55 } | 58 } |
| 56 } | 59 } |
| 57 | 60 |
| 58 } // namespace | 61 } // namespace |
| OLD | NEW |