From owner-freebsd-questions@freebsd.org Tue Apr 25 18:02:24 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 213ACD50626 for ; Tue, 25 Apr 2017 18:02:24 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay13.qsc.de (mailrelay13.qsc.de [212.99.187.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87FE1198D for ; Tue, 25 Apr 2017 18:02:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay13.qsc.de; Tue, 25 Apr 2017 20:02:19 +0200 Received: from r56.edvax.de (port-92-195-211-20.dynamic.qsc.de [92.195.211.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 22CE93CC5C; Tue, 25 Apr 2017 20:02:18 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v3PI2IBm003145; Tue, 25 Apr 2017 20:02:18 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 25 Apr 2017 20:02:18 +0200 From: Polytropon To: Manish Jain Cc: "freebsd-questions@freebsd.org" Subject: Re: Is it possible to enforce noexec for Wine on ntfs partition ? Message-Id: <20170425200218.cbbf375c.freebsd@edvax.de> In-Reply-To: References: <20170425192117.c1b04abc.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay13.qsc.de with 590316901A8 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1419 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 18:02:24 -0000 On Tue, 25 Apr 2017 17:37:59 +0000, Manish Jain wrote: > On Tue, Apr 25, 2017 at 10:51 PM, Polytropon wrote: > Note that I cannot enable this behavior with '-o noexec' : that only disables execution of binaries by the kernel itself, not the emulation layer - which just needs read access. > Correct. "Windows" programs aren't executed in a manner that it would be triggered by the -noexec mechanism. > > > Hi Poly/others, > > But it should be possible to make this a configurable option for > emulators/wine and emulators/i386-wine. For volumes mounted with > noexec passed to ntfs-3g/fuse, Wine honours that the noexec > behaviour everywhere under the volume. That makes good sense to me. Maybe a "wrapper" that calls wine could implement this specific check? When the "executable" resides in a volume where noexec is enabled, wine (the program which is actually executed) will refuse to load the "Windows" program. It could use the following approach: 1. determine full path of argument given to wine 2. grep in `mount -v` for path, then for "noexec" 3. if it's set, print an error message, else call wine Just an idea. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...