]> git.ozlabs.org Git - ppp.git/blobdiff - sunos4/ppp_vdcmd.c
leave the real user ID as the user's now
[ppp.git] / sunos4 / ppp_vdcmd.c
index 1e3853a564d6b8c9b35752e8b8d1d86470b9b238..68095c92ec7cf9de6a4a8729954dc9ee58c6cb95 100644 (file)
@@ -28,6 +28,7 @@ ppp_vdcmd(fun, vdp, vdi, vds)
     addr_t vdi;
     struct vdstat *vds;
 {
+    static int majnum = -1;
     int n, maj;
 
     switch (fun) {
@@ -46,6 +47,7 @@ ppp_vdcmd(fun, vdp, vdi, vds)
        cdevsw[maj] = ppp_cdevsw;
        vd.Drv_cdevsw = &ppp_cdevsw;
        vdp->vdd_vdtab = (struct vdlinkage *) &vd;
+       majnum = maj;
        break;
 
     case VDUNLOAD:
@@ -56,6 +58,20 @@ ppp_vdcmd(fun, vdp, vdi, vds)
        break;
 
     case VDSTAT:
+       /*
+        * We have to fool the modstat command into thinking
+        * that this module is actually a driver! This is
+        * so that installation commands that use the -exec
+        * option of modload to run a shell script find out
+        * the block and/or char major numbers of the driver
+        * loaded (so that the shell script can go off to
+        * /dev and *MAKE* the bloody device nodes- remember
+        * they might change from one load to another if
+        * you don't hardwire the number!).
+        */
+       vds->vds_magic = VDMAGIC_DRV;
+       vds->vds_modinfo[0] = (char) 0;
+       vds->vds_modinfo[1] = (char) majnum;
        break;
 
     default: