delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2020/07/23/15:12:16

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
s=badeba3b8450; t=1595531256;
bh=lE4/8zwvZYlh0LCFUrt1TpIHw7fjeV+vOM0XJtiZrIA=;
h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To;
b=f1lwTbgGY42kAwdAflprgxXXDtBdXORb4mbU24lrx7AzU3W3eoEmZwVIOsc99OLpp
QY8KjhNU5Fe7imWuKQLDrKKWRiIiu8j8PQeXrnvh32Fp2wd/VS2R+Ip2nSnbUEsb6R
hFNZH55864tIXaekT1s77+HZrHtrwqnZ2kNEk4yM=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Message-ID: <5F19DFF6.3020009@gmx.de>
Date: Thu, 23 Jul 2020 21:07:34 +0200
From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: User id
References: <CALPW7mQEoAS0V+Jfvnc9hsYdSXWctJ3FFnLYfNqiqSw=dQ5fPw AT mail DOT gmail DOT com>
In-Reply-To: <CALPW7mQEoAS0V+Jfvnc9hsYdSXWctJ3FFnLYfNqiqSw=dQ5fPw@mail.gmail.com>
X-Provags-ID: V03:K1:SX6/6h033ilsmRraYP+eTsMG3O3SUw9SlQL44y89sOHyZ1g0yhb
CEF9kCyCLEojN/h5/nNI6zPlSrS+6yPQs0XJxiHaNXs2n4MI5R4/qu5AW2fohNje6ajry1K
web57B8Xy4+ZF0TDM8lDuctb2/GTt+jwQaID3rFqCAeDgwxuNfg4l26KqoH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+ogMouBxDR8OtQlckkorf8K3lF/LmuguJPrOonhus0pmUMnqNpZn8FdsuoNlsxK
f7n/rhe+oJxkz+E592GhvlGbMbvKu2jjLgc7xyAXfCyb0+cOCHG7LBlNr9LoemeY9sHP/upx4
fdyI/QF3s4FZEN3At2VEFF1EbGw9r1m+AiuwvyO3alXc0l9Nm7vTo8PQFOxRiBLIgQB9MWvoj
l2SVbrt0d1Z5C4kLhEFksP3KOUVPQOr+X7NdFIpJZ3Pr1hkTpl5sj4XlXmPlDYU9IDHeZmBRP
cxvsmdNGn6qqfHNFAEFQt1fmp4YjxF4RQ7U8TaA==
Reply-To: djgpp AT delorie DOT com

Am 21.07.2020 21:25, schrieb A. Wik (awik32 AT gmail DOT com) [via djgpp AT delorie DOT com]:
> Hi all,
>
> How do I convince BASH that I'm root and that my UID is 0 and not 42?
>
> I've tried editing the "djgpp.env" file.
>
> I also tried installing an "etc/passwd" file under the djgpp
> directory, with "dosuser" listed as having uid 0.
>
> Regards,
> Albert.

There is no way to do what you want to do.
MSDOS does not know anything about uid and similars thus neither the port nor
the c library supports them in the way it is known from unix.  All versions
of this port have relayed on the getuid and setuid functions provided by the
library.  Because there is nothing like uid and alike on MSDOS these functions
emulate them for porting purposes with hard coded values.  In the case of uid/gid
the value is 42 when read by getuid and expects an uid of 42 when set by setuid;
any different value will make setuid fail with EPERM.
Currently I have no intentions to update the bash port providing such an uid/gid
emulation.  I even would not really know how to implement it in a way that it
becomes a serious emulation of the unix functionality completely missed on MSDOS.
If you are completely despaired to have a root uid behaviour, you will have
to modify the code of the [g|s]etui() functions of the library in such a way
that they read a defined environment variable that defines the current uid/gid
to be used. With this modified libc.a you can then recompile the bash port and
see what happens.  But it is clear that no other program than the recompiled
bash port will know about this modified g|s]etui().  In the worst case you
would have to recompile also the shell utilities and file utilities and some
other ports more.  And if they really behave as root user mode on plain DOS
needs to be investigated.
If all this is worth to be done must be decided by you.  I am also not really
convinced that this will work at all.

Regards,
Juan M. Guerrero

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019