Changeset 1070


Ignore:
Timestamp:
01/05/10 14:29:35 (12 years ago)
Author:
landlord
Message:

New uniq level 3: only one connection per user, but only the last login will survive (old mpcs behavior)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Distribution/doc/man/oscam.user.5

    r1060 r1070  
    4040 \fB2\fP = set user to fake if source ip is different
    4141     (e.g. for newcamd clients with different CAIDs and ports)
     42 \fB3\fP = only one connection per user, but only the last login
     43     will survive (old mpcs behavior)
    4244.RE
    4345.PP
  • trunk/Distribution/doc/txt/oscam.user.txt

    r1060 r1070  
    3535       2 = set user to fake if source ip is different
    3636           (e.g. for newcamd clients with different CAIDs and ports)
     37       3 = only one connection per user, but only the last login
     38           will survive (old mpcs behavior)
    3739
    3840       sleep = minutes
  • trunk/oscam.c

    r1068 r1070  
    10431043static void cs_fake_client(char *usr, int uniq, in_addr_t ip)
    10441044{
    1045     /* - Uniq = 1: only one connection per user
    1046      * - Uniq = 2: set user only to fake if source ip is different (e.g. for
    1047      *             newcamd clients with different CAID's -> Ports)
    1048     */
     1045    /* Uniq = 1: only one connection per user
     1046     *
     1047     * Uniq = 2: set (new connected) user only to fake if source
     1048     *           ip is different (e.g. for newcamd clients with
     1049     *           different CAID's -> Ports)
     1050     *
     1051     * Uniq = 3: only one connection per user, but only the last
     1052     *           login will survive (old mpcs behavior)
     1053     */
    10491054
    10501055    int i;
     
    10521057    for (i=cdiff+1; i<CS_MAXPID; i++) {
    10531058        if (client[i].pid
    1054                 && (client[i].typ == 'c')
    1055                 && !client[i].dup
    1056                 && !strcmp(client[i].usr, usr)
    1057                 && ((uniq == 1)  || (client[i].ip != ip)))
    1058         {
    1059             client[cs_idx].dup = 1;
    1060             client[cs_idx].au = -1;
    1061             cs_log("client(%d) duplicate user '%s' from %s set to fake (uniq=%d)", cs_idx-cdiff, usr, cs_inet_ntoa(ip), uniq);
    1062             break;
    1063         }
     1059         && (client[i].typ == 'c')
     1060         && !client[i].dup
     1061         && !strcmp(client[i].usr, usr)
     1062         && ((uniq != 2) || (client[i].ip != ip)))
     1063          {
     1064       if (uniq == 3)
     1065        {
     1066         client[i].dup = 1;
     1067         client[i].au = -1;
     1068         cs_log("client(%d) duplicate user '%s' from %s set to fake (uniq=%d)", i-cdiff, usr, cs_inet_ntoa(ip), uniq);
     1069        }
     1070       else
     1071        {
     1072         client[cs_idx].dup = 1;
     1073         client[cs_idx].au = -1;
     1074         cs_log("client(%d) duplicate user '%s' from %s set to fake (uniq=%d)", cs_idx-cdiff, usr, cs_inet_ntoa(ip), uniq);
     1075         break;
     1076        }
     1077          }
    10641078    }
    10651079}
Note: See TracChangeset for help on using the changeset viewer.