Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28486 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7103 invoked by uid 1010); 20 Mar 2007 18:06:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7088 invoked from network); 20 Mar 2007 18:06:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2007 18:06:25 -0000 Authentication-Results: pb1.pair.com header.from=pollita@php.net; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=pollita@php.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 140.211.166.39 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pollita@php.net X-Host-Fingerprint: 140.211.166.39 osu1.php.net Linux 2.4/2.6 Received: from [140.211.166.39] ([140.211.166.39:49119] helo=osu1.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/01-33452-1A220064 for ; Tue, 20 Mar 2007 13:06:25 -0500 X-DomainKeys: Ecelerity dk_sign implementing draft-delany-domainkeys-base-01 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=mx; d=php.net; h=From:Subject:To:Date; b=KVxvvgfxKJ4oVe2Iffvt0zRQzxVMQyKfAiFby19lue7R4dWKlg6zxYaZRQflbqvX M0PbxkCSDj5OXhy5v08xRrpody6V8Lf6qu8/cu2Uy3jNP7z6fJ/Hi1Bm9Q6TTMbY Authentication-Results: osu1.php.net smtp.user=pollita; auth=pass (LOGIN) X-Host-Fingerprint: 207.126.230.225 unknown Received: from [207.126.230.225] ([207.126.230.225:39745] helo=[10.72.106.237]) by osu1.php.net (ecelerity 2.1.1.11-rc1 r(13363/13364M)) with ESMTPSA (cipher=AES256-SHA) id 55/60-26250-48320064 for ; Tue, 20 Mar 2007 10:10:12 -0800 Message-ID: <46002299.9030100@php.net> Date: Tue, 20 Mar 2007 11:06:17 -0700 User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Daniel Rozsnyo CC: internals@lists.php.net References: <7D.10.33476.19FAEF54@pb1.pair.com> In-Reply-To: <7D.10.33476.19FAEF54@pb1.pair.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: getpass() wrapper From: pollita@php.net (Sara Golemon) > I am working on a command line client (written in php, run by php-cli) > and I'd like to use a password entry as in mysql client - with no > echoing etc. I've found the function which I need: > > #include > char *getpass( const char * prompt ); > > But in man getpass it is marked as "This function is obsolete. Do not > use it.". More from the manpage: "Present in SUSv2, but marked LEGACY. > Removed in POSIX.1-2001." > > Can this function be somehow included in next release of PHP, at least > in coditional way so I can check its availability with function_exists? > (a). Or I should patch my instance of PHP (b) or stick forever to a > small binary written in C which then I call with backtick operator (c). > > What you recommend, developers of PHP ? > For one thing, I *don't* recommend wrapping obsoleted functions as a builtin. You're welcome to do this in an extension, it'll even be welcomed in PECL, but it's not something which belongs in the mainline distribution. Note that since this function produces output (to stdout -- bypassing PHP's output layer), you may run into problems using this with any SAPI other than cgi or cli (not that you would use it elsewhere anyway), and it'll be completely out-of-band of any uses of ob_start() and family. I also would be inclined to doubt that this integrates with PAM, so god help you if you're using a distributed authentication scheme such as LDAP, kerberos, etc... Anyway, in case it wasn't obvious from my steadily darkening tone, -1 from me. -Sara