From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27755 invoked by alias); 28 Jan 2006 16:55:24 -0000 Received: (qmail 27738 invoked by uid 22791); 28 Jan 2006 16:55:23 -0000 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 28 Jan 2006 16:55:22 +0000 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 6E4181BFDD for ; Sat, 28 Jan 2006 17:55:15 +0100 (CET) Date: Sat, 28 Jan 2006 16:55:00 -0000 From: Thorsten Kukuk To: libc-hacker@sources.redhat.com Subject: __atfct_seterrno() or futimesat() broken Message-ID: <20060128165511.GA4000@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00095.txt.bz2 Hi, if you call futimesat() without kernel syscall support and without /proc mounted you will get a seg.fault in __atfct_seterrno(): (gdb) down #0 0x400d8f53 in __atfct_seterrno (errval=2, fd=0, buf=0xbfffe4e0 "/proc/self/fd/0") at openat.c:61 61 *(char *) strchr (buf + sizeof "/proc/self/fd", '/') = '\0'; The problem is that all *at.c files uses: static const char procfd[] = "/proc/self/fd/%d/%s"; except futimesat.c, which does not append the filename after the file descriptor (as you can see from gdb output). So the strchr will not find a "/" and the return value is NULL. First question is: Should futimesat.c append the filename, too, or should it not call __atfct_seterrno? Second question about __atfct_seterrno: This function only checks for ENOTDIR if /proc is mounted. Why? utime() in futimesat.c returns ENOENT for this case: utimes("/proc/self/fd/0", NULL) = -1 ENOENT (No such file or directory) Shouldn't the check, if /proc is mounted, be the first on in __atfct_seterrno? Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SUSE LINUX Products GmbH Maxfeldstr. 5 D-90409 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B