21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ufsiz<br />

Size of the buffer (in bytes) into which input read from the interactive user is<br />

placed. Up to one less byte than the size specified may be read. Any additional<br />

input is silently discarded.<br />

flags<br />

Set of flags that may be logically OR’d together to control the behavior of the<br />

function.<br />

A number of flags are defined as macros in the readpassphrase.h header file. While<br />

some of the flags are mutually exclusive, some of them may be logically combined<br />

together:<br />

RPP_ECHO_OFF<br />

Disables echoing of the user’s input on the terminal. If neither this flag nor RPP_<br />

ECHO_ON is specified, this is the default. The two flags are mutually exclusive, but<br />

if both are specified, echoing will be enabled.<br />

RPP_ECHO_ON<br />

Enables echoing of the user’s input on the terminal.<br />

RPP_REQUIRE_TTY<br />

If there is no controlling tty, and this flag is specified, readpassphrase( ) will<br />

return an error; otherwise, the prompt will be written to stderr, and input will<br />

be read from stdin. When input is read from stdin, it’s often not possible to disable<br />

echoing.<br />

RPP_FORCELOWER<br />

Causes all input from the user to be automatically converted to lowercase. This<br />

flag is mutually exclusive with RPP_FORCEUPPER; however, if both flags are specified,<br />

RPP_FORCEUPPER will take precedence.<br />

RPP_FORCEUPPER<br />

Causes all input from the user to be automatically converted to uppercase.<br />

RPP_SEVENBIT<br />

Indicates that the high bit will be stripped from all user input.<br />

For both getpass( ) and readpassphrase( ), a pointer to the input buffer will be<br />

returned if the function completes successfully; otherwise, a NULL pointer will be<br />

returned, and the error that occurred will be stored in the global errno variable.<br />

Both getpass( ) and readpassphrase( ) can return an error with errno<br />

set to EINTR, which means that the input from the user was interrupted<br />

by a signal. If such a condition occurs, all input from the user<br />

up to the point when the signal was delivered will be stored in the<br />

buffer, but in the case of getpass( ), there will be no way to retrieve<br />

that data.<br />

394 | Chapter 8: Authentication and Key Exchange<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!