From: Zdenek Pavlas <pavlas@nextra.cz>
To: Rob Landley <rob@landley.net>
Cc: uclibc@uclibc.org, Matt Mackall <mpm@selenic.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/15] misc: Make *[ug]id16 support optional
Date: Wed, 21 Dec 2005 18:30:37 +0100 [thread overview]
Message-ID: <43A9913D.4070004@nextra.cz> (raw)
In-Reply-To: <200512201050.05278.rob@landley.net>
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
Rob Landley wrote:
> They've been fixing that. Working with linux-tiny is definitely something
> uClibc is interested in. When you say "patches like this", do you have a
> complete list or is there something we could grep for?
I've made linux-tiny + uClibc + busybox to work with following patch.
Very lightly tested, not sure it's correct or complete, but at least
stuff like 'su', 'chown' etc started to work.
--
Zdenek Pavlas
Application Developer
NEXTRA Czech Republic s.r.o. http://www.nextra.cz
[-- Attachment #2: uClibc-no-ugid16.patch --]
[-- Type: text/plain, Size: 5201 bytes --]
--- uClibc-0.9.28/libc/sysdeps/linux/common/chown.c
+++ uclibc/libc/sysdeps/linux/common/chown.c
@@ -10,16 +10,11 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___syscall_chown __NR_chown
+#define __NR___syscall_chown __NR_chown32
static inline _syscall3(int, __syscall_chown, const char *, path,
__kernel_uid_t, owner, __kernel_gid_t, group);
int chown(const char *path, uid_t owner, gid_t group)
{
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
- __set_errno(EINVAL);
- return -1;
- }
return (__syscall_chown(path, owner, group));
}
--- uClibc-0.9.28/libc/sysdeps/linux/common/fchown.c
+++ uclibc/libc/sysdeps/linux/common/fchown.c
@@ -10,16 +10,11 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___syscall_fchown __NR_fchown
+#define __NR___syscall_fchown __NR_fchown32
static inline _syscall3(int, __syscall_fchown, int, fd,
__kernel_uid_t, owner, __kernel_gid_t, group);
int fchown(int fd, uid_t owner, gid_t group)
{
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
- __set_errno(EINVAL);
- return -1;
- }
return (__syscall_fchown(fd, owner, group));
}
--- uClibc-0.9.28/libc/sysdeps/linux/common/getegid.c
+++ uclibc/libc/sysdeps/linux/common/getegid.c
@@ -11,7 +11,7 @@
#include <unistd.h>
#ifdef __NR_getegid
-#define __NR___syscall_getegid __NR_getegid
+#define __NR___syscall_getegid __NR_getegid32
static inline _syscall0(int, __syscall_getegid);
gid_t getegid(void)
{
--- uClibc-0.9.28/libc/sysdeps/linux/common/geteuid.c
+++ uclibc/libc/sysdeps/linux/common/geteuid.c
@@ -11,7 +11,7 @@
#include <unistd.h>
#ifdef __NR_geteuid
-#define __NR___syscall_geteuid __NR_geteuid
+#define __NR___syscall_geteuid __NR_geteuid32
static inline _syscall0(int, __syscall_geteuid);
uid_t geteuid(void)
{
--- uClibc-0.9.28/libc/sysdeps/linux/common/getgid.c
+++ uclibc/libc/sysdeps/linux/common/getgid.c
@@ -10,7 +10,7 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___syscall_getgid __NR_getgid
+#define __NR___syscall_getgid __NR_getgid32
#if defined (__alpha__)
#define __NR_getgid __NR_getxgid
#endif
--- uClibc-0.9.28/libc/sysdeps/linux/common/getuid.c
+++ uclibc/libc/sysdeps/linux/common/getuid.c
@@ -13,7 +13,7 @@
#if defined (__alpha__)
#define __NR_getuid __NR_getxuid
#endif
-#define __NR___syscall_getuid __NR_getuid
+#define __NR___syscall_getuid __NR_getuid32
static inline _syscall0(int, __syscall_getuid);
--- uClibc-0.9.28/libc/sysdeps/linux/common/lchown.c
+++ uclibc/libc/sysdeps/linux/common/lchown.c
@@ -10,16 +10,11 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___syscall_lchown __NR_lchown
+#define __NR___syscall_lchown __NR_lchown32
static inline _syscall3(int, __syscall_lchown, const char *, path,
__kernel_uid_t, owner, __kernel_gid_t, group);
int lchown(const char *path, uid_t owner, gid_t group)
{
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
- __set_errno(EINVAL);
- return -1;
- }
return __syscall_lchown(path, owner, group);
}
--- uClibc-0.9.28/libc/sysdeps/linux/common/setegid.c
+++ uclibc/libc/sysdeps/linux/common/setegid.c
@@ -10,12 +10,6 @@
{
int result;
- if (gid == (gid_t) ~0)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
#ifdef __NR_setresgid
result = setresgid(-1, gid, -1);
if (result == -1 && errno == ENOSYS)
--- uClibc-0.9.28/libc/sysdeps/linux/common/seteuid.c
+++ uclibc/libc/sysdeps/linux/common/seteuid.c
@@ -10,12 +10,6 @@
{
int result;
- if (uid == (uid_t) ~0)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
#ifdef __NR_setresuid
result = setresuid(-1, uid, -1);
if (result == -1 && errno == ENOSYS)
--- uClibc-0.9.28/libc/sysdeps/linux/common/setgid.c
+++ uclibc/libc/sysdeps/linux/common/setgid.c
@@ -10,14 +10,10 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___syscall_setgid __NR_setgid
+#define __NR___syscall_setgid __NR_setgid32
static inline _syscall1(int, __syscall_setgid, __kernel_gid_t, gid);
int setgid(gid_t gid)
{
- if (gid == (gid_t) ~ 0 || gid != (gid_t) ((__kernel_gid_t) gid)) {
- __set_errno(EINVAL);
- return -1;
- }
return (__syscall_setgid(gid));
}
--- uClibc-0.9.28/libc/sysdeps/linux/common/setgroups.c
+++ uclibc/libc/sysdeps/linux/common/setgroups.c
@@ -11,7 +11,7 @@
#include <unistd.h>
#include <grp.h>
-#define __NR___syscall_setgroups __NR_setgroups
+#define __NR___syscall_setgroups __NR_setgroups32
static inline _syscall2(int, __syscall_setgroups,
size_t, size, const __kernel_gid_t *, list);
--- uClibc-0.9.28/libc/sysdeps/linux/common/setuid.c
+++ uclibc/libc/sysdeps/linux/common/setuid.c
@@ -10,14 +10,10 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___syscall_setuid __NR_setuid
+#define __NR___syscall_setuid __NR_setuid32
static inline _syscall1(int, __syscall_setuid, __kernel_uid_t, uid);
int setuid(uid_t uid)
{
- if (uid == (uid_t) ~ 0 || uid != (uid_t) ((__kernel_uid_t) uid)) {
- __set_errno(EINVAL);
- return -1;
- }
return (__syscall_setuid(uid));
}
next prev parent reply other threads:[~2005-12-21 17:31 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-11 8:35 [PATCH 0/15] misc: Miscellaneous bits from -tiny Matt Mackall
2005-11-11 8:35 ` [PATCH 1/15] misc: Add bloat-o-meter to scripts Matt Mackall
2005-11-11 8:35 ` [PATCH 2/15] misc: Uninline some namei.c functions Matt Mackall
2005-11-11 8:35 ` [PATCH 3/15] misc: Uninline some open.c functions Matt Mackall
2005-11-11 8:35 ` [PATCH 4/15] misc: Uninline some inode.c functions Matt Mackall
2005-11-11 8:35 ` [PATCH 5/15] misc: Uninline some fslocks.c functions Matt Mackall
2005-11-11 8:35 ` [PATCH 6/15] misc: Trim non-IPX builds Matt Mackall
2005-11-11 8:35 ` [PATCH 7/15] misc: Make x86 doublefault handling optional Matt Mackall
2005-11-11 8:35 ` [PATCH 8/15] misc: Make vm86 support optional Matt Mackall
2005-11-11 8:35 ` [PATCH 9/15] misc: Make sysenter " Matt Mackall
2005-11-11 8:35 ` [PATCH 10/15] misc: Make *[ug]id16 " Matt Mackall
2005-11-11 8:35 ` [PATCH 11/15] misc: Allow dropping panic text strings from kernel image Matt Mackall
2005-11-11 8:35 ` [PATCH 12/15] misc: Configurable panic support Matt Mackall
2005-11-11 8:35 ` [PATCH 13/15] misc: Configure ELF core dump support Matt Mackall
2005-11-11 8:35 ` [PATCH 14/15] misc: Configurable number of supported IDE interfaces Matt Mackall
2005-11-11 8:35 ` [PATCH 15/15] misc: Configurable support for PCI serial ports Matt Mackall
2005-11-11 11:03 ` Geert Uytterhoeven
2006-01-07 16:50 ` Russell King
2006-01-08 2:26 ` Matt Mackall
2005-11-11 10:14 ` [PATCH 14/15] misc: Configurable number of supported IDE interfaces Bartlomiej Zolnierkiewicz
2005-11-11 17:18 ` Matt Mackall
2005-11-11 17:34 ` Roman Zippel
2005-11-11 17:37 ` Matt Mackall
2005-11-11 17:47 ` Matt Mackall
2005-11-11 17:49 ` Roman Zippel
2005-11-11 11:03 ` [PATCH 11/15] misc: Allow dropping panic text strings from kernel image Geert Uytterhoeven
2005-11-11 17:21 ` Matt Mackall
2005-11-12 6:06 ` Andrew Morton
2005-11-11 10:22 ` [PATCH 10/15] misc: Make *[ug]id16 support optional Geert Uytterhoeven
2005-11-16 13:21 ` Rob Landley
2005-11-16 18:01 ` Matt Mackall
2005-12-20 15:46 ` Zdenek Pavlas
2005-12-20 16:50 ` Rob Landley
2005-12-21 17:30 ` Zdenek Pavlas [this message]
2005-11-12 5:57 ` [PATCH 9/15] misc: Make sysenter " Andrew Morton
2005-11-12 5:55 ` [PATCH 8/15] misc: Make vm86 " Andrew Morton
2005-11-13 3:30 ` [PATCH 7/15] misc: Make x86 doublefault handling optional Andi Kleen
2005-11-16 13:13 ` Rob Landley
2005-11-16 18:21 ` Matt Mackall
2005-11-16 19:21 ` Scott Garfinkle
2005-11-16 19:45 ` Adrian Bunk
2005-12-12 10:36 ` Ingo Molnar
2005-12-12 16:22 ` Andi Kleen
2005-12-12 15:32 ` Matt Mackall
2005-12-13 8:39 ` Ingo Molnar
2005-11-14 1:57 ` [PATCH 6/15] misc: Trim non-IPX builds Adrian Bunk
2005-11-18 5:22 ` [2.6 patch] move some code to net/ipx/af_ipx.c Adrian Bunk
2005-11-18 17:27 ` Matt Mackall
2005-11-18 20:24 ` Arnaldo Carvalho de Melo
2005-12-05 21:35 ` Adrian Bunk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43A9913D.4070004@nextra.cz \
--to=pavlas@nextra.cz \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=rob@landley.net \
--cc=uclibc@uclibc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox