From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/192 Path: news.gmane.org!not-for-mail From: Vasiliy Kulikov Newsgroups: gmane.linux.lib.musl.general Subject: Re: some fixes to musl Date: Fri, 22 Jul 2011 12:26:06 +0400 Message-ID: <20110722082605.GB3593@albatros> References: <20110721170255.GA7352@albatros> <20110722015739.GC132@brightrain.aerifal.cx> <20110722043021.GE132@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1311323229 532 80.91.229.12 (22 Jul 2011 08:27:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Jul 2011 08:27:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-276-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jul 22 10:27:06 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QkB4c-0001ev-BQ for gllmg-musl@lo.gmane.org; Fri, 22 Jul 2011 10:27:06 +0200 Original-Received: (qmail 18113 invoked by uid 550); 22 Jul 2011 08:27:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18105 invoked from network); 22 Jul 2011 08:27:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=X7XQTON7TwloG3jw7P/Xi33C5cjjTjcxC+IA5ps87vw=; b=sh5ZLbl3htaSLs+faFApVyR6furF2VeyusEXL2QwyVb3TvVJjjxCILcTHGbhWG70Kb CCnU4iLZBXaNepiKc+63sfmT23SjT2dKnY+aBSKHroSPSh5bfruy7yN4G1ZUO0iH9Fh4 Oy+AEaiupuYrg4p4wakz46dfL3fyuLs4spBDg= Original-Sender: Vasiliy Kulikov Content-Disposition: inline In-Reply-To: <20110722043021.GE132@brightrain.aerifal.cx> User-Agent: Mutt/1.5.20 (2009-06-14) Xref: news.gmane.org gmane.linux.lib.musl.general:192 Archived-At: On Fri, Jul 22, 2011 at 00:30 -0400, Rich Felker wrote: > On Thu, Jul 21, 2011 at 09:57:39PM -0400, Rich Felker wrote: > > > forkpty(): > > > - It should be guaranteed that master fd is closed, tty is setup, slave > > > fd is dup'ed to 1,2,3. The latter can be broken by setting small > > > rlimit. setsid() is checked for company :) I think the only way to > > > handle the failure is _exit(). While it may be not the best choise, > > > however, continuing the work with half dropped privileges is more > > > dangerous. > > > > > > openpty(): > > > - close() shouldn't change errno updated by failed ioctl()/open(). > > > - I suppose the last calls to tcsetattr() and ioctl() may fail too. > > > > Going to try to find a good solution for these... > > I believe I've fixed forkpty's issue with fd exhaustion. Please tell > me if anything seems wrong. Looks like it fixes the problem with *expected* dup2() failures. However, I'm still worried about theoretical (*m) leaking... -- Vasiliy