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 15status_t read_password(const char* prompt, char* password, size_t bufferSize, 16 bool useStdio); 17 18bool verify_password(passwd* passwd, spwd* spwd, const char* plainPassword); 19 20status_t authenticate_user(const char* prompt, passwd* passwd, spwd* spwd, 21 int maxTries, bool useStdio); 22status_t authenticate_user(const char* prompt, const char* user, 23 passwd** _passwd, spwd** _spwd, int maxTries, bool useStdio); 24 25status_t setup_environment(struct passwd* passwd, bool preserveEnvironment, 26 bool chngdir = true); 27 28 29#endif // MULTIUSER_UTILS_H 30