Sponsored Content
The Lounge What is on Your Mind? How much snow do you have where you are? Post 302098770 by Eronysis on Wednesday 6th of December 2006 02:56:57 PM
Old 12-06-2006
Phoenix is surprisingly snow free as well Smilie
 

4 More Discussions You Might Find Interesting

1. OS X (Apple)

MacPorts on Snow Leopard

Hello everyone. I was previously using MacPorts 1.8 on Mac OS 10.5.8 without any problems and everything was working well. I recently upgraded to Xcode 3.2 and Mac OS 10.6, since then my MacPorts installation has not been working at all. I deleted it and then reinstalled the .dmg from the... (1 Reply)
Discussion started by: HoldenCaulfield
1 Replies

2. OS X (Apple)

Alpine 2 on Snow Leopard

I've just installed Alpine on Snow Leopard but can't seem to get a default spell checker configured for it. What happened to spell? I can't find it at all on 10.6, must have been some changes. Does anyone know about the default unix spell checker on SL? Thanks! (0 Replies)
Discussion started by: platz
0 Replies

3. OS X (Apple)

Installing Oracle 10g on Snow Leopard using this tutorial

This tutorial. Which is a lovely tutorial, really, and was working up until this instruction: Now download db.zip installation archive and place it somewhere and unzip it: mkdir Install cd Install # download db.zip to this directory unzip db.zip cd db/Disk1 I didn't know how to... (1 Reply)
Discussion started by: khayraB
1 Replies

4. OS X (Apple)

Problem with mail attachment in Snow Leopard

Hi, We have few scripts that are run through jobs . It sends us daily reports (using mailx). This was working fine in Leopard. But in Snow Leopard there is problem with the attachments.Neither the attachment name is being displayed correctly(all it displays is "Mail Attachment") nor the format... (1 Reply)
Discussion started by: adash
1 Replies
ReadPassword(3pm)					User Contributed Perl Documentation					 ReadPassword(3pm)

NAME
Term::ReadPassword - Asking the user for a password SYNOPSIS
use Term::ReadPassword; while(1) { my $password = read_password('password: '); redo unless defined $password; if ($password eq 'flubber') { print "Access granted. "; last; } else { print "Access denied. "; redo; } } DESCRIPTION
This module lets you ask the user for a password in the traditional way, from the keyboard, without echoing. This is not intended for use over the web; user authentication over the web is another matter entirely. Also, this module should generally be used in conjunction with Perl's crypt() function, sold separately. The read_password function prompts for input, reads a line of text from the keyboard, then returns that line to the caller. The line of text doesn't include the newline character, so there's no need to use chomp. While the user is entering the text, a few special characters are processed. The character delete (or the character backspace) will back up one character, removing the last character in the input buffer (if any). The character CR (or the character LF) will signal the end of input, causing the accumulated input buffer to be returned. Control-U will empty the input buffer. And, optionally, the character Control-C may be used to terminate the input operation. (See details below.) All other characters, even ones which would normally have special pur- poses, will be added to the input buffer. It is not recommended, though, that you use the as-yet-unspecified control characters in your passwords, as those characters may become meaningful in a future version of this module. Applications which allow the user to set their own passwords may wish to enforce this rule, perhaps with code something like this: { # Naked block for scoping and redo my $new_pw = read_password("Enter your new password: "); if ($new_pw =~ /([^x20-x7E])/) { my $bad = unpack "H*", $1; print "Your password may not contain the "; print "character with hex code $bad. "; redo; } elsif (length($new_pw) < 5) { print "Your password must be longer than that! "; redo; } elsif ($new_pw ne read_password("Enter it again: ")) { print "Passwords don't match. "; redo; } else { &change_password($new_pw); print "Your password is now changed. "; } } The second parameter to read_password is the optional "idle_timeout" value. If it is a non-zero number and there is no keyboard input for that many seconds, the input operation will terminate. Notice that this is not an overall time limit, as the timer is restarted with each new character. The third parameter will optionally allow the input operation to be terminated by the user with Control-C. If this is not supplied, or is false, a typed Control-C will be entered into the input buffer just as any other character. In that case, there is no way from the keyboard to terminate the program while it is waiting for input. (That is to say, the normal ability to generate signals from the keyboard is sus- pended during the call to read_password.) If the input operation terminates early (either because the idle_timeout was exceeded, or because a Control-C was enabled and typed), the return value will be "undef". In either case, there is no way provided to discover what (if anything) was typed before the early termina- tion, or why the input operation was terminated. So as to discourage users from typing their passwords anywhere except at the prompt, any input which has been "typed ahead" before the prompt appears will be discarded. And whether the input operation terminates normally or not, a newline character will be printed, so that the cursor will not remain on the line after the prompt. BUGS
Windows users will want Term::ReadPassword::Win32. This module has a poorly-designed interface, and should be thoroughly rethought and probably re-united with the Windows version. Users who wish to see password characters echoed as stars may set $Term::ReadPassword::USE_STARS to a true value. The bugs are that some terminals may not erase stars when the user corrects an error, and that using stars leaks information to shoulder-surfers. SECURITY
You would think that a module dealing with passwords would be full of security features. You'd think that, but you'd be wrong. For example, perl provides no way to erase a piece of data from memory. (It's easy to erase it so that it can't be accessed from perl, but that's not the same thing as expunging it from the actual memory.) If you've entered a password, even if the variable that contained that password has been erased, it may be possible for someone to find that password, in plaintext, in a core dump. And that's just one potential security hole. In short, if serious security is an issue, don't use this module. LICENSE
This program is free software; you may redistribute it, modify it, or both, under the same terms as Perl itself. AUTHOR
Tom Phoenix <rootbeer@redcat.com>. Copyright (C) 2007 Tom Phoenix. SEE ALSO
Term::ReadLine, "crypt" in perlfunc, and your system's manpages for the low-level I/O operations used here. perl v5.8.8 2008-03-12 ReadPassword(3pm)
All times are GMT -4. The time now is 08:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy