4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1988 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
30 * Copyright (c) 2016 by Delphix. All rights reserved.
34 #pragma ident "%Z%%M% %I% %E% SMI"
38 static void euucico();
41 * start up uucico for rmtname
50 * start uucico for rmtname system
52 if (fork() == 0) { /* can't vfork() */
54 * hide the uid of the initiator of this job so that it
55 * doesn't get notified about things that don't concern it.
57 (void) setuid(geteuid());
72 (void) open("/dev/null", 0);
73 (void) open("/dev/null", 1);
74 (void) open("/dev/null", 1);
75 (void) signal(SIGINT
, SIG_IGN
);
76 (void) signal(SIGHUP
, SIG_IGN
);
77 (void) signal(SIGQUIT
, SIG_IGN
);
79 if (rmtname
[0] != '\0')
80 (void) sprintf(opt
, "-s%s", rmtname
);
83 (void) execle(UUCICO
, "UUCICO", "-r1", opt
, (char *) 0, Env
);
98 register int i
, maxfiles
;
100 if (rmtname
&& rmtname
[0] != '\0')
101 (void) sprintf(opt
, "-s%s", rmtname
);
111 (void) open("/dev/null", 2);
112 (void) open("/dev/null", 2);
113 (void) open("/dev/null", 2);
114 (void) signal(SIGINT
, SIG_IGN
);
115 (void) signal(SIGHUP
, SIG_IGN
);
116 (void) signal(SIGQUIT
, SIG_IGN
);
119 maxfiles
= ulimit(4, 0);
122 maxfiles
= getdtablesize();
127 for (i
= 3; i
< maxfiles
; i
++)
130 * hide the uid of the initiator of this job so that it
131 * doesn't get notified about things that don't concern it.
133 (void) setuid(geteuid());
134 (void) execle(UUXQT
, "UUXQT", opt
, (char *) 0, Env
);