[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#28569: marked as done (Patches for glibc to add proper lchown() support for Alphas)



Your message dated 7 Feb 1999 17:57:20 -0000
with message-id <19990207175720.8916.qmail@master.debian.org>
and subject line Bug#28569: fixed in glibc 2.0.7.19981211-4
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; 26 Oct 1998 18:12:03 +0000
Received: (qmail 12770 invoked from network); 26 Oct 1998 18:10:11 -0000
Received: from beezer.med.miami.edu (root@129.171.143.105)
  by master.debian.org with SMTP; 26 Oct 1998 18:10:11 -0000
Received: from beezer.med.miami.edu (chris@beezer.med.miami.edu [129.171.143.105])
	by beezer.med.miami.edu (8.8.8/8.8.8/Debian/GNU) with SMTP id NAA26293
	for <submit@bugs.debian.org>; Mon, 26 Oct 1998 13:09:49 -0500
Date: Mon, 26 Oct 1998 13:09:48 -0500 (EST)
From: Christopher C Chimelis <chris@classnet.med.miami.edu>
X-Sender: chris@beezer.med.miami.edu
To: submit@bugs.debian.org
Subject: Patches for glibc to add proper lchown() support for Alphas
Message-ID: <Pine.LNX.3.96.981026130255.25937A-100000@beezer.med.miami.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


Package: glibc
Version: 2.0.7u-3

Below is a patch for proper lchown() support on Alphas.  It auto-detects
lchown() support in the kernel and activates based on that.  This is
necessary for dpkg to operate properly under 2.1.x kernels on Alphas.

Thanks!
C

diff -Nru glibc-2.0.7u-orig/sysdeps/unix/sysv/linux/alpha/lchown.c glibc-2.0.7u/sysdeps/unix/sysv/linux/alpha/lchown.c
--- glibc-2.0.7u-orig/sysdeps/unix/sysv/linux/alpha/lchown.c	Thu Jan  1 08:00:00 1970
+++ glibc-2.0.7u/sysdeps/unix/sysv/linux/alpha/lchown.c	Tue Oct  6 17:34:30 1998
@@ -0,0 +1,58 @@
+/* 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
+*/
+
+#ifndef __NR_lchown
+#define __NR_lchown 208
+#endif
+
+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 __chown(file, owner, group);
+		case 2:
+			return syscall(__NR_lchown, file, owner, group);
+	}
+}
+
+weak_alias (__lchown, lchown)



Reply to: