1 /* 2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef MULTIUSER_UTILS_H 6 #define MULTIUSER_UTILS_H 7 8 #include <pwd.h> 9 #include <shadow.h> 10 #include <stdio.h> 11 12 #include <SupportDefs.h> 13 14 15 status_t read_password(const char* prompt, char* password, size_t bufferSize, 16 bool useStdio); 17 18 bool verify_password(passwd* passwd, spwd* spwd, const char* plainPassword); 19 20 status_t authenticate_user(const char* prompt, passwd* passwd, spwd* spwd, 21 int maxTries, bool useStdio); 22 status_t authenticate_user(const char* prompt, const char* user, 23 passwd** _passwd, spwd** _spwd, int maxTries, bool useStdio); 24 25 26 #endif // MULTIUSER_UTILS_H 27