TCPSocket & $SAFE=1

Discussion in 'Ruby' started by Jesper Olsen, Jul 31, 2003.

  1. Jesper Olsen

    Jesper Olsen Guest

    In a mod_ruby script I am trying to lookup an ip address with
    TCPSocket.gethostbyname

    But it fails - even though the same script in batch mode succeeds.

    I notice that $SAFE==1 - is this what is preventing the method to
    execute?

    Cheers
    Jesper
     
    Jesper Olsen, Jul 31, 2003
    #1
    1. Advertising

  2. Hi,

    In message "TCPSocket & $SAFE=1"
    on 03/08/01, Jesper Olsen <> writes:

    |In a mod_ruby script I am trying to lookup an ip address with
    |TCPSocket.gethostbyname
    |
    |But it fails - even though the same script in batch mode succeeds.

    How it fails?

    matz.
     
    Yukihiro Matsumoto, Aug 1, 2003
    #2
    1. Advertising

  3. Jesper Olsen

    Jesper Olsen Guest

    ts <> wrote in message news:<>...
    > >>>>> "J" == Jesper Olsen <> writes:

    >
    > J> But it fails - even though the same script in batch mode succeeds.
    >
    > You must untaint the String given to TCPSocket::gethostbyname : be
    > carefull when you do this
    >
    >
    > Guy Decoux


    Yes, that did the trick. Thanks for the hint.

    Jesper
     
    Jesper Olsen, Aug 1, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabriel Rossetti
    Replies:
    0
    Views:
    1,400
    Gabriel Rossetti
    Aug 29, 2008
  2. Replies:
    1
    Views:
    377
    Brian Candler
    Aug 12, 2003
  3. Aredridel

    Not just $SAFE, but damn $SAFE

    Aredridel, Sep 2, 2004, in forum: Ruby
    Replies:
    19
    Views:
    266
  4. Farrel Lifson

    $SAFE =4 safe enough?

    Farrel Lifson, Aug 29, 2006, in forum: Ruby
    Replies:
    7
    Views:
    120
    Eric Hodel
    Aug 31, 2006
  5. John Nagle
    Replies:
    5
    Views:
    514
    John Nagle
    Mar 12, 2012
Loading...

Share This Page