|
|
1.1 ! root 1: /* ro2ssexec.c - RTPM: exec */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/rosap/RCS/ro2ssexec.c,v 7.1 90/07/01 21:05:51 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/rosap/RCS/ro2ssexec.c,v 7.1 90/07/01 21:05:51 mrose Exp $ ! 9: * ! 10: * Based on an TCP-based implementation by George Michaelson of University ! 11: * College London. ! 12: * ! 13: * ! 14: * $Log: ro2ssexec.c,v $ ! 15: * Revision 7.1 90/07/01 21:05:51 mrose ! 16: * pepsy ! 17: * ! 18: * Revision 6.0 89/03/18 23:42:15 mrose ! 19: * Release 5.0 ! 20: * ! 21: */ ! 22: ! 23: /* ! 24: * NOTICE ! 25: * ! 26: * Acquisition, use, and distribution of this module and related ! 27: * materials are subject to the restrictions of a license agreement. ! 28: * Consult the Preface in the User's Manual for the full terms of ! 29: * this agreement. ! 30: * ! 31: */ ! 32: ! 33: ! 34: /* LINTLIBRARY */ ! 35: ! 36: #include <stdio.h> ! 37: #include "ROS-types.h" ! 38: #include "../acsap/OACS-types.h" ! 39: #include "ropkt.h" ! 40: #include "isoservent.h" ! 41: #include "tailor.h" ! 42: ! 43: /* SERVER only */ ! 44: ! 45: int RoExec (ss, roi, arg1, arg2, hook, setperms) ! 46: struct SSAPstart *ss; ! 47: char *arg1, ! 48: *arg2; ! 49: struct RoSAPindication *roi; ! 50: IFP hook, ! 51: setperms; ! 52: { ! 53: int result, ! 54: result2; ! 55: register struct isoservent *is; ! 56: register PE pe; ! 57: struct SSAPref ref; ! 58: struct SSAPindication sis; ! 59: register struct SSAPindication *si = &sis; ! 60: struct type_OACS_PConnect *pcon; ! 61: ! 62: missingP (ss); ! 63: missingP (roi); ! 64: missingP (arg1); ! 65: missingP (arg2); ! 66: ! 67: if ((pe = ssdu2pe (ss -> ss_data, ss -> ss_cc, NULLCP, &result)) == NULLPE ! 68: || parse_OACS_PConnect (pe, 1, NULLIP, NULLVP, &pcon) == NOTOK) { ! 69: if (pe) ! 70: pe_free (pe); ! 71: if (result == PS_ERR_NMEM) { ! 72: congest: ; ! 73: result = SC_CONGESTION, result2 = ROS_CONGEST; ! 74: } ! 75: else ! 76: result = SC_REJECTED, result2 = ROS_PROTOCOL; ! 77: goto out; ! 78: } ! 79: ! 80: PLOGP (rosap_log,OACS_PConnect, pe, "PConnect", 1); ! 81: ! 82: pe_free (pe); ! 83: ! 84: if (pcon -> pUserData -> member_OACS_2 -> offset ! 85: != type_OACS_ConnectionData_open) { ! 86: result = SC_REJECTED, result2 = ROS_ADDRESS; ! 87: goto out; ! 88: } ! 89: if (is = getisoserventbyport ("rosap", ! 90: (u_short) htons ((u_short) pcon -> pUserData -> applicationProtocol))) { ! 91: *is -> is_tail++ = arg1; ! 92: *is -> is_tail++ = arg2; ! 93: *is -> is_tail = NULL; ! 94: } ! 95: else { ! 96: result = SC_REJECTED, result2 = ROS_ADDRESS; ! 97: goto out; ! 98: } ! 99: ! 100: switch (hook ? (*hook) (is, roi) : OK) { ! 101: case NOTOK: ! 102: return NOTOK; ! 103: ! 104: case DONE: ! 105: return OK; ! 106: ! 107: case OK: ! 108: if (setperms) ! 109: (void) (*setperms) (is); ! 110: (void) execv (*is -> is_vec, is -> is_vec);/* fall */ ! 111: SLOG (rosap_log, LLOG_FATAL, *is -> is_vec, ("unable to exec")); ! 112: default: ! 113: goto congest; ! 114: } ! 115: ! 116: out: ; ! 117: SSFREE (ss); ! 118: ! 119: bzero ((char *) &ref, sizeof ref); ! 120: (void) SConnResponse (ss -> ss_sd, &ref, NULLSA, ! 121: result, 0, 0, SERIAL_NONE, NULLCP, 0, si); ! 122: return rosaplose (roi, result2, NULLCP, NULLCP); ! 123: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.