• external.bat not mapping complete pathname

    From Hemo@1:103/705 to All on Sun Feb 5 19:48:18 2017
    I recently migrated my data from a RHEL 6 box to a Ubunto 16.04 LTS box.

    after bringing over the data, I recompiled Synchronet for the new OS.

    Everything seems to be working fine, with the exception of every one of my dos doors.

    I can run them fine with dosemu locally, and today I tracked it down to external.bat isn't mapping the full pathname I have in SCFG for the door!

    I make the assumption is was when I was on the previous OS, because all the doors worked in a remote session just fine.

    If the pathname I have configured for the startup folder is: ../xtrn/dos/doorgame

    the external.bat that gets created in the node directory misses the last bit: lredir E: linux\fs\sbbs\xtrn\dos

    It doesn't seem to matter if I configure the path:
    ../xtrn/dos/doorgame/
    ../xtrn/dos/doorgame

    The external.bat still misses the last bit (doorgame). Drive E is supposed to be the location of the doorgame, and not the preceding directory, which is why all the games are failing to fire up.


    any thoughts? I may try moving one of the game 'up' a folder level and see if that has any impact..

    --
    Hemo

    ... Open mouth, insert foot, echo internationally.

    ---
    * Synchronet * - Running madly into the wind and screaming - bbs.ujoint.org
    * Origin: Vertrauen - vert.synchro.net (1:103/705)
  • From Hemo@1:103/705 to DIGITAL MAN on Tue Feb 7 15:30:14 2017
    Re: external.bat not mapping complete pathname
    By: Hemo to All on Sun Feb 05 2017 07:48 pm

    I recently migrated my data from a RHEL 6 box to a Ubunto 16.04 LTS box. after bringing over the data, I recompiled Synchronet for the new OS. Everything seems to be working fine, with the exception of every one of my dos doors.
    I can run them fine with dosemu locally, and today I tracked it down to external.bat isn't mapping the full pathname I have in SCFG for the door!

    DM -

    I think I tracked my problem down to the part of external.bat where it changes to drive E: and then is supposed to do a cd to the door folder. The line in external.bat is just printing 'cd' , and not 'cd door'.

    I know the code in xtrn.cpp hasn't changed recently, but was hoping you might have an idea why or how str[0] might be getting set to '\0' in this section of code starting at line 1555. I don't read cpp very well but this is what I think is happening, resulting in the empty 'cd' command:

    /* change to the drive where the parent of the startup_dir is mounted */ fprintf(dosemubat,"%s\r\n",xtrndrive);

    if(startup_dir!=NULL && startup_dir[0]) {

    SAFECOPY(str,startup_dir);

    /* if theres a trailing slash, dump it */

    p=lastchar(str);
    if (*p=='/') *p=0;

    if ((p=strrchr(str, '/'))!=NULL)
    SAFECOPY(str,p+1); /* str = game's starting dir */

    else str[0] = '\0';
    }

    else str[0] = '\0';

    fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */



    thoughts? I'm stumped why under this recent Ubuntu compile I started having this issue of losing the door folder name in the external.bat file .

    --
    Hemo

    ... I used to be schizophrenic, but we're alright now.

    ---
    * Synchronet * - Running madly into the wind and screaming - bbs.ujoint.org
    * Origin: Vertrauen - vert.synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Hemo on Tue Feb 7 16:43:24 2017
    Re: external.bat not mapping complete pathname
    By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm

    Re: external.bat not mapping complete pathname
    By: Hemo to All on Sun Feb 05 2017 07:48 pm

    I recently migrated my data from a RHEL 6 box to a Ubunto 16.04 LTS box. after bringing over the data, I recompiled Synchronet for the new OS. Everything seems to be working fine, with the exception of every one of my dos doors.
    I can run them fine with dosemu locally, and today I tracked it down to external.bat isn't mapping the full pathname I have in SCFG for the door!

    DM -

    I think I tracked my problem down to the part of external.bat where it changes to drive E: and then is supposed to do a cd to the door folder. The line in external.bat is just printing 'cd' , and not 'cd door'.

    I know the code in xtrn.cpp hasn't changed recently, but was hoping you might have an idea why or how str[0] might be getting set to '\0' in this section of code starting at line 1555. I don't read cpp very well but this is what I think is happening, resulting in the empty 'cd' command:

    /* change to the drive where the parent of the startup_dir is mounted */ fprintf(dosemubat,"%s\r\n",xtrndrive);

    if(startup_dir!=NULL && startup_dir[0]) {

    SAFECOPY(str,startup_dir);

    /* if theres a trailing slash, dump it */

    p=lastchar(str);
    if (*p=='/') *p=0;

    if ((p=strrchr(str, '/'))!=NULL)
    SAFECOPY(str,p+1); /* str = game's starting dir */

    else str[0] = '\0';
    }

    else str[0] = '\0';

    fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */



    thoughts? I'm stumped why under this recent Ubuntu compile I started having this issue of losing the door folder name in the external.bat file .

    What's the startup directory configured as for this door in SCFG?

    digital man

    Synchronet/BBS Terminology Definition #31:
    JS = JavaScript
    Norco, CA WX: 61.2oF, 84.0% humidity, 5 mph ESE wind, 0.10 inches rain/24hrs --- SBBSecho 3.00-Win32
    * Origin: Vertrauen - vert.synchro.net (1:103/705)
  • From Hemo@1:103/705 to Digital Man on Tue Feb 7 23:34:46 2017
    Re: external.bat not mapping complete pathname
    By: Digital Man to Hemo on Tue Feb 07 2017 04:43 pm

    Re: external.bat not mapping complete pathname
    By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm
    I think I tracked my problem down to the part of external.bat where it
    changes to drive E: and then is supposed to do a cd to the door
    folder. The line in external.bat is just printing 'cd' , and not 'cd
    door'.

    thoughts? I'm stumped why under this recent Ubuntu compile I started
    having this issue of losing the door folder name in the external.bat
    file .

    What's the startup directory configured as for this door in SCFG?

    I've tried each of the following variations with same results: ../xtrn/dos/lord
    ../xtrn/dos/lord/
    /sbbs/xtrn/dos/lord
    /sbbs/xtrn/dos/lord/

    Keeping in mind I am by no means a C/C++ programmer, by know just enough to figure some things out if I look hard enough.
    I edited xtrn.cpp and added a bunch of debug lines that would print out REM lines in the external.bat file and show me that value of str and startup_dir at various stages.

    so here is the code and the value of str at various stages, when I was using "../xtrn/dos/lord/" as the startup directory:

    if(startup_dir!=NULL && startup_dir[0]) {
    SAFECOPY(str,startup_dir);

    str=/sbbs/xtrn/dos/lord/

    /* if theres a trailing slash, dump it */
    p=lastchar(str);
    if (*p=='/') *p=0;

    str=/sbbs/xtrn/dos/lord

    if ((p=strrchr(str, '/'))!=NULL)
    SAFECOPY(str,p+1); /* str = game's starting dir */

    str=

    else str[0] = '\0';
    }
    else str[0] = '\0';
    fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */


    something with the SAFECOPY(str,p+1); instruction?

    I hammered in a kludge using basename(str) and a new char* , which seems to be working and setting the new value to "lord".

    I added "char* new_str;" at the top of the sbbs_t::external function
    and then commented out the "SAFECOPY(str,p+1);" code and put in "new_str = basename(str);" and edited the later fprintf to use tmp_str when writing out the "cd " command to external.bat

    It worked, I had no idea what I was doing, reading search results and trying things. I have no clue why this part of code would start behaving this way now that I compiled under Ubuntu with gcc version 5.4.0, but the stuff I changed seems to have it working for my system now.

    --
    Hemo

    ... A door is what a dog is perpetually on the wrong side of.


    ---
    * Synchronet * - Running madly into the wind and screaming - bbs.ujoint.org
    * Origin: Vertrauen - vert.synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Hemo on Wed Feb 8 23:01:36 2017
    Re: external.bat not mapping complete pathname
    By: Hemo to Digital Man on Tue Feb 07 2017 11:34 pm

    Re: external.bat not mapping complete pathname
    By: Digital Man to Hemo on Tue Feb 07 2017 04:43 pm

    Re: external.bat not mapping complete pathname
    By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm
    I think I tracked my problem down to the part of external.bat where it
    changes to drive E: and then is supposed to do a cd to the door
    folder. The line in external.bat is just printing 'cd' , and not 'cd
    door'.

    thoughts? I'm stumped why under this recent Ubuntu compile I started
    having this issue of losing the door folder name in the external.bat
    file .

    What's the startup directory configured as for this door in SCFG?

    I've tried each of the following variations with same results: ../xtrn/dos/lord
    ../xtrn/dos/lord/
    /sbbs/xtrn/dos/lord
    /sbbs/xtrn/dos/lord/

    Keeping in mind I am by no means a C/C++ programmer, by know just enough to figure some things out if I look hard enough.
    I edited xtrn.cpp and added a bunch of debug lines that would print out REM lines in the external.bat file and show me that value of str and startup_dir at various stages.

    so here is the code and the value of str at various stages, when I was using "../xtrn/dos/lord/" as the startup directory:

    if(startup_dir!=NULL && startup_dir[0]) {
    SAFECOPY(str,startup_dir);

    str=/sbbs/xtrn/dos/lord/

    /* if theres a trailing slash, dump it */
    p=lastchar(str);
    if (*p=='/') *p=0;

    str=/sbbs/xtrn/dos/lord

    if ((p=strrchr(str, '/'))!=NULL)
    SAFECOPY(str,p+1); /* str = game's starting dir */

    str=

    That's odd. If you replace that "SAFECOPY" call with "strcpy", does the same problem happen?

    I didn't write this code, nor have I ever used it or tested it, but from reading it, 'p' should point to the last slash ('/') in 'str' (in your case, the one in "/lord") and 'p+1' would point to just "lord", so str should equal "lord".

    else str[0] = '\0';
    }
    else str[0] = '\0';
    fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */


    something with the SAFECOPY(str,p+1); instruction?

    Perhaps. Try using strcpy() instead, just as a test.

    I hammered in a kludge using basename(str) and a new char* , which seems to be working and setting the new value to "lord".

    I added "char* new_str;" at the top of the sbbs_t::external function
    and then commented out the "SAFECOPY(str,p+1);" code and put in "new_str = basename(str);" and edited the later fprintf to use tmp_str when writing out the "cd " command to external.bat

    That should work too.

    It worked, I had no idea what I was doing, reading search results and trying things. I have no clue why this part of code would start behaving this way now that I compiled under Ubuntu with gcc version 5.4.0, but the stuff I changed seems to have it working for my system now.

    Cool. The old code should've worked too, so that is mysterious.

    digital man

    Synchronet/BBS Terminology Definition #12:
    DCE = Data Communications Equipment (or Deuce, Stephen Hurd)
    Norco, CA WX: 59.3oF, 95.0% humidity, 0 mph SW wind, 0.02 inches rain/24hrs
    --- SBBSecho 3.00-Win32
    * Origin: Vertrauen - vert.synchro.net (1:103/705)
  • From Hemo@1:103/705 to Digital Man on Sun Feb 12 21:00:22 2017
    Re: external.bat not mapping complete pathname
    By: Digital Man to Hemo on Wed Feb 08 2017 11:01 pm

    Digital Man wrote to Hemo <=-b 10 2017 GCC 5.4.0

    Re: external.bat not mapping complete pathname
    By: Hemo to Digital Man on Tue Feb 07 2017 11:34 pm

    Re: external.bat not mapping complete pathname
    By: Digital Man to Hemo on Tue Feb 07 2017 04:43 pm

    Re: external.bat not mapping complete pathname
    By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm
    so here is the code and the value of str at various stages, when I was using "../xtrn/dos/lord/" as the startup directory:

    if(startup_dir!=NULL && startup_dir[0]) {
    SAFECOPY(str,startup_dir);

    str=/sbbs/xtrn/dos/lord/

    /* if theres a trailing slash, dump it */
    p=lastchar(str);
    if (*p=='/') *p=0;

    str=/sbbs/xtrn/dos/lord

    if ((p=strrchr(str, '/'))!=NULL)
    SAFECOPY(str,p+1); /* str = game's starting dir */

    str=

    That's odd. If you replace that "SAFECOPY" call with "strcpy", does the same problem happen?

    strcpy works just fine.

    I'm updating to use strcpy(), since it's cleaner than the kludge I hammered in.

    of course, now I have this nagging feeling in the back of my head that wants to find out _why_ it stopped working as expected..

    thanks,

    --
    Hemo

    ... A oscillator will oscillate at the wrong frequency ...if it oscillates.

    ---
    * Synchronet * - Running madly into the wind and screaming - bbs.ujoint.org
    * Origin: Vertrauen - vert.synchro.net (1:103/705)