NetBSD Problem Report #39124

From  Thu Jul 10 16:24:33 2008
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id B172863B9AA
	for <>; Thu, 10 Jul 2008 16:24:33 +0000 (UTC)
Message-Id: <>
Date: Thu, 10 Jul 2008 18:24:36 +0200 (CEST)
Subject: VOP_CREATE() gets no uid/gid in vattr
X-Send-Pr-Version: 3.95

>Number:         39124
>Category:       kern
>Synopsis:       VOP_CREATE() gets no uid/gid in vattr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 10 16:25:00 +0000 2008
>Last-Modified:  Thu Jul 10 16:45:01 +0000 2008
>Originator:     Reinoud Zandijk
>Release:        NetBSD 4.99.55


System: NetBSD 4.99.55 NetBSD 4.99.55 (GENERIC) #0: Sun Mar 2 21:22:35 CET 2008 i386
Architecture: i386
Machine: i386
When implementing UDF i found that the vattr argument passed on every
VOP_CREATE() always specified (uid=-1, gid=-1). I assumed these were the
defaults and that the kernel would issue a VOP_SETATTR() with the correct
uid/gid later.

When confronted with wierd uid/gid access results, i dug into tmpfs and UFS
and noticed that they didn't even pass the vattr down but both use
	uid = kauth_cred_geteuid(cnp->cn_cred);
	gid = parent_dir->gid;

Shouldn't these uid/gid's be passed in the VOP_CREATE()'s vattr?

Check the passed uid/gid on VOP_CREATE() to any FS.

Take up this code in the VOP_CREATE() calling code or in the veneers?

From: Reinoud Zandijk <>
Subject: PR/39124 CVS commit: src/sys/fs/udf
Date: Thu, 10 Jul 2008 16:41:00 +0000 (UTC)

 Module Name:	src
 Committed By:	reinoud
 Date:		Thu Jul 10 16:41:00 UTC 2008

 Modified Files:
 	src/sys/fs/udf: udf_subr.c

 Log Message:
 On node creation, follow tmpfs and UFS by generating the uid/gid pair. This
 fixes the lack of file ownership preservation on file/directory creation.

 See PR kern/39124

 To generate a diff of this commit:
 cvs rdiff -r1.55 -r1.56 src/sys/fs/udf/udf_subr.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.