2014-11-24 20:23:48 +03:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
|
|
|
* Copyright (C) Jay Sorg 2005-2014
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2014-11-21 16:22:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2014-11-21 17:00:01 +03:00
|
|
|
* @file verify_user_bsd.c
|
2014-11-21 16:22:15 +03:00
|
|
|
* @brief Authenticate user using BSD password system
|
|
|
|
* @author Renaud Allard
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-03-03 07:33:23 +03:00
|
|
|
#if defined(HAVE_CONFIG_H)
|
|
|
|
#include <config_ac.h>
|
|
|
|
#endif
|
|
|
|
|
2014-11-21 16:22:15 +03:00
|
|
|
#include "sesman.h"
|
|
|
|
|
|
|
|
#define _XOPEN_SOURCE
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <login_cap.h>
|
|
|
|
#include <bsd_auth.h>
|
|
|
|
|
|
|
|
#ifndef SECS_PER_DAY
|
|
|
|
#define SECS_PER_DAY (24L*3600L)
|
|
|
|
#endif
|
|
|
|
|
2020-11-30 03:36:20 +03:00
|
|
|
extern struct config_sesman *g_cfg; /* in sesman.c */
|
2014-11-21 16:22:15 +03:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* returns boolean */
|
2017-03-12 19:35:00 +03:00
|
|
|
long
|
2016-10-17 09:14:06 +03:00
|
|
|
auth_userpass(const char *user, const char *pass, int *errorcode)
|
2014-11-21 16:22:15 +03:00
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
int ret = auth_userokay(user, NULL, "auth-xrdp", pass);
|
|
|
|
return ret;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* returns error */
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-21 16:22:15 +03:00
|
|
|
auth_start_session(long in_val, int in_display)
|
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-21 16:22:15 +03:00
|
|
|
auth_end(long in_val)
|
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-21 16:22:15 +03:00
|
|
|
auth_set_env(long in_val)
|
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-10-17 09:14:06 +03:00
|
|
|
auth_check_pwd_chg(const char *user)
|
2014-11-21 16:22:15 +03:00
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-10-17 09:14:06 +03:00
|
|
|
auth_change_pwd(const char *user, const char *newpwd)
|
2014-11-21 16:22:15 +03:00
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-21 17:00:01 +03:00
|
|
|
auth_stop_session(long in_val)
|
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 17:00:01 +03:00
|
|
|
}
|
|
|
|
|
2014-11-21 16:22:15 +03:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @brief Password encryption
|
|
|
|
* @param pwd Old password
|
|
|
|
* @param pln Plaintext new password
|
|
|
|
* @param crp Crypted new password
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-03-12 19:35:00 +03:00
|
|
|
static int
|
2016-11-07 07:01:49 +03:00
|
|
|
auth_crypt_pwd(const char *pwd, const char *pln, char *crp)
|
2014-11-21 16:22:15 +03:00
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return 1 if the account is disabled, 0 otherwise
|
|
|
|
*
|
|
|
|
*/
|
2017-03-12 19:35:00 +03:00
|
|
|
static int
|
2020-11-30 03:36:20 +03:00
|
|
|
auth_account_disabled(struct spwd *stp)
|
2014-11-21 16:22:15 +03:00
|
|
|
{
|
2014-11-24 20:23:48 +03:00
|
|
|
return 0;
|
2014-11-21 16:22:15 +03:00
|
|
|
}
|