From owner-freebsd-current Wed Oct 16 8: 4:52 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2241437B401; Wed, 16 Oct 2002 08:04:47 -0700 (PDT) Received: from baraca.united.net.ua (ns.united.net.ua [193.111.8.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67E2B43E9E; Wed, 16 Oct 2002 08:04:36 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (xDSL-2-2.united.net.ua [193.111.9.226]) by baraca.united.net.ua (8.11.6/8.11.6) with ESMTP id g9GF4Nu55665; Wed, 16 Oct 2002 18:04:27 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.12.6/8.12.5) with ESMTP id g9GF4J6N012473; Wed, 16 Oct 2002 18:04:19 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3DAD8084.C60C5C0F@FreeBSD.org> Date: Wed, 16 Oct 2002 18:06:44 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Robert Watson Cc: Terry Lambert , "Danny J. Zerkel" , "Vladimir B. Grebenschikov,Moscow,408-7227,123-4567,Some-info" , freebsd-arch@FreeBSD.org, freebsd-current@FreeBSD.org Subject: Re: short uid/gid References: Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Robert Watson wrote: > > On Wed, 16 Oct 2002, Maxim Sobolev wrote: > > > What about source-level compatibility, which IMO is a good thing, at > > least if it doesn't add too much complexity (it clearly doesn't in this > > case)? Also, handling single flag should be easier from the coding > > perspective than a load of new values, after all we can do something > > like: > > I'm not convinced there's any value to providing the backward > compatibility that has to be asked for: the only benefit to the current > short-based API is that it allow serious security holes while not > following the standard API offered by other platforms (except Linux). > Freshly compiled applications should be using the proper types to > represent uid's and gid's -- if they're not doing that in the existing > code, they'll get truncated to the right size for "bug compatibility". If > they are using the correct size, they'll work correctly. To be able to > run properly on other platforms (vis Solaris), they already should be > using those types. Actually I am not proposing to keep the current short-based API. As I stated in my previous message, with such system in place all freshly-recompiled apps will use the new ABI automagically. > And it's not like the approach you've described makes it any easier to > implement: you still have to break out the old and new structures since > changing ipc_perm breaks the ABI for all of the System V interfaces, > rewrite the kernel code, etc. You might as well have added the > compatibility system calls since you still have to do all the mapping. I don't quite understand what you are trying to say. Linux does the following on the beginning and the end of each {shm,sem,msg}ctl call: {shm,sem,msg}ctl(...) { if (IPC_64 flag is not set) { convert user-supplied structure to a new 64-bit format } proceed as usual using 64-bit structure if (IPC_64 flag is not set) { convert result to be transferred back to user into old format } return } This is apparently much more compact, ABI-safe and easier to implement and maintain since we don't have two versions of mostly the same code. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message