in reply to Net::Telnet and changing passwords

My experience is waitfor() seems to be pretty finicky about what is returned....have you tried using dump_log() to verify what is going on?

Replies are listed 'Best First'.
Re: Re: Net::Telnet and changing passwords
by jcpunk (Friar) on Jun 27, 2003 at 18:42 UTC
    yes, i really should have posted that up there as well.... sigh i knew i forgot something
    > 0x00000: 2f 62 69 6e 2f 70 61 73 73 77 64 0d 0a /bin/pa +sswd.. < 0x00000: 2f / < 0x00000: 62 69 6e 2f 70 61 73 73 77 64 0d 0a 70 61 73 73 bin/pas +swd..pass < 0x00010: 77 64 3a 20 20 43 68 61 6e 67 69 6e 67 20 70 61 wd: Ch +anging pa < 0x00020: 73 73 77 6f 72 64 20 66 6f 72 20 70 72 69 65 68 ssword +for prieh < 0x00030: 65 63 6b 0d 0a eck.. < 0x00000: 45 6e 74 65 72 20 6c 6f 67 69 6e 28 4e 49 53 2b Enter l +ogin(NIS+ < 0x00010: 29 20 70 61 73 73 77 6f 72 64 3a 20 ) passw +ord:
    that is the log, and the waitfor()'s came out of teh documentation letter by letter, but since this currently doesnt work, im up for recoding it... i will add those to my list of lines to be evaluated for dumping.

    but that is beside the point, the program hangs wainting for the password which i thought i told it to send...
    jcpunk

    by the way thanks for all the help that was, is, and will be

      I may be missing something here but aren't you waiting for
      /new password:
      and from what I can see from debug() you are getting
      Enter l+ogin(NIS+ ) password
      I don't think the condition
      $telnet->waitfor('/new password: ?$/i') or report_error("ERROR", "No p +assword prompt found, contact Information Technologies: ");
      Is being met...waitfor() is just sitting there waiting for that prompt to match and it isn't so you never get to
      $telnet->print($new_password);

      Of course, I haven't tried it on a real machine but this looks to me to be the possible cause of your quandry.

        Thank you very much for that observation, I dont think I would have found that.
        jcpunk

        by the way thanks for all the help that was, is, and will be