-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
neutrinordp: Log the IP address, port, and user name of the NeutrioRDP Proxy connection. #1875
Conversation
Hi @TOMATO-ONE Firstly, thanks very much for taking the time to contribute to xrdp. I'll add some review comments to your code shortly. Here are a couple of other things:-
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments below.
At the moment logging the pid doesn't gain much, but if you get the disconnect logging added, the two messages can be linked by the administrator
Hi @TOMATO-ONE Thanks for contributing this patch. For your question about where to log the disconnection, you can try adding it to Also, since the point of this log message is to be able to correlate the connection and disconnection events, I'd suggest extracting the log message to a helper function to guarantee that all of the places (connect, failure, disconnect) that log this message log it consistently. |
I think either I think it makes sense to log |
@matt335672 to me it seems like the intent of the function |
@aquesnel - I'll go with that, particularly as the connect happens in |
@aquesnel @matt335672 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @TOMATO-ONE - some more comments for you
xrdp/xrdp.ini.in
Outdated
#pamusername=ask | ||
#pampassword=ask | ||
#pamsessionmng=127.0.0.1 | ||
#delay_ms=2000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the delay_ms
line from here as it only applies to VNC connections (see b66aafc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1f09ad9.
The reason why the LOG in neutorinordp.c was not shown in DEBUG in the disconnect log was simple: it was a binary that had not been built with the configure option --enable-xrdpdebug. Sorry about that. I'm checking the log again. |
Hi @TOMATO-ONE The Thanks for your efforts so far. |
Thank you. @matt335672 I was confused. Since the When I used the I followed @aquesnel's advice and used the The following log will be recorded.
|
Hi @TOMATO-ONE That all looks fine to me now - I take it the logging as-is meets your needs? Do you understand what 'squashing commits' is in git? It would be good to get a single commit for the above in the main-line repository. |
Hi @matt335672 I didn't know about 'squashing commits', so I learned. Am I right in thinking that I can run the following command and
I'm sorry to ask you such a basic question. |
Hi @TOMATO-ONE That's fine - we've all been there with git! Speaking personally, I found it quite hard to get started coming from a background including Subversion and Sun Teamware but I think it's worth the trouble. I'm assuming you've got a local repository on your machine which you're working on which you've cloned from your github copy. That command you've quoted will work fine in this case. Because you're working on your As you get more familiar with git, you'll find it's normally better to work on a change in a separate branch. The reason is that then it makes merging, squashing, etc a lot easier as your changes can be identified as belonging together. Here are some references for you:-
Hope that helps. |
…ction. #1873 Add comments to [vnc-any] and [neutrinordp-any] secion in xrdp.ini.in . Logging NeurionoRDP Proxy disconnect.
Hi @matt335672 Thank you very much for your kind help. I'm slowly learning more about git. Thank you for teaching me about branch separation. |
@TOMATO-ONE - thanks for your contribution. |
Thank you very much for your help. If you all had worked on this PR, you probably could have completed it in less than an hour. As an administrator of an RDP Proxy server, I am looking forward to #1338. Best regards. |
#1873
I made sure to log the IP address, port, and user name of the NeutrioRDP Proxy connection.
The following will be recorded in xrdp.log.
[20210503-17:07:11] [INFO ] NeutrinoRDP: connection [Success], destination [192.168.102.101:3389], username [user], source [192.168.0.212:62118], pamusername [xrdp], pid [7443]
I don't know the C language very well.
I made the patch as an example.
If you have better code, please let me know.
I would like to log the disconnect as well.
Where should I add the code in xrdp-neutrinordp.c?
Please advise.
Best regards