delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/26/03:16:38

From: "Tom Demmer" <DEMMER AT brain1 DOT lstm DOT ruhr-uni-bochum DOT de>
Organization: Lehrstuhl Stroemungsmechanik, RUB
To: Raul Mejia <rmejia AT HOST DOT ucuenca DOT edu DOT ec>, djgpp AT delorie DOT com
Date: Wed, 26 Nov 1997 09:14:07 GMT-1
Subject: Re: djgpp 2.0 and netware
Reply-to: Demmer AT LStM DOT Ruhr-Uni-Bochum DOT De
Message-ID: <A09E73A29FC@brain1.lstm.ruhr-uni-bochum.de>

> Has somebody installed djgpp 2.0 in netware.  I am a professor and I want to
> use djgpp with netware.
> 
> I have a big trouble:
> 
> The cwsdpmi require a file for swaping.  But in netware i can't use only one
> file, I need a file for each computer connected to the server.  How I can
> use different files for the swapping processes.
> 
> Please help me
> 
> 
Swapping over the net is slow, so you shouldn't do that. Do
swap to a local disk, if possible.

If you have diskless clients, it's a bit trickier. You do need a free 
drive letter, access to login scripts, and supervisor rights (if you 
want to do this for _all_ users)
Now, let's presume the drive is T:\ . 
1) Edit cwsdpmi.exe with cwsparam  and set the swapfile to 
T:\cwsdmpi.swp

2) Create a subdirectory on the server
\\SERVER:SYS/swapfiles
and give all users Read/Write/Create rights. This _is_ a security 
breach (I'm still thinking about that...)

3) In the system login script, add the line
DOS SET MACHINE="%P_STATION"
This sets an environment variable containing the MAC address of the 
ethernet card of this station. I once had a script to extract 8 
letters from it, but I cannot find that. So let's do it in C...

This is for Turbo-C:

#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <time.h>
#include <io.h>
#include <dos.h>
#include <sys/stat.h>
#include <fcntl.h>

/* Where to put files */
#define BASEDIR "sys:swapfiles/"
char tsName[128] = BASEDIR;
/* Shrink executable */
extern unsigned  _heaplen=2048, _stklen=1024; 

int  main(int argc,char **argv){
     char cmd[256];
     char *s = getenv("MACHINE")+1;
     /* construct the directory name */
     /* we use the rear parts to avoid clashes */
     strncat(tsName,s+1,8);
     strcat(tsName,".");
     s += 9;
     strncat(tsName,s,3);
     /*
     ** Create directory. This may fail if it 
     ** exists, but don't care
     */
     mkdir(tsName);
     /* Make syscommand */
     sprintf(cmd,"map root t:=%s",tsName);
     return system(cmd));
}
This ain't tested, so beware.

Run this file in the login script after the DOS SET MACHINE line.
And hope for the best. What you should get is a drive mapping

T:\= sys/swapfiles/unique_mac_address_number/

By now I have an idea how to close the breach, but it is tedious:

Run the above program on every client as SUPERVISOR. So you'll end up 
with a bunch of empty directories. In every directory, create an empty
cwsdpmi.swp file. grant everybody for each file 
Read/Write/Access/Modify rights, but _no_ Create. So users can 
read/write the swapfile. Hmm. Can they delete it? Not sure about that.
And I don't know if cwsdpmi really wants to create a new swapfile, or 
if it can live happily with just opening it.

Oh yes, and please drop me a note if this really works. My ideas 
before the coffee break tend to have some gotchas...

Ciao
Tom

  ******************************************************************
  *  Thomas Demmer                     * Phone : +49 234 700 6434  *
  *  Universitaetsstr. 150             * Fax   : +49 234 709 4162  *
  *  Lehrstuhl fuer Stroemungsmechanik *                           *
  *  D-44780 Bochum                    *                           *
  ******************************************************************
  *  Email: demmer AT LStM DOT Ruhr-Uni-Bochum DOT De                         *
  *  WWW:   http://www.lstm.ruhr-uni-bochum.de/~demmer             *
  ******************************************************************

    Erotic (adj): using a feather as a sex aid.
    Kinky (adj) : using the whole duck.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019