• src/sbbs3/js_user.c

    From rswindell@VERT to CVS commit on Wednesday, June 06, 2018 19:21:26
    src/sbbs3 js_user.c 1.103 1.104
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_user.c
    Log Message:
    Improve JS User class/object reads across a local network by leaving the user.dat file open (for read operations only). Writing still opens and
    closes the user.dat for each property/field modification.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, June 06, 2018 19:35:50
    src/sbbs3 js_user.c 1.104 1.105
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_user.c
    Log Message:
    Updated the JSDOC description of a few User properties.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, August 06, 2018 17:49:21
    src/sbbs3 js_user.c 1.105 1.106
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_user.c
    Log Message:
    js_CreateUserObject(): if passed an internal user_t representation, the
    user data is thusly cached - set the 'cached' property member to TRUE. This prevents an unnecessary re-read of the user file and the leaving the user file (user.dat) open, at least for JS contexts that contain a "user" object. I don't think this explains the "too many open files" errors, but it explains at least *some* number of the user.dat open file descriptors.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, August 06, 2018 19:16:26
    src/sbbs3 js_user.c 1.106 1.107
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_user.c
    Log Message:
    If the user number is 0, don't open the user file (user.dat) - the read
    of the user record is going to fail anyway. *this* explains a lot of
    instances of the user.dat file being open concurrently, at least one per
    active thread with a JS context.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, January 10, 2019 11:53:09
    src/sbbs3 js_user.c 1.107 1.108
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv17399

    Modified Files:
    js_user.c
    Log Message:
    JSDOCS: Better example for User object creation.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, July 14, 2019 23:53:47
    src/sbbs3 js_user.c 1.110 1.111
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv32210

    Modified Files:
    js_user.c
    Log Message:
    Fix issues with the feature added in rev 1.96 by deuce, Jun 17 2012:
    Setting user.security.flags[1-4], exemptions, or restrictions to a string value would result in unexpected modified values:

    1. The exiting flags were all based on the current value of flags1 (copy/paste
    error it appears)
    2. The set/removed/added flags were all "off-by-one" because str_to_bits()
    treats 'A' as bit-1, not bit-0.

    emailval.js is now using this feature and PSI-Jack reported the "interesting" behavior. :-)


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Saturday, August 17, 2019 21:27:48
    src/sbbs3 js_user.c 1.111 1.112
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv32518

    Modified Files:
    js_user.c
    Log Message:
    Don't return negative values from user.get_time_left(), instead, clamp to INT32_MAX.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Saturday, August 17, 2019 21:42:51
    src/sbbs3 js_user.c 1.112 1.113
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv1954

    Modified Files:
    js_user.c
    Log Message:
    Add note to user.get_time_left() documentation that you likely want bbs.get_time_left() instead.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, August 20, 2019 18:32:09
    src/sbbs3 js_user.c 1.113 1.114
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv11883

    Modified Files:
    js_user.c
    Log Message:
    Address MSVC2019 warning C4244:
    '=': conversion from 'time_t' to 'unsigned long', possible loss of data



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Friday, April 03, 2020 01:42:58
    src/sbbs3 js_user.c 1.115 1.116
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv21606

    Modified Files:
    js_user.c
    Log Message:
    ARES cannot be compared!




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, August 10, 2020 20:54:58
    src/sbbs3 js_user.c 1.118 1.119
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv7146

    Modified Files:
    js_user.c
    Log Message:
    The MOUSE user setting flag is bit 31 (1<<31). Modifying a user.setting property with bit 31 set would result in a user.setting value of 0xffffffff which means the user is both deleted and inactive (all bits are set).
    JS_ValueToInt32() does "bad things" when bit-31 is set in the value being converted, use JS_ValueToECMAInt32 or JS_ValueToECMAUint32 instead.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Saturday, October 03, 2020 12:55:26
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/7faa8a64b0ff3506e3f1fc5f
    Modified Files:
    src/sbbs3/js_user.c
    Log Message:
    Add user properties: birthyear, birthmonth, and birthday

    These allow the easy reading or writing of these sub-field values of the user.birthdate property. When migrating from the legacy formats (e.g. MM/DD/YY or DD/MM/YY), it's required to write all 3 properties to get a correct birthdate/age. Otherwise, "13/31/69" could become "19691/69" (for example) which isn't going to parse correctly.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Saturday, October 03, 2020 16:30:58
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/fe2b242524ada9e70c4d1410
    Modified Files:
    src/sbbs3/js_user.c
    Log Message:
    Allow negative user property values (e.g. age).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wednesday, May 18, 2022 15:32:02
    https://gitlab.synchro.net/main/sbbs/-/commit/65e938974bfeac3448008bfc
    Modified Files:
    src/sbbs3/js_user.c
    Log Message:
    Fix User.number increment beyond lastuser issue

    When the 'number' property of an instance of User was incremented beyond the last user, the call to fgetuserdat() on subsequent property 'get' operation would fail and zero-out the user structure (including the user number). This resulted in an infinite loop in load/birthdays.js where the user number would go from lastuser to 1 in one operation (u.number++).

    Reported by DesotoFireflite (VALHALLA)

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tuesday, May 31, 2022 18:28:27
    https://gitlab.synchro.net/main/sbbs/-/commit/e731ac184d1bb5613cf6fc5f
    Modified Files:
    src/sbbs3/js_user.c
    Log Message:
    Don't clobber an open user.dat file descriptor in js_CreateUserObject()

    Likely fix for the user.dat open file descriptor leak:
    If js_CreateUserObject(cx,parent,cfg,"name",...) is called multiple times
    (e.g. before login and after login), the successive calls will reuse the previously allocated JS object and allocated private data memory. However, the private data memory (which includes the descriptor of an open user.dat file,
    if it has been opened), was always zeroed, even if it was being reused. This would leak open file descriptor.

    So any (pre)login scripts or web scripts that use the "user" object (which
    is all zeroed-out before login) and then allows a user to subsequently login, would leak a file descriptor.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Saturday, June 11, 2022 14:30:02
    https://gitlab.synchro.net/main/sbbs/-/commit/a87cebdb79abc7bdbd163df9
    Modified Files:
    src/sbbs3/js_user.c
    Log Message:
    Add User close() method

    This can be used to force a close of the user.dat file, if open. Rather than waiting for an out of scope User to get garbage-collected, this method could
    be used to force a close of the user.dat file, if it's open.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net