2
* pw_rand.c --- generate completely random (and hard to remember)
5
* Copyright (C) 2001 by Theodore Ts'o
7
* This file may be distributed under the terms of the GNU Public
13
#define FIRST_CHAR '!'
16
static char bad_chars[] = "'\\\"";
18
void pw_rand(char *buf, int size, int pw_flags)
24
ch = pw_random_number(LAST_CHAR - FIRST_CHAR) + FIRST_CHAR;
25
if (strchr(bad_chars, ch))