From: akallabeth Date: Tue, 2 Jun 2020 12:41:37 +0000 (+0200) Subject: Fixed fallback to getlogin for android X-Git-Tag: 2.1.2^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=813204554db9da5d695f596282cbb9793428446f;p=platform%2Fupstream%2Ffreerdp.git Fixed fallback to getlogin for android (cherry picked from commit caff01877d4df5f25a983b3aa5e57dde6a16a62f) --- diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 3214398..98f526d 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -600,8 +600,12 @@ static BOOL isAutomountLocation(const char* path) uid_t uid = getuid(); char uname[MAX_PATH] = { 0 }; +#ifndef getlogin_r + strncpy(uname, getlogin(), sizeof(uname)); +#else if (getlogin_r(uname, sizeof(uname)) != 0) return FALSE; +#endif if (!path) return FALSE; diff --git a/winpr/libwinpr/sspicli/sspicli.c b/winpr/libwinpr/sspicli/sspicli.c index 220f1e1..671df6e 100644 --- a/winpr/libwinpr/sspicli/sspicli.c +++ b/winpr/libwinpr/sspicli/sspicli.c @@ -206,8 +206,12 @@ BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG switch (NameFormat) { case NameSamCompatible: +#ifndef getlogin_r + strncpy(login, getlogin(), sizeof(login)); +#else if (getlogin_r(login, sizeof(login)) != 0) return FALSE; +#endif length = strlen(login); if (*nSize >= length)