Skip to contentSkip to conversation

IPX without suidroot

DISCUSSION Stas Sergeev 2 participants 3 messages Aug 2, 2002 – Aug 5, 2002

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 2 lines · Grigory Batalov

IPX: GetLocalTarget for network cb971126
IPX: Received RIP information for network 261197cb

This time it finally received RIP, good!

Quoted 1 line

IPX: Failure -2 adding route <261197cb through 00000002:000102877d41>

Ouch, and this time it comes to the place which really requires root (CAP_NET_ADMIN capability)... Is this possible to set that route manually (being root)?
Maybe something like
ipx_route add 261197cb 02 102877d41 will do the trick?

But even that may not help. Currently dosemu doesn't check if the route exists *before* adding it, so it still may fail.
To do the check /proc/net/ipx_route must be parsed, but this is not what I can do without an ability to test the changes...
Anyway there were several bugs discovered, so I'd like to bring that investigation to some conclusion. So if adding route manually doesn't help, could you please (only for testing purposes) remove the
if (!capable(CAP_NET_ADMIN))
return -EPERM;
from kernel's af_ipx.c:2403 (ipx_ioctl() ).
I want to know if my patch
really works and if there is nothing more standing in the way...

#1 lore raw
Quoted 9 lines · On Fri, 02 Aug 2002 21:19:38 +0400 "Stas Sergeev" <[email protected]> wrote:
Quoted 1 line

IPX: Failure -2 adding route <261197cb through 00000002:000102877d41>

Ouch, and this time it comes to the place which really requires root (CAP_NET_ADMIN capability)... Is this possible to set that route manually (being root)?
Maybe something like
ipx_route add 261197cb 02 102877d41 will do the trick?

It is set already:

$ cat /proc/net/ipx_route 
Network    Router_Net   Router_Node
261197CB   00000002     000102877D41
00000002   Directly     Connected

I think this route was added when I started
dosemu as root before.

Quoted 1 line

But even that may not help.

I see.

Quoted 11 lines

Currently dosemu doesn't check if the route exists *before* adding it, so it still may fail.
To do the check /proc/net/ipx_route must be parsed, but this is not what I can do without an ability to test the changes...
Anyway there were several bugs discovered, so I'd like to bring that investigation to some conclusion.

Quoted 7 lines

So if adding route manually doesn't help, could you please (only for testing purposes) remove the
if (!capable(CAP_NET_ADMIN))
return -EPERM;
from kernel's af_ipx.c:2403 (ipx_ioctl() ).

Sure. Next week I'll do it and post results.

Quoted 3 lines

I want to know if my patch really works and if there is nothing more standing in the way...

Signature · 1 line
 Grigory Batalov.
#2 lore raw
In reply to Stas Sergeev
Quoted 10 lines · On Fri, 02 Aug 2002 21:19:38 +0400 Stas Sergeev <[email protected]> wrote:

So if adding route manually doesn't help, could you please (only for testing purposes) remove the
if (!capable(CAP_NET_ADMIN))
return -EPERM;
from kernel's af_ipx.c:2403 (ipx_ioctl() ).
I want to know if my patch
really works and if there is nothing more standing in the way...

Yes, it works.
In 2.2.20 custom kernel it is in line 2283:

case SIOCADDRT:
case SIOCDELRT:
// if(!capable(CAP_NET_ADMIN))

//                              return (-EPERM);
                        return (ipxrtr_ioctl(cmd,(void *)arg));

Again, log is here:
http://lrn.ru/~bga/dosemu/attached-boot.log.bz2 (131565) Now I can attach server and run needed programs. Thank you, Stas!

One strange thing I noticed:
login.exe eats CPU power (to 99%) about 20 seconds, but works after it as usual.

--
Grigory Batalov.