Giter Club home page Giter Club logo

xrdp-patch's Introduction

xrdp-patch

Script based on: http://www.c-nergy.be/blog

Set Client IP from Session as Environmental Variable

neutrinolabs/xrdp#2221

--- a/sesman/session.c
+++ b/sesman/session.c
@@ -587,6 +587,16 @@ session_start_fork(tbus data, tui8 type, struct SCP_SESSION *s)
         }
         else if (window_manager_pid == 0)
         {
+            if (s->connection_description != NULL)
+            {
+                char ip[64];
+                g_get_ip_from_description(s->connection_description,
+                                          ip, sizeof(ip));
+                list_add_item(g_cfg->env_names,
+                             (tintptr) g_strdup("REMOTE_CLIENT_IP"));
+                list_add_item(g_cfg->env_values, (tintptr) g_strdup(ip));
+            }
+
             wait_for_xserver(display);
             env_set_user(s->username,
                          0,

install


wget https://raw.githubusercontent.com/itxworks/xrdp-patch/main/xrdp-installer-1.3.1-itx.sh

chmod +x xrdp-installer-1.3.1-itx.sh

./xrdp-installer-1.3.1-itx.sh -c -s


xrdp-patch's People

Contributors

itxworks avatar mx2x avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.