/[inetutils]/inetutils/rcp/rcp.c
ViewVC logotype

Diff of /inetutils/rcp/rcp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by ams, Sat Jan 22 14:54:13 2005 UTC revision 1.24 by gray, Tue Oct 11 11:16:14 2005 UTC
# Line 64  static char sccsid[] = "@(#)rcp.c      8.2 (B Line 64  static char sccsid[] = "@(#)rcp.c      8.2 (B
64    
65  #include <ctype.h>  #include <ctype.h>
66  #include <dirent.h>  #include <dirent.h>
67  #include <err.h>  #include <error.h>
68  #include <errno.h>  #include <errno.h>
69  #include <fcntl.h>  #include <fcntl.h>
70  #include <netdb.h>  #include <netdb.h>
# Line 248  main (int argc, char *argv[]) Line 248  main (int argc, char *argv[])
248    sp = getservbyname (shell = "shell", "tcp");    sp = getservbyname (shell = "shell", "tcp");
249  #endif  #endif
250    if (sp == NULL)    if (sp == NULL)
251      errx (1, "%s/tcp: unknown service", shell);      error (1, 0, "%s/tcp: unknown service", shell);
252    port = sp->s_port;    port = sp->s_port;
253    
254    if ((pwd = getpwuid (userid = getuid ())) == NULL)    if ((pwd = getpwuid (userid = getuid ())) == NULL)
255      errx(1, "unknown user %d", (int)userid);      error (1, 0, "unknown user %d", (int)userid);
256    
257    rem = STDIN_FILENO;           /* XXX */    rem = STDIN_FILENO;           /* XXX */
258    
# Line 393  toremote (char *targ, int argc, char *ar Line 393  toremote (char *targ, int argc, char *ar
393                tos = IPTOS_THROUGHPUT;                tos = IPTOS_THROUGHPUT;
394                if (setsockopt (rem, IPPROTO_IP, IP_TOS,                if (setsockopt (rem, IPPROTO_IP, IP_TOS,
395                                (char *) &tos, sizeof(int)) < 0)                                (char *) &tos, sizeof(int)) < 0)
396                  warn("TOS (ignored)");                  error (0, errno, "TOS (ignored)");
397  #endif  #endif
398                if (response () < 0)                if (response () < 0)
399                  exit(1);                  exit(1);
# Line 463  tolocal (int argc, char *argv[]) Line 463  tolocal (int argc, char *argv[])
463  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_THROUGHPUT)  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_THROUGHPUT)
464        tos = IPTOS_THROUGHPUT;        tos = IPTOS_THROUGHPUT;
465        if (setsockopt (rem, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof (int)) < 0)        if (setsockopt (rem, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof (int)) < 0)
466          warn ("TOS (ignored)");          error (0, errno, "TOS (ignored)");
467  #endif  #endif
468        sink (1, argv + argc - 1);        sink (1, argv + argc - 1);
469        seteuid (0);        seteuid (0);
# Line 978  kerberos (char **host, char *bp, char *l Line 978  kerberos (char **host, char *bp, char *l
978          {          {
979            use_kerberos = 0;            use_kerberos = 0;
980            if ((sp = getservbyname ("shell", "tcp")) == NULL)            if ((sp = getservbyname ("shell", "tcp")) == NULL)
981              errx (1, "unknown service shell/tcp");              error (1, 0, "unknown service shell/tcp");
982            if (errno == ECONNREFUSED)            if (errno == ECONNREFUSED)
983              oldw ("remote host doesn't support Kerberos");              oldw ("remote host doesn't support Kerberos");
984            else if (errno == ENOENT)            else if (errno == ENOENT)
# Line 991  kerberos (char **host, char *bp, char *l Line 991  kerberos (char **host, char *bp, char *l
991      {      {
992  #ifdef CRYPT  #ifdef CRYPT
993        if (doencrypt)        if (doencrypt)
994          errx (1, "the -x option requires Kerberos authentication");          error (1, 0, "the -x option requires Kerberos authentication");
995  #endif  #endif
996        rem = rcmd (host, port, locuser, user, bp, 0);        rem = rcmd (host, port, locuser, user, bp, 0);
997      }      }

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26