Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
b28ac7df
Commit
b28ac7df
authored
Aug 12, 1992
by
Per Cederqvist
Browse files
Added time-out in get_real_username.
parent
5438ee07
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/server/ChangeLog
View file @
b28ac7df
Wed Aug 12 01:38:22 1992 Per Cederqvist (ceder@robin)
* rfc931.c (get_real_username): Introduce 20-second timeout. Log
any ident queries that takes more than 3 seconds. New argument:
hostname (only used for the log).
* connections.c (login_request): Send the new argument.
* log.c (logv): Print the log message on a single line, with the
time in the first 20 columns. (Facilitate log browsing).
Wed Aug 12 00:33:55 1992 Inge Wallin (inge@lysator)
* simple-cache.c(save_one_text): Write texts to file as long as
* simple-cache.c
(save_one_text): Write texts to file as long as
they are removed.
Thu Jun 11 16:28:39 1992 Per Cederqvist (ceder@lysator)
...
...
src/server/connections.c
View file @
b28ac7df
/*
* $Id: connections.c,v 0.
19
1992/0
6
/1
1 1
4:
3
2:5
4
ceder Exp $
* $Id: connections.c,v 0.
20
1992/0
8
/1
2 0
4:
1
2:5
3
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -30,7 +30,7 @@
* Created by Willf|r 31/3-90. Mostly written by ceder.
*/
static
char
*
rcsid
=
"$Id: connections.c,v 0.
19
1992/0
6
/1
1 1
4:
3
2:5
4
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: connections.c,v 0.
20
1992/0
8
/1
2 0
4:
1
2:5
3
ceder Exp $"
;
#include <errno.h>
...
...
@@ -781,7 +781,7 @@ login_request(IscEvent *event)
/* Get the real user name, as returned by the Ident protocol
(rfc 931). */
realuser
=
get_real_username
(
event
->
session
);
realuser
=
get_real_username
(
event
->
session
,
hostname
);
if
(
realuser
!=
NULL
)
s_crea_str
(
&
cp
->
ident_user
,
realuser
);
...
...
src/server/rfc931.c
View file @
b28ac7df
/*
* $Id: rfc931.c,v 1.
2
1992/0
4/01 20:32:03
ceder Exp $
* $Id: rfc931.c,v 1.
3
1992/0
8/12 04:12:57
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -36,22 +36,40 @@
#include <m-config.h>
#include "rfc931.h"
#include <authuser.h>
#include <errno.h>
#include "log.h"
#ifdef RFC_931
char
*
get_real_username
(
IscSession
*
scb
)
get_real_username
(
IscSession
*
scb
,
char
*
hostname
)
{
unsigned
long
inlocal
;
unsigned
long
inremote
;
unsigned
short
local
;
unsigned
short
remote
;
char
*
result
;
time_t
before
,
after
;
if
(
auth_fd2
(
scb
->
fd
,
&
inlocal
,
&
inremote
,
&
local
,
&
remote
)
==
-
1
)
return
NULL
;
return
auth_tcpuser2
(
inlocal
,
inremote
,
local
,
remote
);
time
(
&
before
);
result
=
auth_tcpuser3
(
inlocal
,
inremote
,
local
,
remote
,
20
);
if
(
result
==
NULL
&&
errno
==
ETIMEDOUT
)
log
(
"Identd request to %s timed out.
\n
"
,
hostname
);
else
{
time
(
&
after
);
if
(
difftime
(
after
,
before
)
>
3
)
log
(
"Identd request to %s yielded %s after %d seconds.
\n
"
,
hostname
,
result
==
NULL
?
"(null)"
:
result
,
(
int
)
difftime
(
after
,
before
));
}
return
result
;
}
#endif
src/server/rfc931.h
View file @
b28ac7df
/*
* $Id: rfc931.h,v 1.
1
1992/0
3/31 21:51:34
ceder Exp $
* $Id: rfc931.h,v 1.
2
1992/0
8/12 04:13:01
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -23,4 +23,5 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
char
*
get_real_username
(
IscSession
*
scb
);
char
*
get_real_username
(
IscSession
*
scb
,
char
*
hostname
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment