From owner-freebsd-questions Mon Jul 31 0: 0:49 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 36D1337BA90 for ; Mon, 31 Jul 2000 00:00:45 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e6V6xOT04891; Sun, 30 Jul 2000 23:59:24 -0700 (PDT) Date: Sun, 30 Jul 2000 23:59:24 -0700 From: Alfred Perlstein To: Alain Fauconnet Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Trouble with waitpid(2) porting poppasswd Message-ID: <20000730235924.A4854@fw.wintelcom.net> References: <20000731135534.A552@cscoms.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <20000731135534.A552@cscoms.net>; from alain@cscoms.net on Mon, Jul 31, 2000 at 01:55:35PM +0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Alain Fauconnet [000730 23:56] wrote: > Dear all, > > I am doing a port of the poppasswd utility (well, one of the numerous > versions floating) because I have failed to find a port already > available. > [snip] > > The child: > > - does a setsid(2) to start a new session > - opens the slave part of the pty > - does dup2(2) of stdin, stdout and stderr to the slave part of the pty > - adjusts some terminal attributes (ICANON, ~ONLCR, ~ECHO...) > - changes uid and gid to those of the target user > - does execl(2) /usr/bin/passwd. I would just use 'pw' it'll make your life easier. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message