diff options
author | ed <ed@FreeBSD.org> | 2010-11-14 14:12:43 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2010-11-14 14:12:43 +0000 |
commit | 4ee939c936810cdbeb5d64f9b2b28890e4af0814 (patch) | |
tree | 8cfc4a89bf07768ed21b9e6d521da70520fb8e36 /sys/libkern | |
parent | dd93d3c0fda933782c0813b9cf0b13c8c5f80054 (diff) | |
download | FreeBSD-src-4ee939c936810cdbeb5d64f9b2b28890e4af0814.zip FreeBSD-src-4ee939c936810cdbeb5d64f9b2b28890e4af0814.tar.gz |
Add support for asterisk characters when filling in the GELI password
during boot.
Change the last argument of gets() to indicate a visibility flag and add
definitions for the numerical constants. Except for the value 2, gets()
will behave exactly the same, so existing consumers shouldn't break. We
only use it in two places, though.
Submitted by: lme (older version)
Diffstat (limited to 'sys/libkern')
-rw-r--r-- | sys/libkern/gets.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/libkern/gets.c b/sys/libkern/gets.c index 4834da0..64452f3 100644 --- a/sys/libkern/gets.c +++ b/sys/libkern/gets.c @@ -60,8 +60,16 @@ gets(char *cp, size_t size, int visible) continue; default: if (lp < end) { - if (visible) + switch (visible) { + case GETS_NOECHO: + break; + case GETS_ECHOPASS: + printf("*"); + break; + default: printf("%c", c); + break; + } *lp++ = c; } } |