Solved

Git Check Time of Client

Posted on 2016-09-12
2
17 Views
Last Modified: 2016-10-03
We need to check time of Client from where user is connecting to git server & refuse the connection if the time difference between the server & client is not correct by some margin.

Example : if the time on Server is 18:00 UTC & the time of client is 21:00 UTC, I would like to refuse connection.

I believe this should be forced at Linux Server Level.Please let me know how to accomplish this.
0
Comment
Question by:sivaatluri
  • 2
2 Comments
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points (awarded by participants)
ID: 41797161
I think you will have to write your own solution. What you need to do is connect to the client system on port 37 (the timeserver port) and read the client's idea of the time from there, as per RFC 868. This requires that clients support time service: under Linux, inetd supports time as an internal service (so it has to be enabled in /etc/inetd.conf); under Windows I do not know what to do, but likely you additionally have to enable port 37 in the firewall.
You can get a report of the time difference from the netdate utility (not run as root ;)
11:08:53$ netdate dwarfstar
netdate: settimeofday: Operation not permitted
dwarfstar -11.352        Wed Sep 14 11:11:17.000
11:11:28$ 

Open in new window

Slackware has had netdate for ever. It's very old, and I couldn't easily find it on the web. I can post the source as an attachment if you like - it's only about 500 lines.

Do you need a plan for integrating your solution with the git server?
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 41826014
The proposed solution is certainly valid as far as it goes. It does require some effort on the part of the author to implement a working solution, but describes the steps necessary to achieve one.
The author has not seen fit to respond , so we have to assume he is content with this partial solution, and close it with a 'B'.
Should the author wish to keep the question open, he has 4 days to object to the proposed closure.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
How to create a branch, fetch changes, and merge them into another branch using the EGit plugin for Eclipse.
How to create a Git repository using GitHub, and how to clone and checkout the repository using the EGit plugin for Eclipse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now