From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 7 00:07:49 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 85CBBFDB for ; Thu, 7 Mar 2013 00:07:49 +0000 (UTC) (envelope-from nicholas@nickcwilson.co.uk) Received: from mail-qa0-f41.google.com (mail-qa0-f41.google.com [209.85.216.41]) by mx1.freebsd.org (Postfix) with ESMTP id 29A5531E for ; Thu, 7 Mar 2013 00:07:48 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id bs12so2886867qab.7 for ; Wed, 06 Mar 2013 16:07:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:x-originating-ip:in-reply-to :references:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=65J64GXFU/gaKMrKgsR7EFOVInlAAtV7ng/vu1ht3Sk=; b=S8hlq8UTCR2UkK8YcLP4IeHwkWKVzZB3NTOnGguRzkp1y0fgJGM0KxKT2syCwv9d/V 6IoZqoiUFGFmz7d8ieNm1XyBFytmjlnz+E56nON8cO7UufT2BjXQYXPxwHbmLKTMOQjP oQ97BhlXmJG1J0RzMUFTHcww3lTQiyFgDMqqsHPHe0P+MqPq3sbzHniT5ZDP4rcAvDp9 xf/Es+5oS4HLIEzwvQEfiQ6XbEGYWpfQyYhym+5gGSw20YbA3JKOtKGg4PsCFBZiCxLM N1gWW43W7PoUI24Cc1J2sii7h2qhx4yHsGgN/CnIVMs7c69UHqrIHT1Sh34yP5noF3fG 5+bg== X-Received: by 10.224.173.147 with SMTP id p19mr47971957qaz.78.1362614867784; Wed, 06 Mar 2013 16:07:47 -0800 (PST) Received: from mail-qe0-f43.google.com (mail-qe0-f43.google.com [209.85.128.43]) by mx.google.com with ESMTPS id c2sm1107897qeg.6.2013.03.06.16.07.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Mar 2013 16:07:47 -0800 (PST) Received: by mail-qe0-f43.google.com with SMTP id 1so5616009qee.16 for ; Wed, 06 Mar 2013 16:07:46 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.49.52.70 with SMTP id r6mr52320893qeo.20.1362614866490; Wed, 06 Mar 2013 16:07:46 -0800 (PST) Received: by 10.229.144.209 with HTTP; Wed, 6 Mar 2013 16:07:46 -0800 (PST) X-Originating-IP: [82.8.60.113] Received: by 10.229.144.209 with HTTP; Wed, 6 Mar 2013 16:07:46 -0800 (PST) In-Reply-To: References: Date: Thu, 7 Mar 2013 00:07:46 +0000 Message-ID: Subject: mkdir & open not setting sticky bit From: Nicholas Wilson To: "freebsd-hackers@freebsd.org" X-Gm-Message-State: ALoCoQm/6oHHFdU8kLpcLsFJuG55tNTBNrZYbdvwIueTSZGep4pLYTDMYbtXruWAh+U9G0uOUI1i Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 00:07:49 -0000 Hello, I'm guessing it's well known that BUGS in sticky(8) explains that BSD mkdir doesn't set the sticky bit. I'd like to fix that, but the fact that it's still there from historical BSD code suggests it's going to break something to change it (or surely it would have been done already!). I can't find a PR or any discussion over it though. It would be good to fix it, because of all the seven unixes our company supports, BSD's the only one with this quirk. Imagine if someone shipped a product with a security bug because directories weren't being created with the correct permissions? I might easily have done. If I wrote a patch for it, would I be wasting my time? The only difficulty I can imagine is changing semantics for existing applications, which seems extremely unlikely to cause breakage for this call. umask is ignored so doesn't complicate things; and POSIX & XSI explicitly allow both the current behaviour, and that implemented on every other Unix. Best, Nicholas