From owner-freebsd-arch@FreeBSD.ORG Thu Feb 14 18:55:51 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A5051BA; Thu, 14 Feb 2013 18:55:51 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 21DB7739; Thu, 14 Feb 2013 18:55:51 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id AE7D5358C68; Thu, 14 Feb 2013 19:55:49 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 916312848C; Thu, 14 Feb 2013 19:55:49 +0100 (CET) Date: Thu, 14 Feb 2013 19:55:49 +0100 From: Jilles Tjoelker To: Pawel Jakub Dawidek Subject: Re: bindat(2) and connectat(2) syscalls for review. Message-ID: <20130214185549.GA36288@stack.nl> References: <20130213230354.GC1375@garage.freebsd.pl> <20130213232004.GA2522@kib.kiev.ua> <20130213234030.GD1375@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130213234030.GD1375@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2013 18:55:51 -0000 On Thu, Feb 14, 2013 at 12:40:31AM +0100, Pawel Jakub Dawidek wrote: > On Thu, Feb 14, 2013 at 01:20:04AM +0200, Konstantin Belousov wrote: > > On Thu, Feb 14, 2013 at 12:03:54AM +0100, Pawel Jakub Dawidek wrote: > > > http://people.freebsd.org/~pjd/patches/bindconnectat.patch > > > It implements bindat(2) and connectat(2) syscalls that will allow to > > > manage UNIX domain sockets from within capability mode sandbox. > > > They work just like any other *at(2) syscall and their prototypes look > > > like this: > > > int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen); > > > int connectat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen); > > > Where 'fd' is directory descriptor. The only supported socket domain is > > > PF_LOCAL. > > > The audit subsystem was updated to audit the new syscalls properly. > > > Comments and reviews are welcome. > > Looking only at prototypes, I think it is useful to add at last the flags > > argument. The first application of it is for O_CLOEXEC-like flag. > And this flag should be applied to? > Note that those syscalls don't create new descriptors, they operate on > existing descriptors (directory descriptor and socket descriptor) that > should eventually have close-on-exec flag set if required. A flag parameter is a good thing; you may not know yet what you will need it for. Looking through some of the other *at calls, AT_SYMLINK_NOFOLLOW might be interesting. -- Jilles Tjoelker