🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sequent
3 messages
3 total messages Started by Paul Pomes - UofIllinois CSO Mon, 28 Sep 1992 22:41
porting programs invoked by inetd to ptx?
#426
Author: Paul Pomes - UofIllinois CSO
Date: Mon, 28 Sep 1992 22:41
17 lines
1258 bytes
Does anyone have a porting guide for programs meant to be invoked by inetd?

I've already learned that the ptx inetd doesn't provide the client program
with the actual socket.  This breaks programs that count on using the
getpeername() call to learn about the remote end.  No problem, just use
the getpeerinaddr() call (*sigh*).  I've also noted the lack of seteuid().
Can setuid() replace it if the system supports _POSIX_SAVED_IDS?

My whole ambition is to get the wuarchive ftpd installed on our ptx
based Sequent.  The more I use ptx, the better AIX looks.  Neither
reminds me much of UNIX.

/pbp
-- 
"A well-schooled electorate, being necessary to the security of a free State,
the right of the People to keep and read Books shall not be infringed."
	-- J. Neil Schulman
Re: porting programs invoked by inetd to ptx?
#429
Author: Tim Wright
Date: Tue, 29 Sep 1992 11:35
32 lines
1917 bytes
In <BvB8DE.40y@news.cso.uiuc.edu> paul@uxc.cso.uiuc.edu (Paul Pomes - UofIllinois CSO) writes:

>Does anyone have a porting guide for programs meant to be invoked by inetd?

>I've already learned that the ptx inetd doesn't provide the client program
>with the actual socket.  This breaks programs that count on using the
>getpeername() call to learn about the remote end.  No problem, just use
>the getpeerinaddr() call (*sigh*).

inetd retruns a TLI endpoint. The top of the stream has "timod" pushed,
so the hackers guide to porting code meant to run under inetd is:
ioctl(s, I_POP, "timod");
ioctl(s, I_PUSH, "sockmod");
at which point you have a socket, and all your usual code should work.
Warning: this works for me under TCP 2.1 and 2.2.1, but I cannot guarantee
that it will always do so. If you just want a TLI endpoint that you
can read and write on, you just pop "timod", and push "tirdwr" instead.
Hope this makes things easier for you.

>I've also noted the lack of seteuid().
>Can setuid() replace it if the system supports _POSIX_SAVED_IDS?

Hmmm, not sure. You can always do some ugly footwork with fork().

Regards,

Tim
-- 
Tim Wright, Sequent Computer Systems Ltd.,        |  Email: timw@lonsqnt.co.uk
Customer Services, Allied Dunbar House,           |   or    timw@sequent.com
Chilsey Green Rd., Chertsey, Surrey, UK, KT16 9HB |  Phone: +44-932-568900
"I've got a set of teeth that druids could worship at" - Cat, Red Dwarf
Re: porting programs invoked by inetd to ptx?
#432
Author: Chris Maltby
Date: Wed, 30 Sep 1992 02:08
30 lines
1809 bytes
In <1992Sep29.113527.10193@sequent.com> timw@sequent.com (Tim Wright) writes:

>In <BvB8DE.40y@news.cso.uiuc.edu> paul@uxc.cso.uiuc.edu (Paul Pomes - UofIllinois CSO) writes:
>
>>Does anyone have a porting guide for programs meant to be invoked by inetd?
>
>inetd retruns a TLI endpoint. The top of the stream has "timod" pushed,
>so the hackers guide to porting code meant to run under inetd is:
>ioctl(s, I_POP, "timod");
>ioctl(s, I_PUSH, "sockmod");
>at which point you have a socket, and all your usual code should work.
>Warning: this works for me under TCP 2.1 and 2.2.1, but I cannot guarantee
>that it will always do so. If you just want a TLI endpoint that you
>can read and write on, you just pop "timod", and push "tirdwr" instead.
>Hope this makes things easier for you.

Seems to me to be the sort of thing that inetd should do for you
with an additional configuration parameter. Eg:

#Service Type	Proto	Module	No/Wait	User	executable		Args
#----	------	---	------	------	----	----------		----
ftp	stream	tcp	sockmod	nowait	root	/usr/etc/ftpd.new	ftpd
telnet	stream	tcp	timod	nowait	root	/usr/etc/in.telnetd	telnetd

Fix?
-- 
Chris Maltby - Softway Pty Ltd		Internet: chris@softway.sw.oz.au

PHONE:	+61-2-698-2322	"I'm waiting for X-Windows to become just that;
FAX:	+61-2-699-9174	 Ex-Windows" - A McGrath.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads