Sponsored Content
Full Discussion: password mask in C
Top Forums Programming password mask in C Post 23160 by Deepa on Monday 17th of June 2002 11:30:21 PM
Old 06-18-2002
Krishna

Check out the function getpass()...this function is used for getting the password without echoing on the terminal. It may not echo '*'s as you need.

Check out "man getpass".

Deepa
 

10 More Discussions You Might Find Interesting

1. IP Networking

Subnet mask

Hi, I have about 30 computers for users with subnet mask x.x.x.0, and 25 computers for workers with s.m. x.x.x.128. My server has a s.m. x.x.x.128 so with workers computers I can see my server and all the computers in that s.m., but I can't see the server from the users computers and I need to see... (7 Replies)
Discussion started by: Z0DiaC
7 Replies

2. IP Networking

Changing the mask

What is the command to change the mask to 255.255.255.0 The system was set up incorectly and the mask needs to be corrected (1 Reply)
Discussion started by: kkinnon
1 Replies

3. Shell Programming and Scripting

mask ID number

HP-UX 11i v2. #!/bin/sh Hi all. I have a flat file like this with lines like this: |07/19/07|08:26AM|1|CupsCoffee|CupsCo|989898989 |Doe, John Y |THE PLUS CARD - Price| | |Y| | 2.00| I would like to replace the id number (field 6) with a masked... (3 Replies)
Discussion started by: lyoncc
3 Replies

4. Shell Programming and Scripting

Need to Mask Data

I have an requirement. There is a file which has the below contents Unix|123|17-01-2010 .... .... .... .... and so an now each letter has a corresponding predefined mapping letter in order to mask the original data.(for example U = A, n=b, i=c, x=d, same like number 1=9,2=8,3=7. Also... (8 Replies)
Discussion started by: ksmbabu
8 Replies

5. UNIX for Dummies Questions & Answers

how to mask the password ?

Hi All, i am executing peoplesoft sqr command from unix prompt which has the unix id/password as parameter along with other parameters. i want to show whole command in log file but want to mask the id/password field. this command i am executing in shell script. Please suggest.. >sqr sqrname... (2 Replies)
Discussion started by: avi.coep
2 Replies

6. Red Hat

Samba create mask and dir mask on RHEL 4.8

Hi Experts, I'm using samba -3.6.1 on Red Hat Enterprise Linux ES release 4 (Nahant Update 8) ,all seems ok. The issue im facing is as follows. When ever a user creates a file via windows explorer the permissions assgined to the file are as follows -rw-rwxr--+ 1 tom group2 0 Mar 9... (1 Reply)
Discussion started by: maverick_here
1 Replies

7. UNIX for Dummies Questions & Answers

What is mask and effective right mask in setfacl?

Hi Guys, can someone explain what is mask and effective right mask in setfacl and getfacl command with example, unable to get it. (3 Replies)
Discussion started by: Jcpratap
3 Replies

8. Shell Programming and Scripting

Bash scripting mask password from ps

Hi All, I have a script, which prompts me for my password input, then it passes that password onto an argument for another script which is then passed onto an expect script which automates my logins to a bunch of servers to execute my commands. example. script A - request for password,... (7 Replies)
Discussion started by: aixkidbee
7 Replies

9. Shell Programming and Scripting

awk help to mask characters

Hi Guys, I'm not an expert so seeking advice on awk. I need to mask numbers in a text field so that they show up as "*" except for the last 4. Input: Desired Output: The part of the Code I am using gives me this Output num=$(echo $num | awk 'BEGIN{FS=OFS=""}{for (i=1 ; i<=NF-4; i++)... (4 Replies)
Discussion started by: aster007
4 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies
getpass(3C)						   Standard C Library Functions 					       getpass(3C)

NAME
getpass, getpassphrase - read a string of characters without echo SYNOPSIS
#include <stdlib.h> char *getpass(const char *prompt); char *getpassphrase(const char *prompt); XPG4, SUS, SUSv2 #include <unistd.h> char *getpass(const char *prompt); DESCRIPTION
The getpass() function opens the process's controlling terminal, writes to that device the null-terminated string prompt, disables echoing, reads a string of characters up to the next newline character or EOF, restores the terminal state and closes the terminal. The getpassphrase() function is identical to getpass(), except that it reads and returns a string of up to 257 characters in length. RETURN VALUES
Upon successful completion, getpass() returns a pointer to a null-terminated string of at most 9 bytes that were read from the terminal device. If an error is encountered, the terminal state is restored and a null pointer is returned. ERRORS
The getpass() and getpassphrase() functions may fail if: EINTR The function was interrupted by a signal. EIO The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. EMFILE OPEN_MAX file descriptors are currently open in the calling process. ENFILE The maximum allowable number of files is currently open in the system. ENXIO The process does not have a controlling terminal. USAGE
The return value points to static data whose content may be overwritten by each call. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |getpass() is Standard. | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), standards(5) SunOS 5.10 2 Sep 2003 getpass(3C)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy