4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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 /*
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26
27 #include <ctype.h>
28 #include <dirent.h>
29 #include <grp.h>
30 #include <libintl.h>
31 #include <limits.h>
32 #include <locale.h>
33 #include <pwd.h>
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include <sys/types.h>
38 #include <sys/inttypes.h>
39 #include <sys/file.h>
40 #include <sys/param.h>
41 #include <sys/uio.h>
42 #include <sys/stat.h>
43 #include <sys/acl.h>
2357 * Format of secflags token:
2358 * secflags token id adr_char
2359 * secflag set name adr_string
2360 * secflags adr_string
2361 * -----------------------------------------------------------------------
2362 */
2363 int
2364 secflags_token(pr_context_t *context)
2365 {
2366 int returnstat;
2367
2368 /* Set name */
2369 returnstat = process_tag(context, TAG_SETTYPE, 0, 0);
2370
2371 /* Done with attributes; force end of token open */
2372 if (returnstat == 0)
2373 returnstat = finish_open_tag(context);
2374
2375 /* set */
2376 return (pa_adr_string(context, returnstat, 1));
2377 }
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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 /*
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 *
25 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
26 */
27
28
29 #include <ctype.h>
30 #include <dirent.h>
31 #include <grp.h>
32 #include <libintl.h>
33 #include <limits.h>
34 #include <locale.h>
35 #include <pwd.h>
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <sys/types.h>
40 #include <sys/inttypes.h>
41 #include <sys/file.h>
42 #include <sys/param.h>
43 #include <sys/uio.h>
44 #include <sys/stat.h>
45 #include <sys/acl.h>
2359 * Format of secflags token:
2360 * secflags token id adr_char
2361 * secflag set name adr_string
2362 * secflags adr_string
2363 * -----------------------------------------------------------------------
2364 */
2365 int
2366 secflags_token(pr_context_t *context)
2367 {
2368 int returnstat;
2369
2370 /* Set name */
2371 returnstat = process_tag(context, TAG_SETTYPE, 0, 0);
2372
2373 /* Done with attributes; force end of token open */
2374 if (returnstat == 0)
2375 returnstat = finish_open_tag(context);
2376
2377 /* set */
2378 return (pa_adr_string(context, returnstat, 1));
2379 }
2380
2381 /*
2382 * -----------------------------------------------------------------------
2383 * access_mask_token() : Process access_mask token and display contents
2384 * return codes : -1 - error
2385 * : 0 - successful
2386 * NOTE: At the time of call, the access_mask token id has been retrieved
2387 *
2388 * Format of access_mask token:
2389 * access_mask token id adr_char
2390 * access_mask adr_u_int32
2391 * -----------------------------------------------------------------------
2392 */
2393 int
2394 access_mask_token(pr_context_t *context)
2395 {
2396 return (pa_access_mask(context, 0, 1));
2397 }
2398
2399 /*
2400 * -----------------------------------------------------------------------
2401 * wsid_token() : Process wsid token and display contents
2402 * return codes : -1 - error
2403 * : 0 - successful
2404 * NOTE: At the time of call, the wsid token id has been retrieved
2405 *
2406 * Format of wsid token:
2407 * wsid token id adr_char
2408 * wsid adr_string
2409 * -----------------------------------------------------------------------
2410 */
2411 int
2412 wsid_token(pr_context_t *context)
2413 {
2414 return (pa_wsid(context, 0, 1));
2415 }
|