[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MultiTOS patch



--- dosmem.c.orig	Tue Dec 20 20:53:46 1994
+++ dosmem.c	Mon Jan  2 19:41:06 1995
Hi all,

here's a little patch for MultiTOS: I remember someone wanting correct
access rights for programs running under GEM, because gem.sys only allows
to be run with root rights. So, after applying this patch, you can make
your gem.sys set-uid root, and all programs started by AESSYS run under
the uid from which the AES was started. I have a user named "gem" (uid
102) in my /etc/passwd, with /usr/multitos (which is a symlink to
/c/multitos) as home and execmtos from the virtual consoles package as
shell. With the virtual consoles, I can type "gem" on the login screen of
the console, and GEM starts up. All GEM Programs now run under uid "gem". 
Actually, this should be done by GEM itself... :(

Happy New Year to all of you!

Stephan


--- dosmem.c.orig	Tue Dec 20 20:53:46 1994
+++ dosmem.c	Mon Jan  2 19:41:06 1995
@@ -623,6 +623,18 @@
 		if (ptrace)
 			p->ptracer = pid2proc(p->ppid);
 
+#ifdef MULTITOS
+	/* Stephan Haslbeck: GEM kludge no. x+1
+	 * If a program is started by AESSYS, reset its euid/egid,
+	 * so AES can run with root rights, but user programs don't.
+	 * This should be done by the AES, however.
+	 */
+		if(!strcmp(curproc->name, "AESSYS")) {
+			p->euid = p->suid = p->ruid;
+			p->egid = p->sgid = p->rgid;
+		}
+#endif
+
 	/* Even though the file system won't allow unauthorized access
 	 * to setuid/setgid programs, it's better to err on the side of
 	 * caution and forbid them to be traced (since the parent can arrange


+------------------------------+-----------------------------+
|      Stephan Haslbeck	       |    Fachschaft Informatik    |
|       Agricolastr. 61	       |   Technische Universitaet   |
|      D-80686 Muenchen	       |      Muenchen, Bayern	     |
+------------------------------+-----------------------------+
|          Es gibt keine Probleme, nur Loesungen.	     |
+------------------------------------------------------------+