From e3e2681b218b339847f1aa7fad207a749ccbf6b7 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Tue, 1 Apr 2008 18:57:09 +0100 Subject: [PATCH] Add getpass to the fun Organization: Straylight/Edgeware From: Mark Wooding --- Makefile.am | 5 +++++ debian/control | 27 ++++++++++++++++++++++++--- debian/inst | 2 ++ getpass.1 | 15 +++++++++++++++ getpass.c | 13 +++++++++++++ 5 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 getpass.1 create mode 100755 getpass.c diff --git a/Makefile.am b/Makefile.am index acb0788..5387354 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,6 +50,11 @@ bin_PROGRAMS += if-mtu if_mtu_SOURCES = if-mtu.c dist_man_MANS += if-mtu.1 +## getpass +bin_PROGRAMS += getpass +getpass_SOURCES = getpass.c +dist_man_MANS += getpass.1 + ## xtitle bin_PROGRAMS += xtitle xtitle_SOURCES = xtitle.c diff --git a/debian/control b/debian/control index 1c31949..4513548 100644 --- a/debian/control +++ b/debian/control @@ -9,9 +9,25 @@ Standards-Version: 3.1.1 Package: nsict-utils Architecture: all Section: utils -Depends: mdwopt-perl, nsict-cdb, locking, qmail-checkspam, nsict-mail, - if-mtu, shadowfix, zz, gorp, splitconf, xtitle, pause, buf, create, inplace, - stamp, space +Depends: + mdwopt-perl, + nsict-cdb, + locking, + qmail-checkspam, + nsict-mail, + if-mtu, + shadowfix, + zz, + gorp, + splitconf, + xtitle, + pause, + buf, + create, + inplace, + stamp, + space, + getpass Description: Dummy package for convenience. Package: mdwopt-perl @@ -107,6 +123,11 @@ Architecture: any Section: utils Description: Like cat, but prefixing each line with a datestamp. +Package: getpass +Architecture: any +Section: utils +Description: Read a password without echoing; write it to stdout. + Package: space Architecture: any Section: utils diff --git a/debian/inst b/debian/inst index fe4302d..ca8851d 100644 --- a/debian/inst +++ b/debian/inst @@ -15,6 +15,8 @@ check-sender nsict-mail /usr/bin check-sender.1 nsict-mail /usr/share/man/man1 create create /usr/bin create.1 create /usr/share/man/man1 +getpass getpass /usr/bin +getpass.1 getpass /usr/share/man/man1 gorp gorp /usr/bin gorp.1 gorp /usr/share/man/man1 if-mtu if-mtu /usr/bin diff --git a/getpass.1 b/getpass.1 new file mode 100644 index 0000000..bb00343 --- /dev/null +++ b/getpass.1 @@ -0,0 +1,15 @@ +.TH getpass 1 "1 April 2008" +.SH NAME +getpass \- read a secret string from the user +.SH SYNOPSIS +.B getpass +.RI [ prompt ] +.SH DESCRIPTION +The +.B getpass +program reads a message from the user without echoing it to the terminal, +and writes the message to standard output. +.SH SEE ALSO +.BR getpass (3). +.SH AUTHOR +Mark Wooding diff --git a/getpass.c b/getpass.c new file mode 100755 index 0000000..e71b084 --- /dev/null +++ b/getpass.c @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + char *p = getpass(argc > 1 ? argv[1] : "Go on: "); + if (!p) { + perror("getpass"); + return (1); + } + puts(p); + return (0); +} -- [mdw]