From owner-p4-projects@FreeBSD.ORG Mon Jul 27 11:27:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 36A171065675; Mon, 27 Jul 2009 11:27:10 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA8F7106564A for ; Mon, 27 Jul 2009 11:27:09 +0000 (UTC) (envelope-from jona@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BE3758FC1B for ; Mon, 27 Jul 2009 11:27:09 +0000 (UTC) (envelope-from jona@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RBR92P062171 for ; Mon, 27 Jul 2009 11:27:09 GMT (envelope-from jona@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6RBR9g1062169 for perforce@freebsd.org; Mon, 27 Jul 2009 11:27:09 GMT (envelope-from jona@FreeBSD.org) Date: Mon, 27 Jul 2009 11:27:09 GMT Message-Id: <200907271127.n6RBR9g1062169@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jona@FreeBSD.org using -f From: Jonathan Anderson To: Perforce Change Reviews Cc: Subject: PERFORCE change 166608 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 11:27:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=166608 Change 166608 by jona@jona-trustedbsd-belle-vmware on 2009/07/27 11:26:10 Added a little text editor Affected files ... .. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/TextEditor.cpp#1 add .. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/TextEditor.h#1 add .. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/TextEditor.qrc#1 add .. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/sandbox_qt.cpp#7 edit .. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/sandbox_qt.pro#4 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/sandbox_qt.cpp#7 (text+ko) ==== @@ -59,6 +59,8 @@ #include #include +#include + #include #include #include @@ -67,7 +69,8 @@ #include #include -#include +#include "TextEditor.h" + using namespace std; @@ -245,7 +248,7 @@ printf("\n"); printf("======================================\n"); fflush(stdout); - sleep(1); + QMessageBox::information(NULL, "Host", "This is on the host"); return 0; @@ -254,10 +257,11 @@ extern "C" int cap_main(int argc, char *argv[]) { + sleep(1); + printf("sandbox:\tIn sandbox: %i\n", ld_insandbox()); fflush(stdout); - printf("sandbox:\tOpening /etc/passwd directly... "); fflush(stdout); @@ -371,13 +375,7 @@ - // start QApplication - printf("sandbox:\tCreating QApplication...\n"); - fflush(stdout); - QApplication app(argc, argv); - printf("sandbox:\tQApplication started.\n"); - // now test file opening int fd = ua_open("/etc/passwd", O_RDONLY); if(fd < 0) err(EX_IOERR, "Error opening passwd via angel"); @@ -407,20 +405,29 @@ if(!group.open(QIODevice::ReadOnly | QIODevice::Text)) err(EX_IOERR, "Error opening /etc/group"); + printf("\t\tsize: %lli\n", group.size()); printf("\t\t%s\n", group.readLine().data()); fflush(stdout); - + + - printf("sandbox:\tDisplaying message box...\n"); + // start QApplication + printf("sandbox:\tCreating QApplication...\n"); fflush(stdout); - QMessageBox::information(NULL, "Sandbox", "This is sandboxed"); - printf("sandbox:\tMessage box closed\n"); - fflush(stdout); + QApplication app(argc, argv); + printf("sandbox:\tQApplication started.\n"); + + + // display a proper window + new TextEditor(); + int ret = app.exec(); + printf("sandbox:\tQApplication::exec() returned with code %i\n", ret); + fflush(stdout); - return 0; + return ret; } ==== //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/sandbox_qt.pro#4 (text+ko) ==== @@ -9,5 +9,7 @@ QMAKE_LFLAGS += -rdynamic # Input -SOURCES += sandbox_qt.cpp xcb_auth.c +HEADERS = TextEditor.h +SOURCES = sandbox_qt.cpp TextEditor.cpp xcb_auth.c +RESOURCES = TextEditor.qrc