dumprmt.c (1559) | dumprmt.c (12377) |
---|---|
1/*- 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 99 unchanged lines hidden (view full) --- 108 (void) fprintf(stderr, "rdump: Lost connection to remote host.\n"); 109 exit(1); 110} 111 112void 113rmtgetconn() 114{ 115 register char *cp; | 1/*- 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 99 unchanged lines hidden (view full) --- 108 (void) fprintf(stderr, "rdump: Lost connection to remote host.\n"); 109 exit(1); 110} 111 112void 113rmtgetconn() 114{ 115 register char *cp; |
116 register const char *rmt; |
|
116 static struct servent *sp = NULL; 117 static struct passwd *pwd = NULL; 118#ifdef notdef 119 static int on = 1; 120#endif 121 char *tuser; 122 int size; 123 int maxseg; --- 14 unchanged lines hidden (view full) --- 138 if ((cp = index(rmtpeer, '@')) != NULL) { 139 tuser = rmtpeer; 140 *cp = '\0'; 141 if (!okname(tuser)) 142 exit(1); 143 rmtpeer = ++cp; 144 } else 145 tuser = pwd->pw_name; | 117 static struct servent *sp = NULL; 118 static struct passwd *pwd = NULL; 119#ifdef notdef 120 static int on = 1; 121#endif 122 char *tuser; 123 int size; 124 int maxseg; --- 14 unchanged lines hidden (view full) --- 139 if ((cp = index(rmtpeer, '@')) != NULL) { 140 tuser = rmtpeer; 141 *cp = '\0'; 142 if (!okname(tuser)) 143 exit(1); 144 rmtpeer = ++cp; 145 } else 146 tuser = pwd->pw_name; |
147 if ((rmt = getenv("RMT")) == NULL) 148 rmt = _PATH_RMT; |
|
146 rmtape = rcmd(&rmtpeer, (u_short)sp->s_port, pwd->pw_name, tuser, | 149 rmtape = rcmd(&rmtpeer, (u_short)sp->s_port, pwd->pw_name, tuser, |
147 _PATH_RMT, (int *)0); | 150 rmt, (int *)0); |
148 size = ntrec * TP_BSIZE; 149 if (size > 60 * 1024) /* XXX */ 150 size = 60 * 1024; 151 /* Leave some space for rmt request/response protocol */ 152 size += 2 * 1024; 153 while (size > TP_BSIZE && 154 setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0) 155 size -= TP_BSIZE; --- 225 unchanged lines hidden --- | 151 size = ntrec * TP_BSIZE; 152 if (size > 60 * 1024) /* XXX */ 153 size = 60 * 1024; 154 /* Leave some space for rmt request/response protocol */ 155 size += 2 * 1024; 156 while (size > TP_BSIZE && 157 setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0) 158 size -= TP_BSIZE; --- 225 unchanged lines hidden --- |