From owner-freebsd-stable@FreeBSD.ORG Fri Dec 19 22:43:25 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C11D25B for ; Fri, 19 Dec 2014 22:43:25 +0000 (UTC) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 20EB4203D for ; Fri, 19 Dec 2014 22:43:24 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4EAEuplFSDaFve/2dsb2JhbABag1hYBIMBwx4KhSdKAoEsAQEBAQF9hAwBAQEDAQEBASArIAsFFhgCAg0FARMCKQEJJgYIBwQBHASIAwgNum+WLwEBAQEBAQQBAQEBAQEBAQEZgSGOAAEBGzQHEgGCVYFBBYlFiAaDHhmDCjCCMoVzhC2DOSKEDCAxAQZ+BxcifgEBAQ X-IronPort-AV: E=Sophos;i="5.07,609,1413259200"; d="scan'208";a="178075497" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 19 Dec 2014 17:43:18 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 881B9B4040; Fri, 19 Dec 2014 17:43:18 -0500 (EST) Date: Fri, 19 Dec 2014 17:43:18 -0500 (EST) From: Rick Macklem To: Christian Corti Message-ID: <376853369.1281572.1419028998536.JavaMail.root@uoguelph.ca> In-Reply-To: Subject: Re: New bug with O_CREAT|O_EXCL and NFS? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 22:43:25 -0000 Christian Corti wrote: > I've had big headaches finding the problem why "ssh -X host" destroys > the > permissions of the .Xauthority file in my NFS home directory. > 'host' is any of our FreeBSD 10.1-RELEASE servers (sparc64 and amd64) > Permissions before login: 0600 > Permissions after login: 0000 (ouch!) > > I've found out that the cause for this lies in the Xau library > (AuLock.c) > that creates a new file in XauLockAuth: > [...] > creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600); > [...] > > Wrote a small test program that makes just that open call, and the > result > is the same: the created file has permission 0000. > > This must be a regression, since I have a FreeBSD 9.0-RELEASE-p4 > system > (amd64) that does *not* have this problem. > > Is this a known problem? Any hints on solving that problem? For now, > I > must add a custom /etc/ssh/sshrc file with "chmod 600 ~/.Xauthority". > If you are using a Solaris NFS server then, yes, it is a known bug in the Solaris NFS server. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193128 If you are not using a Solaris server, then this needs to be investigated further, since I am only aware of the Solaris server case. As you'll see in the bug report, the Solaris server replies NFS_OK to the Setattr, but does not set the mode. If you change the client to specify "use server time" for the time setting, then the Solaris server does set the file mode. Until I add a mount option in the client to force "use server's time" workarounds are: - Use a non-Solaris NFS server. - Use NFSv2, which seems to work ok. ("nfsv2" or "vers=2" mount option) - Hack your kernel with the patch in the bug report. Please let us know if you are using a Solaris server? Thanks, rick > Christian > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to > "freebsd-stable-unsubscribe@freebsd.org" >