Annotation of researchv8dc/cmd/uucp/xqt.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.