$Config{ivsize}. For portability, be sure to mask off the excess bits
in the result of unary C<~>, e.g., C<~$x & 0xffffffff>.
-=head2 The shell returned by the getpwxxx() is now tainted
+=head2 The passwd and shell returned by the getpwxxx() are now tainted
-Because the user can affect her own login shell the shell returned
-by the getpwent(), getpwnam(), and getpwuid() functions is tainted.
+Because the user can affect her own encrypted password and login shell
+the password and shell returned by the getpwent(), getpwnam(), and
+getpwuid() functions are tainted.
=back
the real name of the user (as opposed to the login name) and other
information pertaining to the user. Beware, however, that in many
system users are able to change this information and therefore it
-cannot be trusted and therefore the $gcos is is tainted (see L<perlsec>).
-The $shell, user's login shell, is also tainted, because of the same reason.
+cannot be trusted and therefore the $gcos is is tainted (see
+L<perlsec>). The $passwd and $shell, user's encrypted password and
+login shell, are also tainted, because of the same reason.
In scalar context, you get the name, unless the function was a
lookup by name, in which case you get the other thing, whatever it is.
something else outside your program--at least, not by accident. All
command line arguments, environment variables, locale information (see
L<perllocale>), results of certain system calls (readdir, readlink,
-the gecos and shell fields of getpw* calls), and all file input are
-marked as "tainted". Tainted data may not be used directly or
-indirectly in any command that invokes a sub-shell, nor in any command
-that modifies files, directories, or processes. (B<Important
+the password, gcos and shell fields of the getpw* calls), and all file
+input are marked as "tainted". Tainted data may not be used directly
+or indirectly in any command that invokes a sub-shell, nor in any
+command that modifies files, directories, or processes. (B<Important
exception>: If you pass a list of arguments to either C<system> or
C<exec>, the elements of that list are B<NOT> checked for
taintedness.) Any variable set to a value derived from tainted data
sv_setpv(sv, pwent->pw_passwd);
# endif
#endif
+#ifndef INCOMPLETE_TAINTS
+ /* passwd is tainted because user himself can diddle with it. */
+ SvTAINTED_on(sv);
+#endif
PUSHs(sv = sv_mortalcopy(&PL_sv_no));
#if Uid_t_sign <= 0
my @getpwent = getpwent();
die "getpwent: $!\n" unless (@getpwent);
test 142,( not tainted $getpwent[0]
- and not tainted $getpwent[1]
+ and tainted $getpwent[1]
and not tainted $getpwent[2]
and not tainted $getpwent[3]
and not tainted $getpwent[4]