Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Message-ID: <00a401c0c7f0$02bb1f30$0200a8c0@lifelesswks> From: "Robert Collins" To: "Corinna Vinschen" References: <20010418120530 DOT Q15962 AT cygbert DOT vinschen DOT de> Subject: Re: handle protection - please comment Date: Wed, 18 Apr 2001 20:11:53 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 18 Apr 2001 10:04:34.0959 (UTC) FILETIME=[F86079F0:01C0C7EE] ----- Original Message ----- From: "Corinna Vinschen" To: Sent: Wednesday, April 18, 2001 8:05 PM Subject: Re: handle protection - please comment > On Wed, Apr 18, 2001 at 10:54:06AM +1000, Robert Collins wrote: > > This is just a follow up to Egor's proposed server for handle control. > > > > On NT/2K, it should give exactly the desired permissions, no more, no > > less. > > For that purpose there are two functions declared in security.h: > > PSECURITY_ATTRIBUTES sec_user (PVOID sa_buf, PSID sid2 = NULL, BOOL inherit = TRUE); > PSECURITY_ATTRIBUTES sec_user_nih (PVOID sa_buf, PSID sid2 = NULL); > > For the usage have a look into sigproc.cc, function `getsem' or > fork.cc, function `fork_parent'. > > Corinna The problem with them is that they don't provide any granularity. Using alloc_sd, we can specify the access appropriately for each object. I.E. shmget takes a flags parameter that includes a file mode (ie 0666). How do we get an NT security descriptor for 0666 to pass to CreateFileMapping for instance? The thing egor as talking about was child process's needing to read the parents open handles, and that programs than setuid are apparently setting the perms to everyone, all to allow the child process with it's different uid to read the handles. He was proposing a server model, which I don't like because a) it adds complexity and overhead b) I don't believe _we_ should be doing the access checking, we should be passing that back to NT to do. Rob