![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| run a script from incoming email | jojo77 | UNIX for Dummies Questions & Answers | 7 | 02-22-2008 10:48 AM |
| find number of incoming requests to a server | laddu | UNIX for Dummies Questions & Answers | 1 | 03-09-2007 10:48 PM |
| Check incoming mail to sendmail | kingdbag | UNIX for Dummies Questions & Answers | 1 | 01-25-2007 08:32 PM |
| loggin incoming ftp connections in syslog | zuessh | AIX | 2 | 05-31-2006 02:07 PM |
| Listening on port for incoming data? | frustrated1 | Shell Programming and Scripting | 6 | 01-16-2004 03:48 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
rlogin/rsh incoming port
Hi all,
In need to know why my sample code below that connect to a rlogind (513) fails, but original unix rlogin does not ? (.rhosts is verified to be correct) I heard rlogin/rsh bind to a reserved port before connecting to the rlogin server. what are they ??? Code:
s = socket(AF_INET, SOCK_STREAM, 0);
sck.sin_family = AF_INET;
sck.sin_port = htons(513);
sck.sin_addr.s_addr = inet_addr("192.168.15.40");
if (connect(s, (struct sockaddr *)&sck,sizeof(sck)) <0) {
printf("connect() error\n"); return;
}
printf("Connected %d\n",s);
write(s,"",1);
write(s,"root",5);
write(s,"root",5);
write(s,"linux/38400",12);
read(s,buf,sizeof(buf));
printf("%s\n",buf);
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
rlogin is suid to root. So it can rcmd() and the associated routines on the rcmd man page. That includes rresvport(). See those man pages. User program can use rexec() which also has a man page.
|
||||
| Google The UNIX and Linux Forums |