Bug#29497: marked as done (glibc: m68k lchown sanity for 2.0/2.1 compatibility)
Your message dated Sun, 7 Feb 1999 19:54:09 -0800
with message-id <v04104418b2decee150a6@[206.163.71.146]>
and subject line Closing fixed bugs.
has caused the attached bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Ian Jackson
(administrator, Debian bugs database)
Received: (at submit) by bugs.debian.org; 16 Nov 1998 04:44:28 +0000
Received: (qmail 31408 invoked from network); 16 Nov 1998 04:44:25 -0000
Received: from dialupb252.watervalley.net (HELO localhost.watervalley.net) (quango@206.28.121.252)
by master.debian.org with SMTP; 16 Nov 1998 04:44:25 -0000
Received: (from quango@localhost)
by localhost.watervalley.net (8.9.1a/8.9.1/Debian/GNU) id WAA13103;
Sun, 15 Nov 1998 22:44:14 -0600
Date: Sun, 15 Nov 1998 22:44:14 -0600
Message-Id: <199811160444.WAA13103@localhost.watervalley.net>
From: Chris Lawrence <quango@watervalley.net>
Subject: glibc: m68k lchown sanity for 2.0/2.1 compatibility
To: submit@bugs.debian.org
X-Mailer: bug 3.1.7
Package: libc6
Version: 2.0.7u-4
The following complete file should be added to glibc (including upstream) to
provide lchown() to both 2.0 and 2.1 kernels, using the 2.1-specific
lchown() (which follows symlinks on m68k) where available.
File: sysdeps/unix/sysv/linux/m68k/lchown.c
***BEGIN
/* Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
/*
[ from ../x86/chown.c: ]
In Linux 2.1.x the chown functions have been changed. A new function lchown
was introduced. The new chown now follows symlinks - the old chown and the
new lchown do not follow symlinks.
Let's try autodetecting. 980909 dichro-libc@rcpt.to
*/
#undef __NR_chown
#define __NR_chown 16
#undef __NR_lchown
#define __NR_lchown 182
int
__lchown (const char *file, uid_t owner, gid_t group)
{
static int state = 0;
int ret;
switch(state) {
case 0:
ret = syscall(__NR_lchown, file, owner, group);
if((ret != -1) || (errno != ENOSYS)) {
state = 2;
return ret;
}
state = 1;
case 1:
return syscall(__NR_chown, file, owner, group);
case 2:
return syscall(__NR_lchown, file, owner, group);
}
}
weak_alias (__lchown, lchown)
***END
-- System Information
Debian Release: slink
Kernel Version: Linux localhost.watervalley.net 2.1.127 #6 Sat Nov 14 15:13:38 CST 1998 m68k unknown
Versions of the packages libc6 depends on:
ii ldso 1.9.9-5 The Linux dynamic linker, library and utilit
Reply to: