Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Apr 1999 20:13:34 +0900 (JST)
From:      takamune@avrl.mei.co.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/11213: lutimes() is the same as utimes()
Message-ID:  <199904191113.UAA82128@dream.avrl.mei.co.jp>

next in thread | raw e-mail | index | archive | help

>Number:         11213
>Category:       kern
>Synopsis:       lutimes() is the same as utimes()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 19 04:20:01 PDT 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904191113.UAA82128>