termux-packages/x11-packages/xrdp/termux-dont-have-shadow.patch

94 lines
1.9 KiB
Diff

diff -uNr xrdp-0.9.15/sesman/verify_user.c xrdp-0.9.15.mod/sesman/verify_user.c
--- xrdp-0.9.15/sesman/verify_user.c 2020-12-28 14:03:43.000000000 +0000
+++ xrdp-0.9.15.mod/sesman/verify_user.c 2021-02-09 20:39:29.340212904 +0000
@@ -33,8 +33,10 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
+#ifndef __ANDROID__
#include <crypt.h>
#include <shadow.h>
+#endif
#include <pwd.h>
#ifndef SECS_PER_DAY
@@ -43,17 +45,20 @@
extern struct config_sesman *g_cfg; /* in sesman.c */
+#ifndef __ANDROID__
static int
auth_crypt_pwd(const char *pwd, const char *pln, char *crp);
static int
auth_account_disabled(struct spwd *stp);
+#endif
/******************************************************************************/
/* returns boolean */
long
auth_userpass(const char *user, const char *pass, int *errorcode)
{
+#ifndef __ANDROID__
const char *encr;
const char *epass;
struct passwd *spw;
@@ -95,6 +100,9 @@
return 0;
}
return (strcmp(encr, epass) == 0);
+#else
+ return 1;
+#endif
}
/******************************************************************************/
@@ -131,6 +139,7 @@
int
auth_check_pwd_chg(const char *user)
{
+#ifndef __ANDROID__
struct passwd *spw;
struct spwd *stp;
int now;
@@ -181,13 +190,14 @@
/* cannot change pwd for now */
return AUTH_PWD_CHG_NOT_NOW;
}
-
+#endif
return AUTH_PWD_CHG_OK;
}
int
auth_change_pwd(const char *user, const char *newpwd)
{
+#ifndef __ANDROID__
struct passwd *spw;
struct spwd *stp;
char hash[35] = "";
@@ -248,6 +258,9 @@
ulckpwdf();
return 0;
+#else
+ return 1;
+#endif
}
/**
@@ -258,7 +271,7 @@
* @param crp Crypted new password
*
*/
-
+#ifndef __ANDROID__
static int
auth_crypt_pwd(const char *pwd, const char *pln, char *crp)
{
@@ -335,3 +348,4 @@
return 0;
}
+#endif // __ANDROID__