[svn:perlfaq] r9623 - perlfaq/trunk

[email protected] Thu, 31 May 2007 13:32:33 -0700 (PDT)
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
Author: comdog
Date: Thu May 31 13:32:32 2007
New Revision: 9623

Modified:
   perlfaq/trunk/perlfaq8.pod

Log:
* perlfaq8: How can I call backticks without shell processing?
	+ s/a argc/an argc/;
	+ some Pod clean-ups

* perlfaq8: How do I decode encrypted password files?
	+ minor grammar fix



Modified: perlfaq/trunk/perlfaq8.pod
==============================================================================
--- perlfaq/trunk/perlfaq8.pod	(original)
+++ perlfaq/trunk/perlfaq8.pod	Thu May 31 13:32:32 2007
@@ -334,12 +334,11 @@
 bound to get you talked about.
 
 Seriously, you can't if they are Unix password files--the Unix
-password system employs one-way encryption.  It's more like hashing than
-encryption.  The best you can check is whether something else hashes to
-the same string.  You can't turn a hash back into the original string.
-Programs like Crack
-can forcibly (and intelligently) try to guess passwords, but don't
-(can't) guarantee quick success.
+password system employs one-way encryption.  It's more like hashing
+than encryption.  The best you can do is check whether something else
+hashes to the same string.  You can't turn a hash back into the
+original string. Programs like Crack can forcibly (and intelligently)
+try to guess passwords, but don't (can't) guarantee quick success.
 
 If you're worried about users selecting bad passwords, you should
 proactively check when they try to change their password (by modifying
@@ -818,8 +817,8 @@
 
 	@ok = `grep @opts '$search_string' @filenames`;
 
-As of Perl 5.8.0, you can use open() with multiple arguments.
-Just like the list forms of system() and exec(), no shell
+As of Perl 5.8.0, you can use C<open()> with multiple arguments.
+Just like the list forms of C<system()> and C<exec()>, no shell
 escapes happen.
 
 	open( GREP, "-|", 'grep', @opts, $search_string, @filenames );
@@ -833,18 +832,19 @@
 		while (<GREP>) {
 			chomp;
 			push(@ok, $_);
-	    }
-	    close GREP;
+		}
+		close GREP;
 	} else {
 		exec 'grep', @opts, $search_string, @filenames;
 	}
 
-Just as with system(), no shell escapes happen when you exec() a list.
-Further examples of this can be found in L<perlipc/"Safe Pipe Opens">.
-
-Note that if you're use Microsoft, no solution to this vexing issue
-is even possible.  Even if Perl were to emulate fork(), you'd still
-be stuck, because Microsoft does not have a argc/argv-style API.
+Just as with C<system()>, no shell escapes happen when you C<exec()> a
+list. Further examples of this can be found in L<perlipc/"Safe Pipe
+Opens">.
+
+Note that if you're use Windows, no solution to this vexing issue is
+even possible.  Even if Perl were to emulate C<fork()>, you'd still be
+stuck, because Windows does not have an argc/argv-style API.
 
 =head2 Why can't my script read from STDIN after I gave it EOF (^D on Unix, ^Z on MS-DOS)?