gssd.c (7c478bd9) gssd.c (24da5b34)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
1/*
2 * CDDL HEADER START
3 *
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
7 * with the License.
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 *
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.
13 *
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]
19 *
20 * CDDL HEADER END
21 */
22/*
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident "%Z%%M% %I% %E% SMI"
28
29/*
30 * Usermode daemon which assists the kernel when handling gssapi calls.
31 * It is gssd that actually implements all gssapi calls.

--- 64 unchanged lines hidden (view full) ---

96int argc;
97char **argv;
98{
99 register SVCXPRT *transp;
100 int maxrecsz = RPC_MAXDATASIZE;
101 extern int optind;
102 int c;
103 char mname[FMNAMESZ + 1];
23 * Use is subject to license terms.
24 */
25
26#pragma ident "%Z%%M% %I% %E% SMI"
27
28/*
29 * Usermode daemon which assists the kernel when handling gssapi calls.
30 * It is gssd that actually implements all gssapi calls.

--- 64 unchanged lines hidden (view full) ---

95int argc;
96char **argv;
97{
98 register SVCXPRT *transp;
99 int maxrecsz = RPC_MAXDATASIZE;
100 extern int optind;
101 int c;
102 char mname[FMNAMESZ + 1];
104 extern int _getuid();
105
106 /* set locale and domain for internationalization */
107 setlocale(LC_ALL, "");
108 textdomain(TEXT_DOMAIN);
109
110
111 /*
103
104 /* set locale and domain for internationalization */
105 setlocale(LC_ALL, "");
106 textdomain(TEXT_DOMAIN);
107
108
109 /*
112 * take special note that "_getuid()" is called here. This is necessary
113 * since we must fake out the mechanism libraries calls to getuid()
114 * with a special routine that is provided as part of gssd. However,
115 * the call below MUST call the real getuid() to ensure it is running
116 * as root.
110 * Take special note that "getuid()" is called here. This call is used
111 * rather than app_krb5_user_uid(), to ensure gssd(1M) is running as
112 * root.
117 */
113 */
118
119#ifdef DEBUG
120 (void) setuid(0); /* DEBUG: set ruid to root */
121#endif /* DEBUG */
114#ifdef DEBUG
115 (void) setuid(0); /* DEBUG: set ruid to root */
116#endif /* DEBUG */
122 if (_getuid()) {
117 if (getuid()) {
123 (void) fprintf(stderr,
118 (void) fprintf(stderr,
124 gettext("[%s] must be run as root\n"), argv[0]);
119 gettext("[%s] must be run as root\n"), argv[0]);
125#ifdef DEBUG
126 (void) fprintf(stderr, gettext(" warning only\n"));
127#else /* DEBUG */
128 exit(1);
129#endif /* DEBUG */
130 }
131
132 gssd_setup(argv[0]);

--- 168 unchanged lines hidden ---
120#ifdef DEBUG
121 (void) fprintf(stderr, gettext(" warning only\n"));
122#else /* DEBUG */
123 exit(1);
124#endif /* DEBUG */
125 }
126
127 gssd_setup(argv[0]);

--- 168 unchanged lines hidden ---