Re: [PATCH] Avoid crippled getpass function on Solaris
- From
Tay Ray Chuan <rctay89@gmail.com>
- Date
- Aug 6, 2012, 01:56 UTC
- Message-ID
- <CALUzUxrfSEtkXfFbotb3XARt9e=oWF0xQRVU0hwnsCJn-Cn0Lw@mail.gmail.com>
- In-Reply-To
- <1344208672-20028-1-git-send-email-bwalton@artsci.utoronto.ca>
On Mon, Aug 6, 2012 at 7:17 AM, Ben Walton <bwalton@artsci.utoronto.ca> wrote:
Show 7 quoted lines
> I've also briefly dabbled with getting Solaris to simply use the > HAVE_DEV_TTY code path but the terminal echo stuff hasn't worked > nicely for me just yet. (It reads the password with nothing echoed > but then displays the string after reading the newline.) This might > still be a better approach in the future, but for now, having long > password reading capability will still be a benefit to users on this > platform.
Replacing
if (!echo) {
putc('\n', fh);
fflush(fh);
}with
if (!echo) write(term_fd, "\n", 1);
fixed that. Using fd's instead of FILE* was mentioned at [1]. Perhaps that is the direction to go in.
[1] http://mid.gmane.org/<7vsjc12j5o.fsf@alter.siamese.dyndns.org>
-- Cheers, Ray Chuan