Ways of turning echo off ... off

Ways of turning echo off ... off

Post by Barry Skag » Thu, 28 Jul 1994 02:38:34



I need to be able to turn echoing off for a single scanf then restore
normal echoing (entry of a password) for a Sun (does not need to be portable).
This is a simple utility program and I would prefer to not use curses for just
this one feature.  I've also reviewed termio, but I still don't see how to do this.
The following is what I would like to be able to do given the code for _set_echo_.
Any suggestions?

char *passwd (char *passwd, const char *prompt)
{
   printf ("Enter password\n");
   set_echo (False);
   scanf ("%s", passwd);
   set_echo (True);
   return (char *) passwd;

Quote:}  

                                         Barry Skaggs
                                         Chemical Abstracts Service

                                         614-447-3838 x 3137
 
 
 

Ways of turning echo off ... off

Post by Riku Saikkon » Fri, 29 Jul 1994 02:41:00


Quote:>I need to be able to turn echoing off for a single scanf then restore
>normal echoing (entry of a password) for a Sun (does not need to be portable).

Don't you have getpass()?


GCS/L/M/TW/S -d+ H+ s:- !g !p !au a17 w+ v+(---) C++ UL++++() P+ L++
3 E N+++ K- W+(++) M- !V po Y+ t/Tolkien+++ !5 !j R G' tv-() b++ D++


 
 
 

Ways of turning echo off ... off

Post by Virupaksh Honn » Fri, 29 Jul 1994 07:15:32


: I need to be able to turn echoing off for a single scanf then restore
: normal echoing (entry of a password) for a Sun (does not need to be portable).
: This is a simple utility program and I would prefer to not use curses for just
: this one feature.  I've also reviewed termio, but I still don't see how to do this.
: The following is what I would like to be able to do given the code for _set_echo_.
: Any suggestions?

: char *passwd (char *passwd, const char *prompt)
: {
:    printf ("Enter password\n");
:    set_echo (False);
:    scanf ("%s", passwd);
:    set_echo (True);
:    return (char *) passwd;
: }  

It's very simple u can use similar to the following piece of code:

echo "Enter your secret code: \c"
       old=`stty -g`
       stty -echo intr '^a'
       read code
       stty $old

echo "Secret code is:\c"
echo $code

--
Virupaksh Honnur

 
 
 

Ways of turning echo off ... off

Post by Steven Feinho » Sat, 30 Jul 1994 02:04:18



>I need to be able to turn echoing off for a single scanf then restore
>normal echoing (entry of a password) for a Sun (does not need to be portable).
>This is a simple utility program and I would prefer to not use curses for just
>this one feature.  I've also reviewed termio, but I still don't see how to do this.
>The following is what I would like to be able to do given the code for _set_echo_.
>Any suggestions?

>char *passwd (char *passwd, const char *prompt)
>{
>   printf ("Enter password\n");
>   set_echo (False);
>   scanf ("%s", passwd);
>   set_echo (True);
>   return (char *) passwd;
>}  

>                                         Barry Skaggs
>                                         Chemical Abstracts Service

>                                         614-447-3838 x 3137

Check out the ioctl "man" pages.
It will do everything you want to do.

---

________________________________________________________________________
       A T & T       | Steven Feinholz        | Phone:    (310) 524-5945
     G L O B A L     | Client Software        | FAX:      (310) 524-5515
I N F O R M A T I O N| 100 N. Sepulveda Blvd. | E-Mail:

------------------------------------------------------------------------

 
 
 

Ways of turning echo off ... off

Post by Bruno U » Sun, 31 Jul 1994 00:24:36


here is a fragment to query a password:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

extern char *getpass();

void main()
{
        char *p;

        p = getpass("Password: ");

Quote:}

Of course, there are other solutions, but why make it more complicated ?

Cheers

 
 
 

1. Need to turn off echo for password input

Hey all,
I need to turn off echo for password input.  As per one of the
refernece off the web
"http://www.perchine.com/dyp/x/motif-faq/part4/faq-doc-14.html",
here is what they suggest:

"Use the XmNmodifyVerifyCallback to tell when input is received.
Set the `doit' field in the XmTextVerifyCallbackStruct to False
to stop the echo."

Can some one please tell me how can I set the "doit" field in
dtksh (there is code for C etc. but not for dtksh).
Can some one please help.

Thnakx

2. Linux From Scratch, highly recommended

3. Turning Off Echoing on a Socket

4. Can't read cdrw after kernal upgrade

5. How do you turn off terminal echo from within C under UNIX?

6. initialization file calling mechanism

7. Echo in telnet mode -- How to turn it off?

8. necessary services in /etc/rc*

9. How to turn off echo, and get a character at a time (getpass())

10. BSD weenie needs to turn off keyboard echoing under Sys5

11. help: turn echo off

12. How to turn off echo when read password from user ?

13. "turning off" echo in input in bourne shell script