On Thu, 16 Nov 2000, Alex. B wrote:
> Cum pot sa folosesc maxconn pt ca un user sa nu poata
> sa se logheze de la mai multe calculatoare ...(daca se
> poate)
> Deci cu alte cuvinte sa aiba doar mai multe conexiuni
> de la acelasi calculator(IP) si altcineva de la alt
> calculator(alt IP) sa nu poata intra cu passwd si
> user-ul acelei persoane care deja este logata!
# TAG: authenticate_ip_ttl
# With this option you control how long a proxy authentication
# will be bound to a specific IP address. If a request using
# the same user name is received during this time then access
# will be denied and both users are required to reauthenticate
# them selves. The idea behind this is to make it annoying
# for people to share their password to their friends, but
# yet allow a dialup user to reconnect on a different dialup
# port.
# The default is 0 to disable the check. Recommended value
# if you have dialup users are no more than 60 (seconds). If
# all your users are stationary then higher values may be
# used.
#authenticate_ip_ttl 0
Nu este poate chiar ceea ce vrei tu, dar alta metoda nu cred sa existe
fara modificari in sursa... (redirectorul primeste decat ipul,
autentificatorul decat usernameul -- ar trebui sa existe ceva care sa le
primeasca pe amandoua pt a implementa ceva gen TTL la user/password/ip)..
Daca te apuci sa modifici sursa, in acl.c functia aclMatchProxyAuth:
-----
} else {
/* user has switched to another IP addr */
debug(28, 1) ("aclMatchProxyAuth: user '%s' has changed IP \
address\n", user);
/* remove this user from the hash, making him unknown */
hash_remove_link(proxy_auth_cache, (hash_link *) auth_user);
aclFreeProxyAuthUser(auth_user);
/* require the user to reauthenticate */
return -2;
}
----
comentezi hash_remove... si aclFree..., so in momentul in care va sosi un
user/parola corect de pe alt IP (si timpul de autentificare nu a trecut),
ii va da reject (return -2).
Insa, "piratul" poate sa incerce user/parolagresita :))
In momentul asta, squid-ul invalideaza parola veche din cache (inclusiv
IPul vechi), si trimite requestul la authentificator (care va spune
REJECT). Dar acum, nu se mai afla in hash-ul squidului vechiul IP. So,
acum piratul poate sa incerce cu combinatia corecta user/parola.
Pentru a-l impiedica sa faca treaba asta, il faci ca o parola gresita sa
nu scoata din memorie o parola valida. De altfel, nu cred ca se schimba
parolele din 5 in 5 minute.
In sursa, squidul trateaza identic o parola gresita sau o parola venita
dupa TTL
----
else {
debug(28, 4) ("aclMatchProxyAuth: user '%s' password \
mismatch/timeout\n", user);
/* remove this user from the hash, making him unknown */
hash_remove_link(proxy_auth_cache, (hash_link *) auth_user);
aclFreeProxyAuthUser(auth_user);
/* ask the external authenticator in case the password is changed */
/* wrong password will be trapped above so this does not loop */
return -1;
}
-- devine ceva de genu >>>
else if (auth_user->expiretime > current_time.tv_sec) {
/* Timeoutul expirat. Scoatem combinatia u/p din cache */
hash_remove_link(proxy_auth_cache, (hash_link *) auth_user);
aclFreeProxyAuthUser(auth_user);
/* Si il trimitem la authetificator
return -1;
else {
/* Parola invalida */
return -2;
}
-----
Ca performante, squidul nu ar fi afectat (dimpotriva, il mai scapi de
niste requesturi la autentificator), nu declari/aloci nici macar un int
(dupa ce am invatat perl, am oroare de lucru cu string-uri/pointeri in C)
Best regards,
Claudiu Filip
PS: Chiar ai nevoie de asa ceva?!!
---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to
unsubscribe from this list.