PERFORCE change 100742 for review
Robert Watson
rwatson at FreeBSD.org
Thu Jul 6 13:05:42 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100742
Change 100742 by rwatson at rwatson_zoo on 2006/07/06 13:04:44
Further System V IPC renaming.
Affected files ...
.. //depot/projects/trustedbsd/mac2/sys/kern/sysv_msg.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/sysv_sem.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/sysv_shm.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/security/mac/mac_internal.h#3 edit
.. //depot/projects/trustedbsd/mac2/sys/sys/mac_framework.h#9 edit
.. //depot/projects/trustedbsd/mac2/sys/sys/mac_policy.h#18 edit
Differences ...
==== //depot/projects/trustedbsd/mac2/sys/kern/sysv_msg.c#3 (text+ko) ====
@@ -227,7 +227,7 @@
msghdrs[i-1].msg_next = &msghdrs[i];
msghdrs[i].msg_next = NULL;
#ifdef MAC
- mac_init_sysv_msgmsg(&msghdrs[i]);
+ mac_sysvmsg_init(&msghdrs[i]);
#endif
}
free_msghdrs = &msghdrs[0];
@@ -240,7 +240,7 @@
msqids[i].u.msg_perm.seq = 0; /* reset to a known value */
msqids[i].u.msg_perm.mode = 0;
#ifdef MAC
- mac_init_sysv_msgqueue(&msqids[i]);
+ mac_sysvmsq_init(&msqids[i]);
#endif
}
mtx_init(&msq_mtx, "msq", NULL, MTX_DEF);
@@ -272,9 +272,9 @@
#ifdef MAC
for (i = 0; i < msginfo.msgtql; i++)
- mac_destroy_sysv_msgmsg(&msghdrs[i]);
+ mac_sysvmsg_destroy(&msghdrs[i]);
for (msqid = 0; msqid < msginfo.msgmni; msqid++)
- mac_destroy_sysv_msgqueue(&msqids[msqid]);
+ mac_sysvmsq_destroy(&msqids[msqid]);
#endif
free(msgpool, M_MSG);
free(msgmaps, M_MSG);
@@ -374,7 +374,7 @@
msghdr->msg_next = free_msghdrs;
free_msghdrs = msghdr;
#ifdef MAC
- mac_cleanup_sysv_msgmsg(msghdr);
+ mac_sysvmsg_cleanup(msghdr);
#endif
}
@@ -444,9 +444,9 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msqctl(td->td_ucred, msqkptr, cmd);
+ error = mac_sysvmsq_check_msqctl(td->td_ucred, msqkptr, cmd);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msqctl returned %d\n", error));
+ MPRINTF(("mac_sysvmsq_check_msqctl returned %d\n", error));
goto done2;
}
#endif
@@ -474,9 +474,11 @@
*/
for (msghdr = msqkptr->u.msg_first; msghdr != NULL;
msghdr = msghdr->msg_next) {
- error = mac_check_sysv_msgrmid(td->td_ucred, msghdr);
+ error = mac_sysvmsq_check_msgrmid(td->td_ucred,
+ msghdr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msgrmid returned %d\n",
+ MPRINTF((
+ "mac_sysvmsq_check_msgrmid returned %d\n",
error));
goto done2;
}
@@ -504,7 +506,7 @@
msqkptr->u.msg_qbytes = 0; /* Mark it as free */
#ifdef MAC
- mac_cleanup_sysv_msgqueue(msqkptr);
+ mac_sysvmsq_cleanup(msqkptr);
#endif
wakeup(msqkptr);
@@ -607,9 +609,10 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msqget(cred, msqkptr);
+ error = mac_sysvmsq_check_msqget(cred, msqkptr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msqget returned %d\n",
+ MPRINTF((
+ "mac_sysvmsq_check_msqget returned %d\n",
error));
goto done2;
}
@@ -657,7 +660,7 @@
msqkptr->u.msg_rtime = 0;
msqkptr->u.msg_ctime = time_second;
#ifdef MAC
- mac_create_sysv_msgqueue(cred, msqkptr);
+ mac_sysvmsq_create(cred, msqkptr);
#endif
} else {
DPRINTF(("didn't find it and wasn't asked to create it\n"));
@@ -732,9 +735,9 @@
}
#ifdef MAC
- error = mac_check_sysv_msqsnd(td->td_ucred, msqkptr);
+ error = mac_sysvmsq_check_msqsnd(td->td_ucred, msqkptr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msqsnd returned %d\n", error));
+ MPRINTF(("mac_sysvmsq_check_msqsnd returned %d\n", error));
goto done2;
}
#endif
@@ -858,7 +861,7 @@
* immediately? Or, should it be checked just before the msg is
* enqueued in the msgq (as it is done now)?
*/
- mac_create_sysv_msgmsg(td->td_ucred, msqkptr, msghdr);
+ mac_sysvmsg_create(td->td_ucred, msqkptr, msghdr);
#endif
/*
@@ -969,16 +972,16 @@
* Note: Since the task/thread allocates the msghdr and usually
* primes it with its own MAC label, for a majority of policies, it
* won't be necessary to check whether the msghdr has access
- * permissions to the msgq. The mac_check_sysv_msqsnd check would
+ * permissions to the msgq. The mac_sysvmsq_check_msqsnd check would
* suffice in that case. However, this hook may be required where
* individual policies derive a non-identical label for the msghdr
* from the current thread label and may want to check the msghdr
* enqueue permissions, along with read/write permissions to the
* msgq.
*/
- error = mac_check_sysv_msgmsq(td->td_ucred, msghdr, msqkptr);
+ error = mac_sysvmsq_check_msgmsq(td->td_ucred, msghdr, msqkptr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msqmsq returned %d\n", error));
+ MPRINTF(("mac_sysvmsq_check_msqmsq returned %d\n", error));
msg_freehdr(msghdr);
wakeup(msqkptr);
goto done2;
@@ -1071,9 +1074,9 @@
}
#ifdef MAC
- error = mac_check_sysv_msqrcv(td->td_ucred, msqkptr);
+ error = mac_sysvmsq_check_msqrcv(td->td_ucred, msqkptr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msqrcv returned %d\n", error));
+ MPRINTF(("mac_sysvmsq_check_msqrcv returned %d\n", error));
goto done2;
}
#endif
@@ -1092,10 +1095,10 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msgrcv(td->td_ucred,
+ error = mac_sysvmsq_check_msgrcv(td->td_ucred,
msghdr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_msgrcv "
+ MPRINTF(("mac_sysvmsq_check_msgrcv "
"returned %d\n", error));
goto done2;
}
@@ -1140,10 +1143,10 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msgrcv(
+ error = mac_sysvmsq_check_msgrcv(
td->td_ucred, msghdr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_"
+ MPRINTF(("mac_sysvmsq_check_"
"msgrcv returned %d\n",
error));
goto done2;
==== //depot/projects/trustedbsd/mac2/sys/kern/sysv_sem.c#3 (text+ko) ====
@@ -249,7 +249,7 @@
sema[i].u.sem_perm.mode = 0;
sema[i].u.sem_perm.seq = 0;
#ifdef MAC
- mac_init_sysv_sem(&sema[i]);
+ mac_sysvsem_init(&sema[i]);
#endif
}
for (i = 0; i < seminfo.semmni; i++)
@@ -275,7 +275,7 @@
EVENTHANDLER_DEREGISTER(process_exit, semexit_tag);
#ifdef MAC
for (i = 0; i < seminfo.semmni; i++)
- mac_destroy_sysv_sem(&sema[i]);
+ mac_sysvsem_destroy(&sema[i]);
#endif
free(sem, M_SEM);
free(sema, M_SEM);
@@ -618,9 +618,9 @@
if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R)))
goto done2;
#ifdef MAC
- error = mac_check_sysv_semctl(cred, semakptr, cmd);
+ error = mac_sysvsem_check_semctl(cred, semakptr, cmd);
if (error != 0) {
- MPRINTF(("mac_check_sysv_semctl returned %d\n",
+ MPRINTF(("mac_sysvsem_check_semctl returned %d\n",
error));
goto done2;
}
@@ -645,9 +645,9 @@
sema_mtxp = &sema_mtx[semidx];
#ifdef MAC
mtx_lock(sema_mtxp);
- error = mac_check_sysv_semctl(cred, semakptr, cmd);
+ error = mac_sysvsem_check_semctl(cred, semakptr, cmd);
if (error != 0) {
- MPRINTF(("mac_check_sysv_semctl returned %d\n", error));
+ MPRINTF(("mac_sysvsem_check_semctl returned %d\n", error));
mtx_unlock(sema_mtxp);
return (error);
}
@@ -676,7 +676,7 @@
}
semakptr->u.sem_perm.mode = 0;
#ifdef MAC
- mac_cleanup_sysv_sem(semakptr);
+ mac_sysvsem_cleanup(semakptr);
#endif
SEMUNDO_LOCK();
semundo_clear(semidx, -1);
@@ -922,9 +922,10 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_semget(cred, &sema[semid]);
+ error = mac_sysvsem_check_semget(cred, &sema[semid]);
if (error != 0) {
- MPRINTF(("mac_check_sysv_semget returned %d\n",
+ MPRINTF((
+ "mac_sysvsem_check_semget returned %d\n",
error));
goto done2;
}
@@ -974,7 +975,7 @@
bzero(sema[semid].u.sem_base,
sizeof(sema[semid].u.sem_base[0])*nsems);
#ifdef MAC
- mac_create_sysv_sem(cred, &sema[semid]);
+ mac_sysvsem_create(cred, &sema[semid]);
#endif
DPRINTF(("sembase = 0x%x, next = 0x%x\n",
sema[semid].u.sem_base, &sem[semtot]));
@@ -1083,9 +1084,9 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_semop(td->td_ucred, semakptr, j);
+ error = mac_sysvsem_check_semop(td->td_ucred, semakptr, j);
if (error != 0) {
- MPRINTF(("mac_check_sysv_semop returned %d\n", error));
+ MPRINTF(("mac_sysvsem_check_semop returned %d\n", error));
goto done2;
}
#endif
==== //depot/projects/trustedbsd/mac2/sys/kern/sysv_shm.c#3 (text+ko) ====
@@ -260,7 +260,7 @@
shm_nused--;
shmseg->u.shm_perm.mode = SHMSEG_FREE;
#ifdef MAC
- mac_cleanup_sysv_shm(shmseg);
+ mac_sysvshm_cleanup(shmseg);
#endif
}
@@ -331,9 +331,9 @@
}
#ifdef MAC
shmsegptr = &shmsegs[IPCID_TO_IX(shmmap_s->shmid)];
- error = mac_check_sysv_shmdt(td->td_ucred, shmsegptr);
+ error = mac_sysvshm_check_shmdt(td->td_ucred, shmsegptr);
if (error != 0) {
- MPRINTF(("mac_check_sysv_shmdt returned %d\n", error));
+ MPRINTF(("mac_sysvshm_check_shmdt returned %d\n", error));
goto done2;
}
#endif
@@ -392,9 +392,9 @@
if (error)
goto done2;
#ifdef MAC
- error = mac_check_sysv_shmat(td->td_ucred, shmseg, shmflg);
+ error = mac_sysvshm_check_shmat(td->td_ucred, shmseg, shmflg);
if (error != 0) {
- MPRINTF(("mac_check_sysv_shmat returned %d\n", error));
+ MPRINTF(("mac_sysvshm_check_shmat returned %d\n", error));
goto done2;
}
#endif
@@ -513,9 +513,9 @@
if (error)
goto done2;
#ifdef MAC
- error = mac_check_sysv_shmctl(td->td_ucred, shmseg, uap->cmd);
+ error = mac_sysvshm_check_shmctl(td->td_ucred, shmseg, uap->cmd);
if (error != 0) {
- MPRINTF(("mac_check_sysv_shmctl returned %d\n",
+ MPRINTF(("mac_sysvshm_check_shmctl returned %d\n",
error));
goto done2;
}
@@ -603,9 +603,9 @@
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_shmctl(td->td_ucred, shmseg, cmd);
+ error = mac_sysvshm_check_shmctl(td->td_ucred, shmseg, cmd);
if (error != 0) {
- MPRINTF(("mac_check_sysv_shmctl returned %d\n", error));
+ MPRINTF(("mac_sysvshm_check_shmctl returned %d\n", error));
goto done2;
}
#endif
@@ -732,9 +732,9 @@
if ((uap->shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL))
return (EEXIST);
#ifdef MAC
- error = mac_check_sysv_shmget(td->td_ucred, shmseg, uap->shmflg);
+ error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, uap->shmflg);
if (error != 0) {
- MPRINTF(("mac_check_sysv_shmget returned %d\n", error));
+ MPRINTF(("mac_sysvshm_check_shmget returned %d\n", error));
return (error);
}
#endif
@@ -815,7 +815,7 @@
shmseg->u.shm_lpid = shmseg->u.shm_nattch = 0;
shmseg->u.shm_atime = shmseg->u.shm_dtime = 0;
#ifdef MAC
- mac_create_sysv_shm(cred, shmseg);
+ mac_sysvshm_create(cred, shmseg);
#endif
shmseg->u.shm_ctime = time_second;
shm_committed += btoc(size);
@@ -953,7 +953,7 @@
shmsegs[i].u.shm_perm.mode = SHMSEG_FREE;
shmsegs[i].u.shm_perm.seq = 0;
#ifdef MAC
- mac_init_sysv_shm(&shmsegs[i]);
+ mac_sysvshm_init(&shmsegs[i]);
#endif
}
free(shmsegs, M_SHM);
@@ -985,7 +985,7 @@
shmsegs[i].u.shm_perm.mode = SHMSEG_FREE;
shmsegs[i].u.shm_perm.seq = 0;
#ifdef MAC
- mac_init_sysv_shm(&shmsegs[i]);
+ mac_sysvshm_init(&shmsegs[i]);
#endif
}
shm_last_free = 0;
@@ -1007,7 +1007,7 @@
#ifdef MAC
for (i = 0; i < shmalloced; i++)
- mac_destroy_sysv_shm(&shmsegs[i]);
+ mac_sysvshm_destroy(&shmsegs[i]);
#endif
free(shmsegs, M_SHM);
shmexit_hook = NULL;
==== //depot/projects/trustedbsd/mac2/sys/security/mac/mac_internal.h#3 (text+ko) ====
==== //depot/projects/trustedbsd/mac2/sys/sys/mac_framework.h#9 (text+ko) ====
@@ -265,8 +265,6 @@
void mac_sysvmsq_init(struct msqid_kernel*);
void mac_sysvmsq_destroy(struct msqid_kernel *);
void mac_sysvmsq_cleanup(struct msqid_kernel *msqkptr);
-void mac_sysvmsq_create_msg(struct ucred *cred,
- struct msqid_kernel *msqkptr, struct msg *msgptr);
void mac_sysvmsq_create(struct ucred *cred,
struct msqid_kernel *msqkptr);
int mac_sysvmsq_check_msgmsq(struct ucred *cred, struct msg *msgptr,
@@ -285,12 +283,14 @@
void mac_sysvmsg_init(struct msg *);
void mac_sysvmsg_destroy(struct msg *);
void mac_sysvmsg_cleanup(struct msg *msgptr);
+void mac_sysvmsg_create(struct ucred *cred, struct msqid_kernel *msqkptr,
+ struct msg *msgptr);
void mac_sysvsem_init(struct semid_kernel*);
void mac_sysvsem_destroy(struct semid_kernel *);
void mac_sysvsem_create(struct ucred *cred,
struct semid_kernel *semakptr);
-void mac_sysvsem_cleanup_sysvsem(struct semid_kernel *semakptr);
+void mac_sysvsem_cleanup(struct semid_kernel *semakptr);
int mac_sysvsem_check_semctl(struct ucred *cred,
struct semid_kernel *semakptr, int cmd);
int mac_sysvsem_check_semget(struct ucred *cred,
==== //depot/projects/trustedbsd/mac2/sys/sys/mac_policy.h#18 (text+ko) ====
@@ -393,9 +393,6 @@
typedef void (*mpo_sysvmsq_init_label_t)(struct label *label);
typedef void (*mpo_sysvmsq_destroy_t)(struct label *label);
typedef void (*mpo_sysvmsq_cleanup_t)(struct label *msqlabel);
-typedef void (*mpo_sysvmsq_create_msg_t)(struct ucred *cred,
- struct msqid_kernel *msqkptr, struct label *msqlabel,
- struct msg *msgptr, struct label *msglabel);
typedef void (*mpo_sysvmsq_create_t)(struct ucred *cred,
struct msqid_kernel *msqkptr, struct label *msqlabel);
typedef int (*mpo_sysvmsq_check_msgmsq_t)(struct ucred *cred,
@@ -420,6 +417,9 @@
typedef void (*mpo_sysvmsg_init_label_t)(struct label *label);
typedef void (*mpo_sysvmsg_destroy_label_t)(struct label *label);
typedef void (*mpo_sysvmsg_cleanup_t)(struct label *msglabel);
+typedef void (*mpo_sysvmsg_create_t)(struct ucred *cred,
+ struct msqid_kernel *msqkptr, struct label *msqlabel,
+ struct msg *msgptr, struct label *msglabel);
/*
* Object: struct semid_kernel (System V IPC semaphore)
@@ -801,7 +801,6 @@
mpo_sysvmsq_init_label_t mpo_sysvmsq_init_label;
mpo_sysvmsq_destroy_t mpo_sysvmsq_destroy;
mpo_sysvmsq_cleanup_t mpo_sysvmsq_cleanup;
- mpo_sysvmsq_create_msg_t mpo_sysvmsq_create_msg;
mpo_sysvmsq_create_t mpo_sysvmsq_create;
mpo_sysvmsq_check_msgmsq_t mpo_sysvmsq_check_msgmsq;
mpo_sysvmsq_check_msgrcv_t mpo_sysvmsq_check_msgrcv;
@@ -814,6 +813,7 @@
mpo_sysvmsg_init_label_t mpo_sysvmsg_init_label;
mpo_sysvmsg_destroy_label_t mpo_sysvmsg_destroy_label;
mpo_sysvmsg_cleanup_t mpo_sysvmsg_cleanup;
+ mpo_sysvmsg_create_t mpo_sysvmsg_create;
mpo_sysvsem_init_label_t mpo_sysvsem_init_label;
mpo_sysvsem_destroy_label_t mpo_sysvsem_destroy_label;
More information about the trustedbsd-cvs
mailing list