Sponsored Content
Full Discussion: Confussed as hell
Top Forums UNIX for Dummies Questions & Answers Confussed as hell Post 302212144 by Kevinfine on Sunday 6th of July 2008 05:13:11 PM
Old 07-06-2008
Confussed as hell

Smilie

Last edited by Kevinfine; 07-07-2008 at 08:43 AM..
 

7 More Discussions You Might Find Interesting

1. Programming

fork()ing hell!!

Hello I am having serious trouble with the fork command, i basically want to create 9 or 10 child processes and store their pid numbers in array while the children stay resident until i kill() them later , i cannot seem to control how many are made as they all seem to create their own children. ... (16 Replies)
Discussion started by: theultimatechuf
16 Replies

2. UNIX for Dummies Questions & Answers

rpm hell!

I've just installed redhat 6.2 on one of my systems and am trying to install the gcc c compiler after downloading an rpm from the redhat site. The damn thing gives me: only major numbers <= 3 are supported by this version of RPM what do I do, it does the same with the latest rpm of php ... (7 Replies)
Discussion started by: knmwt15000
7 Replies

3. What is on Your Mind?

Off-Topic Section? Holy hell, I've been gone a while...

Wowee, step off the bandwagon for a few months and it's amazing what can change. I'm still not sure if this is, in fact, but if it is, what made Neo change his mind about an OT thread? (7 Replies)
Discussion started by: Karma
7 Replies

4. Shell Programming and Scripting

hell and sqlite

Hi everyone, I have a requirement that requires me to fill an sqlite database with 100,000 entries (no duplicates). I will start out by giving the command that will insert the values necessary to populate the database: # sqlite /var/local/database/dblist "insert into list... (2 Replies)
Discussion started by: ogoy
2 Replies

5. Shell Programming and Scripting

hell & mathematics

I've been able to generate output based on the code scarfake provided me (thanks again man). A little background so everyone more or less knows whats going on: I needed code that would propagate a database with 100,000 entries, for capacity testing purposes, something like a stress test. ... (5 Replies)
Discussion started by: ogoy
5 Replies

6. What is on Your Mind?

The Hell of colaboration in UNIX and Linux

I don't want to speak about the goods or bads of both kinds of Operating systems, I only want to share a little experience with you to comment it. I live in Spain and I have home some old unix systems, some of them that I want to sell or change for other things, like a pair of Sun Blade 2000... (0 Replies)
Discussion started by: Golfonauta
0 Replies

7. Shell Programming and Scripting

quoting hell - help needed!!

I am writing a bash script to automate the installation of web environment on a base install of Fedora. And I'm at the limit of my last nerve and my bash skills. My brain is screaming at me: "Give up and use perl", but I am trying to stick to bash since the script will modify the perl environment... (6 Replies)
Discussion started by: lbe
6 Replies
Util(3pm)						User Contributed Perl Documentation						 Util(3pm)

NAME
Taint::Util - Test for and flip the taint flag without regex matches or "eval" SYNOPSIS
#!/usr/bin/env perl -T use Taint::Util; # eek! untaint $ENV{PATH}; # $sv now tainted under taint mode (-T) taint(my $sv = "hlagh"); # Untaint $sv again untaint $sv if tainted $sv; DESCRIPTION
Wraps perl's internal routines for checking and setting the taint flag and thus does not rely on regular expressions for untainting or odd tricks involving "eval" and "kill" for checking whether data is tainted, instead it checks and flips a flag on the scalar in-place. FUNCTIONS
tainted Returns a boolean indicating whether a scalar is tainted. Always false when not under taint mode. taint & untaint Taints or untaints given values, arrays will be flattened and their elements tainted, likewise with the values of hashes (keys can't be tainted, see perlsec). Returns no value (which evaluates to false). untaint(%ENV); # Untaints the environment taint(my @hlagh = qw(a o e u)); # elements of @hlagh now tainted References (being scalars) can also be tainted, a stringified reference reference raises an error where a tainted scalar would: taint(my $ar = @hlagh); system echo => $ar; # err: Insecure dependency in system This feature is used by perl internally to taint the blessed object "qr//" stringifies to. taint(my $str = "oh noes"); my $re = qr/$str/; system echo => $re; # err: Insecure dependency in system This does not mean that tainted blessed objects with overloaded stringification via overload need return a tainted object since those objects may return a non-tainted scalar when stringified (see t/usage.t for an example). The internal handling of "qr//" however ensures that this holds true. File handles can also be tainted, but this is pretty useless as the handle itself and not lines retrieved from it will be tainted, see the next section for details. taint(*DATA); # *DATA tainted my $ln = <DATA>; # $ln not tainted About tainting in Perl Since this module is a low level interface that directly exposes the internal "SvTAINTED*" functions it also presents new and exciting ways for shooting yourself in the foot. Tainting in Perl was always meant to be used for potentially hostile external data passed to the program. Perl is passed a soup of strings from the outside; it never receives any complex datatypes directly. For instance, you might get tainted hash keys in %ENV or tainted strings from *STDIN, but you'll never get a tainted Hash reference or a tainted subroutine. Internally, the perl compiler sets the taint flag on external data in a select few functions mainly having to do with IO and string operations. For example, the "ucfirst" function will manually set a tainted flag on its newly created string depending on whether the original was tainted or not. However, since Taint::Util is exposing some of perl's guts, things get more complex. Internally, tainting is implemented via perl's MAGIC facility, which allows you to attach attach magic to any scalar, but since perl doesn't liberally taint scalars it's there to back you up if you do. You can "taint(*DATA)" and "tainted(*DATA)" will subsequently be true but if you read from the filehandle via "<DATA>" you'll get untainted data back. As you might have guessed this is completely useless. The test file t/usage.t highlights some of these edge cases. Back in the real world, the only reason tainting makes sense is because perl will back you up when you use it, e.g. it will slap your hand if you try to pass a tainted value to system(). If you taint references, perl doesn't offer that protection, because it doesn't know anything about tainted references since it would never create one. The things that do work like the stringification of "taint($t = [])" (i.e. "ARRAY(0x11a5d48)") being tainted only work incidentally. But I'm not going to stop you. By all means, have at it! Just don't expect it to do anything more useful than warming up your computer. See RT #53988 <https://rt.cpan.org/Ticket/Display.html?id=53988> for the bug that inspired this section. EXPORTS
Exports "tainted", "taint" and "untaint" by default. Individual functions can be exported by specifying them in the "use" list, to export none use "()". HISTORY
I wrote this when implementing re::engine::Plugin so that someone writing a custom regex engine with it wouldn't have to rely on perl regexps for untainting capture variables, which would be a bit odd. SEE ALSO
perlsec AUTHOR
var Arnfjoer` Bjarmason <avar@cpan.org> LICENSE
Copyright 2007-2010 var Arnfjoer` Bjarmason. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2010-03-17 Util(3pm)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy