From takamune@avrl.mei.co.jp Mon Apr 19 04:16:03 1999
Return-Path: <takamune@avrl.mei.co.jp>
Received: from bulls.mei.co.jp (bulls.mei.co.jp [202.224.189.102])
	by hub.freebsd.org (Postfix) with ESMTP id 965D614C07
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Apr 1999 04:16:01 -0700 (PDT)
	(envelope-from takamune@avrl.mei.co.jp)
Received: by bulls.mei.co.jp (8.9.1/3.7W) with ESMTP id UAA24921
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Apr 1999 20:13:35 +0900 (JST)
Received: by dodgers.mei.co.jp (8.9.1/3.7W) with SMTP id UAA22084
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Apr 1999 20:13:35 +0900 (JST)
Received: by avrlgate1.avrl.mei.co.jp (8.6.10+2.4W/3.3W3-avrl3.0)
	id UAA02292; Mon, 19 Apr 1999 20:13:34 +0900
Received: by dream.avrl.mei.co.jp (8.9.3/3.6W-03/04/98-dream)
	id UAA82128; Mon, 19 Apr 1999 20:13:34 +0900 (JST)
Message-Id: <199904191113.UAA82128@dream.avrl.mei.co.jp>
Date: Mon, 19 Apr 1999 20:13:34 +0900 (JST)
From: takamune@avrl.mei.co.jp
Reply-To: takamune@avrl.mei.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: lutimes() is the same as utimes()
X-Send-Pr-Version: 3.2

>Number:         11213
>Category:       kern
>Synopsis:       lutimes() is the same as utimes()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 19 04:20:01 PDT 1999
>Closed-Date:    Fri Jul 30 02:06:04 PDT 1999
>Last-Modified:  Fri Jul 30 02:08:38 PDT 1999
>Originator:     Kazutoki TAKAMUNE
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
Matsushita Electric Industrial Co., Ltd.
>Environment:

FreeBSD 3.1-STABLE(Fri Apr 16 17:40:12 JST 1999)

>Description:

I wish touch(1) had a '-h' option, and then I looked some sources.

  o  src/usr.bin/touch/touch.c:
	Touch(1) calls utimes(2).
  o  src/sys/kern/vfs_syscalls.c:
	There is an system call lutimes(2) which is not documented,
	but it's much the same as utimes(2).
  o  NetBSD has lutimes(2) which does not follow links.

Lutimes(2) and futimes(2) are not documented.  Is it intentional ?

>How-To-Repeat:

I extracted system calls utimes() and lutimes() from
src/sys/kern/vfs_syscalls.c to corresponding temporary files 'utime.c'
and 'lutime.c'.  But there was no significant difference.

  % sed 's/lutimes/utimes/g' lutime.c | diff -u utime.c -

>Fix:

The attached patch is derived from NetBSD source
(src/sys/kern/vfs_syscalls.c).  But it has not tested at all.

The manual (src/lib/libc/sys/utimes.2) should simultaneously describe
lutimes(2) and futimes(2).

--- src/sys/kern/vfs_syscalls.c.orig	Sat Feb 27 16:10:39 1999
+++ src/sys/kern/vfs_syscalls.c	Mon Apr 19 19:22:40 1999
@@ -2211,7 +2211,7 @@
 	} else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
 	    sizeof (tv)))
   		return (error);
-	NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
+	NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
 	if (error = namei(&nd))
 		return (error);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: green 
State-Changed-When: Thu Jul 29 18:07:59 PDT 1999 
State-Changed-Why:  
BDE committed this to -STABLE, I found it separately (with Dan Nelson 
<dnelson@emsphone.com>) to -CURRENT. But now it's in both branches. 

Okay, this isn't an editor, so I can't back up. BDE knew about it, but 
hadn't actually commit it, which I did. Sorry for the correction :) 
State-Changed-From-To: closed->open 
State-Changed-By: green 
State-Changed-When: Thu Jul 29 18:27:07 PDT 1999 
State-Changed-Why:  
This is still open for documentation changes. 


Responsible-Changed-From-To: freebsd-bugs->freebsd-doc 
Responsible-Changed-By: green 
Responsible-Changed-When: Thu Jul 29 18:27:07 PDT 1999 
Responsible-Changed-Why:  
ditto 
Responsible-Changed-From-To: freebsd-doc->mpp 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Fri Jul 30 01:11:26 PDT 1999 
Responsible-Changed-Why:  
I'll work on documenting lutimes & futimes. 
State-Changed-From-To: open->closed 
State-Changed-By: mpp 
State-Changed-When: Fri Jul 30 02:06:04 PDT 1999 
State-Changed-Why:  
lutimes() and futimes() are now documented in rev 1.6 of libc/sys/utimes.2. 


Responsible-Changed-From-To: mpp->freebsd-doc 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Fri Jul 30 02:06:04 PDT 1999 
Responsible-Changed-Why:  
>Unformatted:
