aboutsummaryrefslogtreecommitdiff
path: root/lib/password.c
AgeCommit message (Collapse)Author
2020-09-23Have read_password() read from tty device, handle ctrl-c and ctrl-d.Rob Landley
2020-09-23Chris Sarra pointed out that nerfing xprintf() so it doesn't actually flushRob Landley
broke the password: prompt.
2019-07-22Start replacing get_line() with getline().Elliott Hughes
I started this last night, but thought I'd aim to send multiple small patches rather than work through all the callers and send one big patch. I've deliberately chosen the ugly name `allocated_length` because we've had historical bugs where folks think this a line length in the sense of the return value. I do wonder whether we should actually have some kind of getline() wrapper that hides the `char *`/`size_t` pair in lib/, which makes the function easier to use in most cases but does add the less common gotcha that you wouldn't be able to getline() through multiple files at once (which does happen in at least one toy). But maybe the real fix is to look harder for places where we can just use loopfiles_lines? Speaking of which, should we actually add two more arguments to that? Specifically: switch it to getdelim() rather than getline() behind the scenes, and also add a way to have the trailing '\n' automatically removed, since that seems to be what most callers want? Anyway, that seemed like enough questions that it was time to send this initial patch out before doing too much more...
2018-10-10Add xsignal_flags() and more consistently use xsignal() instead of signal().Rob Landley
xsignal() wraps sigaction() giving control of SA_RESTART behavior and such.
2018-08-17Make microcom use set_terminal() and move speed setting into set_terminal().Rob Landley
2018-07-04Add xgetrandom() with probe for new system call (else open/read /dev/{,u}random)Rob Landley
2016-08-04Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout,Rob Landley
add xopenro() that takes one argument and understands "-" means stdin, and switch over lots of users.
2015-05-31Move the magic list of commands needing cleanup from toys/pending/READMERob Landley
to greppable TODO annotations in the individual files. (grep -riw TODO)
2015-04-27Some infrastructure hexedit needs. (Poor man's curses.)Rob Landley
2015-01-18Remove trailing whitespace.Rob Landley
2014-11-11Remove unnecessary assignment spotted by Cynt Rynt.Rob Landley
2014-09-26The only illegal characters in a username are ":" (field separator), "\n" ↵Rob Landley
(line separator), and "/" (filename separator). Restricting usernames to the legacy posix character allowed set (for filenames, so the $HOME directory is creatable on VFAT and similar) means you can't have UTF-8 usernames. Linux allows any character but / and NUL in filenames. Since root is creating these entries, we assume root knows what it's doing.
2014-06-28Cleanup read_password(), factor out set_terminal(), fix salt bug (des wants ↵Rob Landley
the salt raw, no $ at the beginning).
2014-06-25Cleanup pass on mkpasswd.cRob Landley
2014-05-24patch from ashwini sharma: treat 0 length read at the start of password read ↵Rob Landley
as EOF.
2014-03-29Group headers by standard (POSIX or LSB) or function (internationalization, ↵Rob Landley
networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix.
2014-01-16Rename xmsprintf() to just xmprintf().Rob Landley
Partly because there's no supplied target string ala sprintf, and partly because I can never remember what order the m and s go in.
2013-12-23Attached is an implementation for groupdel.Ashwini Sharma
This is aliased to delgroup, for a requirement at my end. Also lib/password.c is modified to along with.
2013-11-03Fix off by one, pointed out by Ashwini Sharma.Rob Landley
2013-10-16Minor lib/password.c cleanup, described on the list. (Inline two functions.)Rob Landley
2013-10-16Prep work for useradd by Ashwini Sharma.Rob Landley
2012-11-13Reindent to two spaces per level. Remove vi: directives that haven't worked ↵Rob Landley
right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring.
2012-07-21Use "_password" instead of "_passwd" for names in lib/password.c.Rob Landley
2012-07-17Add passwd by Kyungwan Han.Rob Landley