Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2002 22:54:51 -0700 (PDT)
From:      Adam Migus <amigus@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 13519 for review
Message-ID:  <200206280554.g5S5spqt034065@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13519

Change 13519 by amigus@amigus_vmganyopa on 2002/06/27 22:54:14

	It's probably better to return "operation not supported" than
	"protocol not available", if the user doesn't have MAC enabled
	but attempts to set the label anyway.  Unfortunately there is
	no EDUDEYOURESOINTHEBOX...

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/uipc_socket.c#26 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/uipc_socket.c#26 (text+ko) ====

@@ -1280,8 +1280,8 @@
 				break;
 			}
 			break;
+		case SO_LABEL:
 #ifdef MAC
-		case SO_LABEL:
 			error = sooptcopyin(sopt, &extmac, sizeof extmac,
 			    sizeof extmac);
 			if (error)
@@ -1290,8 +1290,10 @@
 			error = mac_setsockopt_label_set(
 			    sopt->sopt_td->td_ucred, so, &extmac);
 
+#else /* MAC */
+			error = EOPNOTSUPP;
+#endif /* MAC */
 			break;
-#endif /* MAC */
 		default:
 			error = ENOPROTOOPT;
 			break;
@@ -1431,22 +1433,28 @@
 			tv.tv_usec = (optval % hz) * tick;
 			error = sooptcopyout(sopt, &tv, sizeof tv);
 			break;
+		case SO_LABEL:
 #ifdef MAC
-		case SO_LABEL:
 			error = mac_getsockopt_label_get(
 			    sopt->sopt_td->td_ucred, so, &extmac);
 			if (error)
 				return (error);
 			error = sooptcopyout(sopt, &extmac, sizeof extmac);
+#else /* MAC */
+			error = EOPNOTSUPP;
+#endif /* MAC */
 			break;
 		case SO_PEERLABEL:
+#ifdef MAC
 			error = mac_getsockopt_peerlabel_get(
 			    sopt->sopt_td->td_ucred, so, &extmac);
 			if (error)
 				return (error);
 			error = sooptcopyout(sopt, &extmac, sizeof extmac);
+#else /* MAC */
+			error = EOPNOTSUPP;
+#endif /* MAC */
 			break;
-#endif /* MAC */
 		default:
 			error = ENOPROTOOPT;
 			break;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206280554.g5S5spqt034065>