|
|
1.1 ! root 1: /* /sccs/src/cmd/uucp/s.xqt.c ! 2: xqt.c 1.1 8/30/84 17:38:21 ! 3: */ ! 4: #include "uucp.h" ! 5: ! 6: VERSION(@(#)xqt.c 1.1); ! 7: ! 8: static euucico(); ! 9: ! 10: /* ! 11: * start up uucico for rmtname ! 12: * return: ! 13: * none ! 14: */ ! 15: void ! 16: xuucico(rmtname) ! 17: char *rmtname; ! 18: { ! 19: /* ! 20: * start uucico for rmtname system ! 21: */ ! 22: if (fork() == 0) { /* can't vfork() */ ! 23: /* ! 24: * hide the uid of the initiator of this job so that he ! 25: * doesn't get notified about things that don't concern him. ! 26: */ ! 27: (void) setuid(geteuid()); ! 28: euucico(rmtname); ! 29: } ! 30: return; ! 31: } ! 32: ! 33: /* ! 34: * remove the opt junk later. -ntw ! 35: */ ! 36: ! 37: static ! 38: euucico(rmtname) ! 39: char *rmtname; ! 40: { ! 41: char opt[100]; ! 42: ! 43: (void) close(0); ! 44: (void) close(1); ! 45: (void) close(2); ! 46: (void) open("/dev/null", 0); ! 47: (void) open("/dev/null", 1); ! 48: (void) open("/dev/null", 1); ! 49: (void) signal(SIGINT, SIG_IGN); ! 50: (void) signal(SIGHUP, SIG_IGN); ! 51: (void) signal(SIGQUIT, SIG_IGN); ! 52: closelog(); ! 53: #ifdef V8 ! 54: close(3); ! 55: #endif ! 56: if (rmtname[0] != '\0') ! 57: (void) sprintf(opt, "-s%s", rmtname); ! 58: else ! 59: opt[0] = '\0'; ! 60: #if NOTDEF ! 61: (void) execle(UUCICO, "UUCICO", "-r1", opt, 0, Env); ! 62: #else ! 63: (void) execle(UUSCHED, "UUSCHED", 0, Env); ! 64: #endif ! 65: exit(100); ! 66: } ! 67: ! 68: ! 69: /* ! 70: * start up uuxqt ! 71: * return: ! 72: * none ! 73: */ ! 74: void ! 75: xuuxqt(rmtname) ! 76: char *rmtname; ! 77: { ! 78: char opt[100]; ! 79: ! 80: if (rmtname && rmtname[0] != '\0') ! 81: (void) sprintf(opt, "-s%s", rmtname); ! 82: else ! 83: opt[0] = '\0'; ! 84: /* ! 85: * start uuxqt ! 86: */ ! 87: if (vfork() == 0) { ! 88: (void) close(0); ! 89: (void) close(1); ! 90: (void) close(2); ! 91: (void) open("/dev/null", 2); ! 92: (void) open("/dev/null", 2); ! 93: (void) open("/dev/null", 2); ! 94: (void) signal(SIGINT, SIG_IGN); ! 95: (void) signal(SIGHUP, SIG_IGN); ! 96: (void) signal(SIGQUIT, SIG_IGN); ! 97: closelog(); ! 98: #ifdef V8 ! 99: close(3); ! 100: (void) open("/dev/null", 2); ! 101: #endif ! 102: /* ! 103: * hide the uid of the initiator of this job so that he ! 104: * doesn't get notified about things that don't concern him. ! 105: */ ! 106: (void) setuid(geteuid()); ! 107: (void) execle(UUXQT, "UUXQT", opt, 0, Env); ! 108: (void) _exit(100); ! 109: } ! 110: return; ! 111: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.