Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#1441 closed Bug / Defect (notabug)

Client-disconnect is given client-connect time_unix value

Reported by: tct Owned by:
Priority: minor Milestone:
Component: Generic / unclassified Version: OpenVPN git master branch (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc:

Description (last modified by tct)

When scripts run they are given a value for time_unix, which is the time at which the script is executed.

Client-disconnect script does not get the current time for when the script is executed, it is given the time value for when client-connect was executed.

Client-connect env:

time_unix=1638198649
time_ascii=2021-11-29 15:10:49
username=deb10
daemon_pid=2404662

Client-disconnect env:

time_unix=1638198649
time_ascii=2021-11-29 15:10:49
time_duration=95
username=deb10
daemon_pid=2404662

This is the single occurrence of time_unix in the entire source (multi.c:1742):

    /* setenv connection time */
    {
        const char *created_ascii = time_string(mi->created, 0, false, &gc);
        setenv_str(mi->context.c2.es, "time_ascii", created_ascii);
        setenv_long_long(mi->context.c2.es, "time_unix", mi->created);
    }

Change History (3)

comment:1 Changed 12 months ago by tct

Description: modified (diff)

comment:2 Changed 12 months ago by tct

Description: modified (diff)

comment:3 Changed 12 months ago by tct

Resolution: notabug
Status: newclosed

According to the manual (and plaisthos):

time_unix

Client connection timestamp, formatted as a unix integer date/time value. Set prior to execution of the --client-connect script.

time_unix is a connection timestamp not a script execution timestamp.

Last edited 12 months ago by tct (previous) (diff)
Note: See TracTickets for help on using tickets.