50 size_t userlen = strlen (username);
55 fh = fopen (filename,
"r");
60 if (getline (&line, &n, fh) < 0)
66 if (line[strlen (line) - 1] ==
'\r')
67 line[strlen (line) - 1] =
'\0';
68 if (line[strlen (line) - 1] ==
'\n')
69 line[strlen (line) - 1] =
'\0';
71 if (strncmp (line, username, userlen) == 0 && line[userlen] ==
'\t')
73 *key = malloc (strlen (line) - userlen);
80 strcpy (*key, line + userlen + 1);
@ GSASL_AUTHENTICATION_ERROR
int gsasl_simple_getpass(const char *filename, const char *username, char **key)