PERFORCE change 79537 for review

Robert Watson rwatson at FreeBSD.org
Mon Jul 4 11:24:03 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=79537

Change 79537 by rwatson at rwatson_paprika on 2005/07/04 11:23:55

	Convert ALTQ suser() checks to cap_check() for CAP_NET_ADMIN.

Affected files ...

.. //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_cbq.c#2 edit
.. //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_cdnr.c#2 edit
.. //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_hfsc.c#2 edit
.. //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_priq.c#2 edit
.. //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_red.c#2 edit
.. //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_rio.c#2 edit

Differences ...

==== //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_cbq.c#2 (text+ko) ====

@@ -1062,11 +1062,7 @@
 		/* currently only command that an ordinary user can call */
 		break;
 	default:
-#if (__FreeBSD_version > 400000)
-		error = suser(p);
-#else
-		error = suser(p->p_ucred, &p->p_acflag);
-#endif
+		error = cap_check(p, CAP_NET_ADMIN);
 		if (error)
 			return (error);
 		break;

==== //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_cdnr.c#2 (text+ko) ====

@@ -1262,11 +1262,7 @@
 	case CDNR_GETSTATS:
 		break;
 	default:
-#if (__FreeBSD_version > 400000)
-		if ((error = suser(p)) != 0)
-#else
-		if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-#endif
+		if ((error = cap_check(p, CAP_NET_ADMIN)) != 0)
 			return (error);
 		break;
 	}

==== //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_hfsc.c#2 (text+ko) ====

@@ -1975,13 +1975,8 @@
 	case HFSC_GETSTATS:
 		break;
 	default:
-#if (__FreeBSD_version > 400000)
-		if ((error = suser(p)) != 0)
+		if ((error = cap_check(p, CAP_NET_ADMIN)) != 0)
 			return (error);
-#else
-		if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-			return (error);
-#endif
 		break;
 	}
 

==== //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_priq.c#2 (text+ko) ====

@@ -772,13 +772,8 @@
 	case PRIQ_GETSTATS:
 		break;
 	default:
-#if (__FreeBSD_version > 400000)
-		if ((error = suser(p)) != 0)
+		if ((error = cap_check(p, CAP_NET_ADMIN)) != 0)
 			return (error);
-#else
-		if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-			return (error);
-#endif
 		break;
 	}
 

==== //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_red.c#2 (text+ko) ====

@@ -781,11 +781,7 @@
 	case RED_GETSTATS:
 		break;
 	default:
-#if (__FreeBSD_version > 400000)
-		if ((error = suser(p)) != 0)
-#else
-		if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-#endif
+		if ((error = cap_check(p, CAP_NET_ADMIN)) != 0)
 			return (error);
 		break;
 	}

==== //depot/projects/trustedbsd/sebsd/sys/contrib/altq/altq/altq_rio.c#2 (text+ko) ====

@@ -531,13 +531,8 @@
 	case RIO_GETSTATS:
 		break;
 	default:
-#if (__FreeBSD_version > 400000)
-		if ((error = suser(p)) != 0)
+		if ((error = cap_check(p, CAP_NET_ADMIN)) != 0)
 			return (error);
-#else
-		if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-			return (error);
-#endif
 		break;
 	}
 
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list