From f6752e7927b3a40f01d45eb4e81ded3a63682fd0 Mon Sep 17 00:00:00 2001 From: Jingkui Wang Date: Thu, 8 Nov 2018 10:47:42 -0800 Subject: devices: add on_sandboxed On sandboxed will be invoked when the device is sandboxed. Device implementation could do initialization here. It does not need to return fd opened here to keep fds. BUG=None TEST=local build and run Change-Id: I42c2b3cae3a87dd54f02e77b8cd10766309a0770 Reviewed-on: https://chromium-review.googlesource.com/1327513 Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: Jingkui Wang Reviewed-by: David Tolnay Reviewed-by: Zach Reizner --- devices/src/proxy.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'devices/src/proxy.rs') diff --git a/devices/src/proxy.rs b/devices/src/proxy.rs index 5867e58..0b60736 100644 --- a/devices/src/proxy.rs +++ b/devices/src/proxy.rs @@ -143,6 +143,7 @@ impl ProxyDevice { let pid = unsafe { match jail.fork(Some(&keep_fds)).map_err(Error::ForkingJail)? { 0 => { + device.on_sandboxed(); child_proc(child_sock, &mut device); // ! Never returns process::exit(0); -- cgit 1.4.1