Re: A question about ipcperm() call?

2006-07-27 Thread John Baldwin
On Sunday 23 July 2006 22:07, 李尚杰 wrote: The code for ipcperm() call : 93 if (mode IPC_M) { 94 error = suser(td); 95 if (error) 96 return (error); 97 } 116 if

Re: A question about ipcperm() call?

2006-07-24 Thread Robert Watson
On Mon, 24 Jul 2006, Xin LI wrote: On 7/24/06, 李尚杰 [EMAIL PROTECTED] wrote: The code for ipcperm() call : 78 ipcperm(td, perm, mode) 79 struct thread *td; 80 struct ipc_perm *perm; 81 int mode; 82 { 83 struct ucred *cred = td-td_ucred; 84 int

Re: A question about ipcperm() call?

2006-07-24 Thread Robert Watson
On Mon, 24 Jul 2006, Xin LI wrote: why not directly return the error in line 94? I think it makes sense to remove the assignment and the 'error' variable. Let's see Robert's opinion. I'm sorry, my previous answer was based on a mis-reading of the question -- you're not suggesting

Re: A question about ipcperm() call?

2006-07-24 Thread Alexander Leidinger
Quoting Robert Watson [EMAIL PROTECTED] (from Mon, 24 Jul 2006 13:04:45 +0100 (BST)): also. I would be interested in seeing reasonable restructurings of this code, perhaps as a set of blocks that looks at each requested operation or set of related operations and authorizes them sequentially.

A question about ipcperm() call?

2006-07-23 Thread 李尚杰
The code for ipcperm() call : 78 ipcperm(td, perm, mode) 79 struct thread *td; 80 struct ipc_perm *perm; 81 int mode; 82 { 83 struct ucred *cred = td-td_ucred; 84 int error; 85 86 if (cred-cr_uid != perm-cuid cred-cr_uid != perm-uid) { 87

Re: A question about ipcperm() call?

2006-07-23 Thread Xin LI
On 7/24/06, 李尚杰 [EMAIL PROTECTED] wrote: The code for ipcperm() call : 78 ipcperm(td, perm, mode) 79 struct thread *td; 80 struct ipc_perm *perm; 81 int mode; 82 { 83 struct ucred *cred = td-td_ucred; 84 int error; 85 86 if (cred-cr_uid !=