diff options
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/allocate/mkdevmaps.c | 801 | ||||
| -rw-r--r-- | usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ip.c | 2 | ||||
| -rw-r--r-- | usr/src/cmd/lp/cmd/adaptor/misc.c | 2 | ||||
| -rw-r--r-- | usr/src/cmd/lp/lib/papi/service.c | 2 | ||||
| -rw-r--r-- | usr/src/lib/libtsnet/common/tsol_getzcent.c | 141 | ||||
| -rw-r--r-- | usr/src/lib/libtsnet/common/tsol_sgettpent.c | 1 | ||||
| -rw-r--r-- | usr/src/lib/libtsnet/spec/versions | 6 | ||||
| -rw-r--r-- | usr/src/lib/libtsol/common/stol.c | 4 | ||||
| -rw-r--r-- | usr/src/uts/common/sys/tsol/label.h | 5 | ||||
| -rw-r--r-- | usr/src/uts/common/sys/tsol/label_macro.h | 5 |
10 files changed, 15 insertions, 954 deletions
diff --git a/usr/src/cmd/allocate/mkdevmaps.c b/usr/src/cmd/allocate/mkdevmaps.c deleted file mode 100644 index f4167ebf2c..0000000000 --- a/usr/src/cmd/allocate/mkdevmaps.c +++ /dev/null @@ -1,801 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * scan /dev directory for mountable objects and construct device_maps - * file for allocate.... - * - * devices are: - * tape (cartridge) - * /dev/rst* - * /dev/nrst* - * /dev/rmt/... - * audio - * /dev/audio - * /dev/audioctl - * /dev/sound/... - * floppy - * /dev/diskette - * /dev/fd* - * /dev/rdiskette - * /dev/rfd* - * CD - * /dev/sr* - * /dev/nsr* - * /dev/dsk/c?t?d0s? - * /dev/rdsk/c?t?d0s? - */ - -#include <sys/types.h> /* for stat(2), etc. */ -#include <sys/stat.h> -#include <dirent.h> /* for readdir(3), etc. */ -#include <unistd.h> /* for readlink(2) */ -#include <string.h> /* for strcpy(3), etc. */ -#include <strings.h> /* for bcopy(3C), etc. */ -#include <stdio.h> /* for perror(3) */ -#include <stdlib.h> /* for atoi(3) */ -#include <locale.h> -#include <libintl.h> - -#ifndef TEXT_DOMAIN -#define TEXT_DOMAIN "SUNW_OST_OSCMD" -#endif - -#define DELTA 5 /* array size delta when full */ - -/* "/dev/rst...", "/dev/nrst...", "/dev/rmt/..." */ -struct tape { - char *name; - char *device; - int number; -} *tape; -#define DFLT_NTAPE 10 /* size of initial array */ -#define SIZE_OF_RST 3 /* |rmt| */ -#define SIZE_OF_NRST 4 /* |nrmt| */ -#define SIZE_OF_TMP 4 /* |/tmp| */ -#define SIZE_OF_RMT 8 /* |/dev/rmt| */ - -/* "/dev/audio", "/dev/audioctl", "/dev/sound/..." */ -struct audio { - char *name; - char *device; - int number; -} *audio; -#define DFLT_NAUDIO 10 /* size of initial array */ -#define SIZE_OF_SOUND 10 /* |/dev/sound| */ - -/* "/dev/sr", "/dev/nsr", "/dev/dsk/c?t?d0s?", "/dev/rdsk/c?t?d0s?" */ -struct cd { - char *name; - char *device; - int id; - int number; - int controller; -} *cd; -#define DFLT_NCD 10 /* size of initial array */ -#define SIZE_OF_SR 2 /* |sr| */ -#define SIZE_OF_RSR 3 /* |rsr| */ -#define SIZE_OF_DSK 8 /* |/dev/dsk| */ -#define SIZE_OF_RDSK 9 /* |/dev/rdsk| */ - -/* "/dev/fd0*", "/dev/rfd0*", "/dev/fd1*", "/dev/rfd1*" */ -struct fp { - char *name; - char *device; - int number; -} *fp; -#define DFLT_NFP 10 /* size of initial array */ -#define SIZE_OF_FD0 3 /* |fd0| */ -#define SIZE_OF_RFD0 4 /* |rfd0| */ - -static void dotape(); -static void doaudio(); -static void dofloppy(); -static void docd(); -static void initmem(); -static int expandmem(int, void **, int); -static void no_memory(void); - -int -main(void) -{ - (void) setlocale(LC_ALL, ""); - (void) textdomain(TEXT_DOMAIN); - - initmem(); /* initialize memory */ - - dotape(); /* do tape */ - doaudio(); /* do audio */ - dofloppy(); /* do floppy */ - docd(); /* do cd */ - - return (0); -} - -static void -dotape() -{ - DIR *dirp; - struct dirent *dep; /* directory entry pointer */ - int i, j, n; - char *nm; /* name/device of special device */ - char linkvalue[2048]; /* symlink value */ - struct stat stat; /* determine if it's a symlink */ - int sz; /* size of symlink value */ - char *cp; /* pointer into string */ - int first = 0; /* kludge to put space between entries */ - int ntape; /* max array size */ - - ntape = DFLT_NTAPE; - - - /* - * look for rst* and nrst* - */ - - if ((dirp = opendir("/dev")) == NULL) { - perror("open /dev failure"); - exit(1); - } - - i = 0; - while (dep = readdir(dirp)) { - /* ignore if neither rst* nor nrst* */ - if (strncmp(dep->d_name, "rst", SIZE_OF_RST) && - strncmp(dep->d_name, "nrst", SIZE_OF_NRST)) - continue; - - /* if array full, then expand it */ - if (i == ntape) { - /* will exit(1) if insufficient memory */ - ntape = expandmem(i, (void **)&tape, - sizeof (struct tape)); - } - - /* save name (/dev + / + d_naem + \0) */ - nm = (char *)malloc(SIZE_OF_TMP + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/"); - (void) strcat(nm, dep->d_name); - tape[i].name = nm; - - /* ignore if not symbolic link (note i not incremented) */ - if (lstat(tape[i].name, &stat) < 0) { - perror(gettext("stat(2) failed ")); - exit(1); - } - if ((stat.st_mode & S_IFMT) != S_IFLNK) - continue; - /* get name from symbolic link */ - if ((sz = readlink(tape[i].name, linkvalue, sizeof (linkvalue))) - < 0) - continue; - nm = (char *)malloc(sz + 1); - if (nm == NULL) - no_memory(); - (void) strncpy(nm, linkvalue, sz); - nm[sz] = '\0'; - tape[i].device = nm; - - /* get device number */ - cp = strrchr(tape[i].device, '/'); - cp++; /* advance to device # */ - (void) sscanf(cp, "%d", &tape[i].number); - - i++; - } - - (void) closedir(dirp); - - /* - * scan /dev/rmt and add entry to table - */ - - if ((dirp = opendir("/dev/rmt")) == NULL) { - perror(gettext("open /dev failure")); - exit(1); - } - - while (dep = readdir(dirp)) { - /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) - continue; - - /* if array full, then expand it */ - if (i == ntape) { - /* will exit(1) if insufficient memory */ - ntape = expandmem(i, (void **)&tape, - sizeof (struct tape)); - } - - /* save name (/dev/rmt + / + d_name + \0) */ - nm = (char *)malloc(SIZE_OF_RMT + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/rmt/"); - (void) strcat(nm, dep->d_name); - tape[i].name = nm; - - /* save device name (rmt/ + d_name + \0) */ - nm = (char *)malloc(SIZE_OF_TMP + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "rmt/"); - (void) strcat(nm, dep->d_name); - tape[i].device = nm; - - (void) sscanf(dep->d_name, "%d", &tape[i].number); - - i++; - } - n = i; - - (void) closedir(dirp); - - /* remove duplicate entries */ - for (i = 0; i < n - 1; i++) { - for (j = i + 1; j < n; j++) { - if (strcmp(tape[i].device, tape[j].device)) - continue; - tape[j].number = -1; - } - } - - /* print out device_maps entries for tape devices */ - for (i = 0; i < 8; i++) { - for (j = 0; j < n; j++) { - if (tape[j].number != i) - continue; - if (first) - (void) printf(" "); - else { - (void) printf("st%d:\\\n", i); - (void) printf("\trmt:\\\n"); - (void) printf("\t"); - first++; - } - (void) printf("%s", tape[j].name); - } - if (first) { - (void) printf(":\\\n\n"); - first = 0; - } - } - -} - -static void -doaudio() -{ - DIR *dirp; - struct dirent *dep; /* directory entry pointer */ - int i, j, n; - char *nm; /* name/device of special device */ - char linkvalue[2048]; /* symlink value */ - struct stat stat; /* determine if it's a symlink */ - int sz; /* size of symlink value */ - char *cp; /* pointer into string */ - int first = 0; /* kludge to put space between entries */ - int naudio; /* max array size */ - - naudio = DFLT_NAUDIO; - - if ((dirp = opendir("/dev")) == NULL) { - perror(gettext("open /dev failure")); - exit(1); - } - - i = 0; - while (dep = readdir(dirp)) { - if (strcmp(dep->d_name, "audio") && - strcmp(dep->d_name, "audioctl")) - continue; - - /* if array full, then expand it */ - if (i == naudio) { - /* will exit(1) if insufficient memory */ - naudio = expandmem(i, (void **)&audio, - sizeof (struct audio)); - } - - /* save name (/dev + / + d_name + \0) */ - nm = (char *)malloc(SIZE_OF_TMP + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/"); - (void) strcat(nm, dep->d_name); - audio[i].name = nm; - - /* ignore if not symbolic link (note i not incremented) */ - if (lstat(audio[i].name, &stat) < 0) { - perror(gettext("stat(2) failed ")); - exit(1); - } - if ((stat.st_mode & S_IFMT) != S_IFLNK) - continue; - /* get name from symbolic link */ - if ((sz = readlink(audio[i].name, linkvalue, - sizeof (linkvalue))) < 0) - continue; - nm = (char *)malloc(sz + 1); - if (nm == NULL) - no_memory(); - (void) strncpy(nm, linkvalue, sz); - nm[sz] = '\0'; - audio[i].device = nm; - - cp = strrchr(audio[i].device, '/'); - cp++; /* advance to device # */ - (void) sscanf(cp, "%d", &audio[i].number); - - i++; - } - - (void) closedir(dirp); - - if ((dirp = opendir("/dev/sound")) == NULL) { - goto skip; - } - - while (dep = readdir(dirp)) { - /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) - continue; - - /* if array full, then expand it */ - if (i == naudio) { - /* will exit(1) if insufficient memory */ - naudio = expandmem(i, (void **)&audio, - sizeof (struct audio)); - } - - /* save name (/dev/sound + / + d_name + \0) */ - nm = (char *)malloc(SIZE_OF_SOUND + 1 + - strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/sound/"); - (void) strcat(nm, dep->d_name); - audio[i].name = nm; - - nm = (char *)malloc(SIZE_OF_SOUND + 1 + - strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/sound/"); - (void) strcat(nm, dep->d_name); - audio[i].device = nm; - - (void) sscanf(dep->d_name, "%d", &audio[i].number); - - i++; - } - - (void) closedir(dirp); - -skip: - n = i; - - /* remove duplicate entries */ - for (i = 0; i < n - 1; i++) { - for (j = i + 1; j < n; j++) { - if (strcmp(audio[i].device, audio[j].device)) - continue; - audio[j].number = -1; - } - } - - /* print out device_maps entries for tape devices */ - for (i = 0; i < 8; i++) { - for (j = 0; j < n; j++) { - if (audio[j].number != i) - continue; - if (first) - (void) printf(" "); - else { - (void) printf("audio:\\\n"); - (void) printf("\taudio:\\\n"); - (void) printf("\t"); - first++; - } - (void) printf("%s", audio[j].name); - } - if (first) { - (void) printf(":\\\n\n"); - first = 0; - } - } - -} - -static void -dofloppy() -{ - DIR *dirp; - struct dirent *dep; /* directory entry pointer */ - int i, j, n; - char *nm; /* name/device of special device */ - char linkvalue[2048]; /* symlink value */ - struct stat stat; /* determine if it's a symlink */ - int sz; /* size of symlink value */ - char *cp; /* pointer into string */ - int first = 0; /* kludge to put space between entries */ - int nfp; /* max array size */ - - nfp = DFLT_NFP; - - /* - * look for fd0* and rfd0* - */ - - if ((dirp = opendir("/dev")) == NULL) { - perror(gettext("open /dev failure")); - exit(1); - } - - i = 0; - while (dep = readdir(dirp)) { - /* ignore if neither rst* nor nrst* */ - if (strncmp(dep->d_name, "fd0", SIZE_OF_FD0) && - strncmp(dep->d_name, "rfd0", SIZE_OF_RFD0) && - strncmp(dep->d_name, "fd1", SIZE_OF_FD0) && - strncmp(dep->d_name, "rfd1", SIZE_OF_RFD0)) - continue; - - /* if array full, then expand it */ - if (i == nfp) { - /* will exit(1) if insufficient memory */ - nfp = expandmem(i, (void **)&fp, sizeof (struct fp)); - } - - /* save name (/dev + / + d_name + \0) */ - nm = (char *)malloc(SIZE_OF_TMP + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/"); - (void) strcat(nm, dep->d_name); - fp[i].name = nm; - - /* ignore if not symbolic link (note i not incremented) */ - if (lstat(fp[i].name, &stat) < 0) { - perror(gettext("stat(2) failed ")); - exit(1); - } - if ((stat.st_mode&S_IFMT) != S_IFLNK) - continue; - - /* get name from symbolic link */ - if ((sz = readlink(fp[i].name, linkvalue, sizeof (linkvalue))) - < 0) - continue; - nm = (char *)malloc(sz+1); - if (nm == NULL) - no_memory(); - (void) strncpy(nm, linkvalue, sz); - nm[sz] = '\0'; - fp[i].device = nm; - - /* get device number */ - cp = strchr(fp[i].name, 'd'); - cp++; /* advance to device # */ - cp = strchr(cp, 'd'); - cp++; /* advance to device # */ - (void) sscanf(cp, "%d", &fp[i].number); - i++; - } - - n = i; - (void) closedir(dirp); - - /* print out device_maps entries for floppy devices */ - for (i = 0; i < 8; i++) { - for (j = 0; j < n; j++) { - if (fp[j].number != i) - continue; - if (first) - (void) printf(" "); - else { - (void) printf("fd%d:\\\n", i); - (void) printf("\tfd:\\\n"); - (void) printf("\t"); - if (i == 0) - (void) printf("/dev/diskette "); - (void) printf("/dev/rdiskette "); - first++; - } - (void) printf("%s", fp[j].name); - } - if (first) { - (void) printf(":\\\n\n"); - first = 0; - } - } -} - -static void -docd() -{ - DIR *dirp; - struct dirent *dep; /* directory entry pointer */ - int i, j, n; - char *nm; /* name/device of special device */ - char linkvalue[2048]; /* symlink value */ - struct stat stat; /* determine if it's a symlink */ - int sz; /* size of symlink value */ - char *cp; /* pointer into string */ - int first = 0; /* kludge to put space between entries */ - int id; /* disk id */ - int ctrl; /* disk controller */ - int ncd; /* max array size */ - - ncd = DFLT_NCD; - - /* - * look for sr* and rsr* - */ - - if ((dirp = opendir("/dev")) == NULL) { - perror(gettext("open /dev failure")); - exit(1); - } - - i = 0; - while (dep = readdir(dirp)) { - /* ignore if neither sr* nor rsr* */ - if (strncmp(dep->d_name, "sr", SIZE_OF_SR) && - strncmp(dep->d_name, "rsr", SIZE_OF_RSR)) - continue; - - /* if array full, then expand it */ - if (i == ncd) { - /* will exit(1) if insufficient memory */ - ncd = expandmem(i, (void **)&cd, sizeof (struct cd)); - } - - /* save name (/dev + / + d_name + \0) */ - nm = (char *)malloc(SIZE_OF_TMP + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/"); - (void) strcat(nm, dep->d_name); - cd[i].name = nm; - - /* save id # */ - if (dep->d_name[0] == 'r') - (void) sscanf(dep->d_name, "rsr%d", &cd[i].id); - else - (void) sscanf(dep->d_name, "sr%d", &cd[i].id); - - /* ignore if not symbolic link (note i not incremented) */ - if (lstat(cd[i].name, &stat) < 0) { - perror(gettext("stat(2) failed ")); - exit(1); - } - if ((stat.st_mode & S_IFMT) != S_IFLNK) - continue; - - /* get name from symbolic link */ - if ((sz = readlink(cd[i].name, linkvalue, - sizeof (linkvalue))) < 0) - continue; - nm = (char *)malloc(sz + 1); - if (nm == NULL) - no_memory(); - (void) strncpy(nm, linkvalue, sz); - nm[sz] = '\0'; - cd[i].device = nm; - - cp = strrchr(cd[i].device, '/'); - cp++; /* advance to device # */ - (void) sscanf(cp, "c%dt%d", &cd[i].controller, &cd[i].number); - - i++; - } - n = i; - - (void) closedir(dirp); - - /* - * scan /dev/dsk for cd devices - */ - - if ((dirp = opendir("/dev/dsk")) == NULL) { - perror(gettext("open /dev/dsk failure")); - exit(1); - } - - while (dep = readdir(dirp)) { - /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) - continue; - - /* get device # (disk #) */ - if (sscanf(dep->d_name, "c%dt%d", &ctrl, &id) <= 0) - continue; - - /* see if this is one of the cd special devices */ - for (j = 0; j < n; j++) { - if ((cd[j].number == id) && (cd[j].controller == ctrl)) - goto found; - } - continue; - -found: /* add new entry to table (/dev/dsk + / + d_name + \0) */ - - /* if array full, then expand it */ - if (i == ncd) { - /* will exit(1) if insufficient memory */ - ncd = expandmem(i, (void **)&cd, sizeof (struct cd)); - } - - nm = (char *)malloc(SIZE_OF_DSK + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/dsk/"); - (void) strcat(nm, dep->d_name); - cd[i].name = nm; - - cd[i].id = cd[j].id; - - cd[i].device = ""; - - cd[i].number = id; - - cd[i].controller = ctrl; - - i++; - } - - (void) closedir(dirp); - - /* - * scan /dev/rdsk for cd devices - */ - - if ((dirp = opendir("/dev/rdsk")) == NULL) { - perror(gettext("open /dev/dsk failure")); - exit(1); - } - - while (dep = readdir(dirp)) { - /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) - continue; - - /* get device # (disk #) */ - if (sscanf(dep->d_name, "c%dt%d", &ctrl, &id) <= 0) - continue; - - /* see if this is one of the cd special devices */ - for (j = 0; j < n; j++) { - if ((cd[j].number == id) && (cd[j].controller == ctrl)) - goto found1; - } - continue; - -found1: /* add new entry to table (/dev/rdsk + / + d_name + \0) */ - - /* if array full, then expand it */ - if (i == ncd) { - /* will exit(1) if insufficient memory */ - ncd = expandmem(i, (void **)&cd, sizeof (struct cd)); - } - - nm = (char *)malloc(SIZE_OF_RDSK + 1 + strlen(dep->d_name) + 1); - if (nm == NULL) - no_memory(); - (void) strcpy(nm, "/dev/rdsk/"); - (void) strcat(nm, dep->d_name); - cd[i].name = nm; - - cd[i].id = cd[j].id; - - cd[i].device = ""; - - cd[i].number = id; - - cd[i].controller = ctrl; - - i++; - } - - (void) closedir(dirp); - - n = i; - - /* print out device_maps entries for tape devices */ - for (i = 0; i < 8; i++) { - for (j = 0; j < n; j++) { - if (cd[j].id != i) - continue; - if (first) - (void) printf(" "); - else { - (void) printf("sr%d:\\\n", i); - (void) printf("\tsr:\\\n"); - (void) printf("\t"); - first++; - } - (void) printf("%s", cd[j].name); - } - if (first) { - (void) printf(":\\\n\n"); - first = 0; - } - } - -} - -/* set default array sizes */ -static void -initmem() -{ - tape = (struct tape *)calloc(DFLT_NTAPE, sizeof (struct tape)); - audio = (struct audio *)calloc(DFLT_NAUDIO, sizeof (struct audio)); - cd = (struct cd *)calloc(DFLT_NCD, sizeof (struct cd)); - fp = (struct fp *)calloc(DFLT_NFP, sizeof (struct fp)); - - if (tape == NULL || audio == NULL || cd == NULL || fp == NULL) - no_memory(); -} - -/* note n will be # elments in `array' */ -static int -expandmem(int n, void **array, int size) -{ - void *old = *array; - void *new; - - /* get new array space (n + DELTA) */ - new = (void *)calloc(n + DELTA, size); - - if (new == NULL) { - perror("memory allocation failed"); - exit(1); - } - - /* copy old array into new space */ - bcopy(old, new, n * size); - - /* now release old arrary */ - free(old); - - *array = new; - - return (n + DELTA); -} - -static void -no_memory(void) -{ - (void) fprintf(stderr, "%s: %s\n", "mkdevmaps", - gettext("out of memory")); - exit(1); - /* NOT REACHED */ -} diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ip.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ip.c index be6440a525..4eaa51817e 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ip.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ip.c @@ -1335,7 +1335,7 @@ interpret_cipso_tagtype1(const uchar_t *opt) "Categories = None"); } cipso2sl(opt, &sl, &ishigh); - if (is_system_labeled) { + if (is_system_labeled()) { if (bsltos(&sl, &plabel, ALABEL_MAXLEN, LONG_CLASSIFICATION|LONG_WORDS|VIEW_INTERNAL) < 0) { (void) snprintf(get_line(0, 0), get_line_remain(), diff --git a/usr/src/cmd/lp/cmd/adaptor/misc.c b/usr/src/cmd/lp/cmd/adaptor/misc.c index e4959df8fa..4aeb08b4df 100644 --- a/usr/src/cmd/lp/cmd/adaptor/misc.c +++ b/usr/src/cmd/lp/cmd/adaptor/misc.c @@ -228,7 +228,7 @@ lpsched_client_access(const char *printer, const char *host, int peerfd) if ((printer == NULL) || (host == NULL)) return (-1); - if (is_system_labeled) { + if (is_system_labeled()) { short status = MOK; extern MESG *lp_Md; /* liblpmsg supplies this */ diff --git a/usr/src/cmd/lp/lib/papi/service.c b/usr/src/cmd/lp/lib/papi/service.c index d4512636f4..f9c9162406 100644 --- a/usr/src/cmd/lp/lib/papi/service.c +++ b/usr/src/cmd/lp/lib/papi/service.c @@ -105,7 +105,7 @@ papiServiceSetPeer(papi_service_t handle, int peerfd) if (svc == NULL) return (PAPI_BAD_ARGUMENT); - if (is_system_labeled) { + if (is_system_labeled()) { short status; if ((snd_msg(svc, S_PASS_PEER_CONNECTION) < 0) || diff --git a/usr/src/lib/libtsnet/common/tsol_getzcent.c b/usr/src/lib/libtsnet/common/tsol_getzcent.c deleted file mode 100644 index 4faf1cf5be..0000000000 --- a/usr/src/lib/libtsnet/common/tsol_getzcent.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <ctype.h> -#include <nss_dbdefs.h> -#include <libtsnet.h> - -static int tsol_zc_stayopen; /* Unsynchronized, but it affects only */ - /* efficiency, not correctness */ -static DEFINE_NSS_DB_ROOT(db_root); -static DEFINE_NSS_GETENT(context); - -struct zc_args { - tsol_zcent_t *zc; - int err; - char *errstr; - int errno_val; -}; - -static int str2tsol_zcent(const char *, int, void *, char *, int); - -static void -_nss_initf_tsol_zc(nss_db_params_t *p) -{ - p->name = NSS_DBNAM_TSOL_ZC; - p->default_config = NSS_DEFCONF_TSOL_ZC; -} - -/* - * This is just a placeholder. The system doesn't currently lookup tnzonecfg - * entries via name services. - */ -/* ARGSUSED */ -static void -switch_callback(void *res, const char *zonename, const char *label, - const char *flags, const char *privmlp, const char *globalmlp) -{ -} - -tsol_zcent_t * -tsol_getzcbyname(const char *name) -{ - nss_XbyY_args_t arg; - struct zc_args zcargs; - - zcargs.zc = NULL; - NSS_XbyY_INIT(&arg, &zcargs, (char *)switch_callback, 1, - str2tsol_zcent); - arg.key.name = name; - arg.stayopen = tsol_zc_stayopen; - arg.h_errno = TSOL_NOT_FOUND; - arg.status = nss_search(&db_root, _nss_initf_tsol_zc, - NSS_DBOP_TSOL_ZC_BYNAME, &arg); - (void) NSS_XbyY_FINI(&arg); - if (arg.status != 0) { - tsol_freezcent(zcargs.zc); - zcargs.zc = NULL; - } - return (zcargs.zc); -} - -void -tsol_setzcent(int stay) -{ - tsol_zc_stayopen |= stay; - nss_setent(&db_root, _nss_initf_tsol_zc, &context); -} - -void -tsol_endzcent(void) -{ - tsol_zc_stayopen = 0; - nss_endent(&db_root, _nss_initf_tsol_zc, &context); - nss_delete(&db_root); -} - -struct tsol_zcent * -tsol_getzcent(void) -{ - nss_XbyY_args_t arg; - struct zc_args zcargs; - - zcargs.zc = NULL; - zcargs.errno_val = errno; - NSS_XbyY_INIT(&arg, &zcargs, (char *)switch_callback, 1, - str2tsol_zcent); - /* No key, no stayopen */ - arg.status = nss_getent(&db_root, _nss_initf_tsol_zc, &context, &arg); - (void) NSS_XbyY_FINI(&arg); - if (arg.status != 0) { - tsol_freezcent(zcargs.zc); - zcargs.zc = NULL; - } - if (zcargs.zc == NULL && zcargs.err == LTSNET_SYSERR) - errno = zcargs.errno_val; - return (zcargs.zc); -} - -/* - * This is the callback routine for nss. It just wraps the tsol_sgetzcent - * parser. - */ -/* ARGSUSED */ -static int -str2tsol_zcent(const char *instr, int lenstr, void *entp, char *buffer, - int buflen) -{ - struct zc_args *zcargs = entp; - - if (zcargs->zc != NULL) - tsol_freezcent(zcargs->zc); - zcargs->zc = tsol_sgetzcent(instr, &zcargs->err, &zcargs->errstr); - zcargs->errno_val = errno; - - return (zcargs->zc == NULL ? NSS_STR_PARSE_PARSE : - NSS_STR_PARSE_SUCCESS); -} diff --git a/usr/src/lib/libtsnet/common/tsol_sgettpent.c b/usr/src/lib/libtsnet/common/tsol_sgettpent.c index 37fd75b234..295fdba190 100644 --- a/usr/src/lib/libtsnet/common/tsol_sgettpent.c +++ b/usr/src/lib/libtsnet/common/tsol_sgettpent.c @@ -45,6 +45,7 @@ #include <strings.h> #include <libtsnet.h> #include <tsol/label.h> +#include <sys/tsol/label_macro.h> #include <sys/types.h> #include <nss.h> #include <secdb.h> diff --git a/usr/src/lib/libtsnet/spec/versions b/usr/src/lib/libtsnet/spec/versions index 43c70977f7..36bb621276 100644 --- a/usr/src/lib/libtsnet/spec/versions +++ b/usr/src/lib/libtsnet/spec/versions @@ -33,3 +33,9 @@ sparc { i386 { SUNWprivate_1.1; } +sparcv9 { + SUNWprivate_1.1; +} +amd64 { + SUNWprivate_1.1; +} diff --git a/usr/src/lib/libtsol/common/stol.c b/usr/src/lib/libtsol/common/stol.c index 2a951b3907..5dcd2147b1 100644 --- a/usr/src/lib/libtsol/common/stol.c +++ b/usr/src/lib/libtsol/common/stol.c @@ -103,10 +103,6 @@ htol(char *s, m_label_t *l) goto error; } lp = (uchar_t *)&(((_mac_label_impl_t *)l)->_comps); - if (LCLASS(l) < LOW_CLASS || - LCLASS(l) > HIGH_CLASS) { - goto error; - } if (h[0] == '-' && h[3] == '-') { uchar_t size; diff --git a/usr/src/uts/common/sys/tsol/label.h b/usr/src/uts/common/sys/tsol/label.h index 0eec1b497d..98ddcac6f8 100644 --- a/usr/src/uts/common/sys/tsol/label.h +++ b/usr/src/uts/common/sys/tsol/label.h @@ -54,11 +54,6 @@ typedef struct _tsol_binary_level_lrange { /* Level Range */ typedef m_range_t blrange_t; -#define NMLP_MAX 0x10 -#define NSLS_MAX 0x4 - -typedef m_label_t blset_t[NSLS_MAX]; - typedef struct tsol_mlp_s { uchar_t mlp_ipp; uint16_t mlp_port; diff --git a/usr/src/uts/common/sys/tsol/label_macro.h b/usr/src/uts/common/sys/tsol/label_macro.h index 43cf328e7d..7fd1d22bdb 100644 --- a/usr/src/uts/common/sys/tsol/label_macro.h +++ b/usr/src/uts/common/sys/tsol/label_macro.h @@ -94,6 +94,11 @@ typedef struct _binary_level_range_impl { /* Level Range */ _mac_label_impl_t upper_bound; } _brange_impl_t, brange_t; +#define NMLP_MAX 0x10 +#define NSLS_MAX 0x4 + +typedef _mac_label_impl_t blset_t[NSLS_MAX]; + /* Label Identifier Types */ #define SUN_MAC_ID 0x41 /* MAC label, legacy SUN_SL_ID */ |
