let ipc talk to all USER processes and vice versa.
pm sig wrapper notify has to be called from two files.
actually install include files.
TTY
DS
VM
+ USER
;
vm
REMAP
clean::
install::
- #-rm -rf $(INC)
- #mkdir -p $(INC)
- #cpdir . $(INC)
- #@chown -R bin $(INC)
- #@rm -f $(INC)/Makefile
+ -rm -rf $(INC)
+ mkdir -p $(INC)
+ cpdir . $(INC)
+ @chown -R bin $(INC)
+ @rm -f $(INC)/Makefile
gcc: install
SHELL=/bin/sh; if [ -f $(MKHEADERS343) ] ; then sh -e $(MKHEADERS343) ; fi
* arguments are passed in
* a struct rs_start
*/
-#define RS_LOOKUP (DS_RQ_BASE + 8) /* lookup server name */
+#define RS_LOOKUP (RS_RQ_BASE + 8) /* lookup server name */
# define RS_CMD_ADDR m1_p1 /* command string */
# define RS_CMD_LEN m1_i1 /* length of command */
_PROTOTYPE( int do_sigreturn, (void) );
_PROTOTYPE( int do_sigsuspend, (void) );
_PROTOTYPE( void check_pending, (struct mproc *rmp) );
+_PROTOTYPE( int, vm_notify_sig_wrapper(endpoint_t ep) );
+
/* time.c */
_PROTOTYPE( int do_stime, (void) );
return(SUSPEND);
}
-PRIVATE vm_notify_sig_wrapper(endpoint_t ep)
+PUBLIC vm_notify_sig_wrapper(endpoint_t ep)
{
/* get IPC's endpoint,
* the reason that we directly get the endpoint
continue;
}
- /* Only root can make calls to rs */
+ /* Only root can make calls to rs. unless it's RS_LOOKUP. */
euid= getpeuid(m.m_source);
- if (euid != 0)
+ if (euid != 0 && call_nr != RS_LOOKUP)
{
printf("RS: got unauthorized request %d from endpoint %d\n",
call_nr, m.m_source);
case RS_RESTART: result = do_restart(&m); break;
case RS_SHUTDOWN: result = do_shutdown(&m); break;
case GETSYSINFO: result = do_getsysinfo(&m); break;
+ case RS_LOOKUP: result = do_lookup(&m); break;
default:
printf("Warning, RS got unexpected request %d from %d\n",
m.m_type, m.m_source);
#include <minix/dmap.h>
#include <minix/ds.h>
#include <minix/endpoint.h>
+#include <minix/vm.h>
#include <minix/rs.h>
#include <lib.h>
return;
}
}
+
+/*===========================================================================*
+ * do_lookup *
+ *===========================================================================*/
+PUBLIC int do_lookup(m_ptr)
+message *m_ptr;
+{
+ static char namebuf[100];
+ int len, r;
+ struct rproc *rrp;
+
+ len = m_ptr->RS_NAME_LEN;
+
+ if(len < 2 || len >= sizeof(namebuf)) {
+ printf("RS: len too weird (%d)\n", len);
+ return EINVAL;
+ }
+
+ if((r=sys_vircopy(m_ptr->m_source, D, (vir_bytes) m_ptr->RS_NAME,
+ SELF, D, (vir_bytes) namebuf, len)) != OK) {
+ printf("RS: name copy failed\n");
+ return r;
+
+ }
+
+ namebuf[len] = '\0';
+
+ for (rrp=BEG_RPROC_ADDR; rrp<END_RPROC_ADDR; rrp++) {
+ if (!(rrp->r_flags & RS_IN_USE))
+ continue;
+ if (!strcmp(rrp->r_label, namebuf)) {
+ m_ptr->RS_ENDPOINT = rrp->r_proc_nr_e;
+ return OK;
+ }
+ }
+
+ return ESRCH;
+}
+
_PROTOTYPE( int do_refresh, (message *m));
_PROTOTYPE( int do_rescue, (message *m));
_PROTOTYPE( int do_restart, (message *m));
+_PROTOTYPE( int do_lookup, (message *m));
_PROTOTYPE( int do_shutdown, (message *m));
_PROTOTYPE( void do_period, (message *m));
_PROTOTYPE( void do_exit, (message *m));