NetBSD Problem Report #576
From gnats Tue Nov 15 15:40:51 1994
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id PAA05147 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Tue, 15 Nov 1994 15:40:44 -0800
Message-Id: <9411152332.AA00385@cotton.fs.telcom.oki.co.jp>
Date: Wed, 16 Nov 94 08:32:05 JST
From: oki@fs.telcom.oki.co.jp (Masaru Oki)
Reply-To: oki@fs.telcom.oki.co.jp
To: gnats-bugs@NetBSD.ORG
Subject: can't remove symlink created on the directory with sticky bit
X-Send-Pr-Version: 3.2
>Number: 576
>Category: kern
>Synopsis: can't remove symlink created on the directory with sticky bit
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 15 15:50:02 +0000 1994
>Closed-Date: Wed Feb 07 19:01:12 +0000 1996
>Last-Modified: Thu Feb 08 00:02:51 +0000 1996
>Originator: Masaru Oki
>Release: unknown-1.0
>Organization:
cotton
>Environment:
NetBSD/x68k 1.0_BETA
>Description:
When symlink is created on the directory with
sticky bit (ex. /tmp mounted with MFS), owner of
created symlink is same as owner of directory.
because, other users (true symlink creaters)
can't remove the symlink.
>How-To-Repeat:
% whoami
oki
% /cd tmp
% ln -s foo bar
% rm bar
rm: bar: Operation not permitted.
>Fix:
for NetBSD 1.0_BETA (10/18 tar balls):
--- src/sys/ufs/ufs/ufs_vnops.c.orig Wed Jun 29 19:33:48 1994
+++ src/sys/ufs/ufs/ufs_vnops.c Wed Nov 16 08:27:52 1994
@@ -1916,10 +1916,7 @@
}
ip = VTOI(tvp);
ip->i_gid = pdir->i_gid;
- if ((mode & IFMT) == IFLNK)
- ip->i_uid = pdir->i_uid;
- else
- ip->i_uid = cnp->cn_cred->cr_uid;
+ ip->i_uid = cnp->cn_cred->cr_uid;
#ifdef QUOTA
if ((error = getinoquota(ip)) ||
(error = chkiq(ip, 1, cnp->cn_cred, 0))) {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: jtc
State-Changed-When: Wed Feb 7 19:01:12 1996
State-Changed-Why:
Reverted to sane symbolic link semantics, which fixes this bug.
>Unformatted:
Masaru Oki
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.