rcp.c File Reference

#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <utime.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <dirent.h>
#include <fcntl.h>
#include <pwd.h>
#include <signal.h>
#include <unistd.h>
#include <net/gen/netdb.h>
#include <net/netlib.h>

Include dependency graph for rcp.c:

Go to the source code of this file.

Data Structures

struct  buffer

Defines

#define NAMESERVER
#define PROTO(func, args)   func ()
#define vfork   fork
#define ga()   (void) write(rem, "", 1)
#define atime   utimbuf.actime
#define mtime   utimbuf.modtime
#define SCREWUP(str)   { whopp = str; goto screwup; }
#define getnum(t)   (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0');

Functions

 PROTO (int main,(int argc, char *argv[]))
 PROTO (void lostconn,(int sig))
 PROTO (void error,(char *fmt,...))
 PROTO (int response,(void))
 PROTO (void source,(int argc, char *argv[]))
 PROTO (void usage,(void))
 PROTO (char *colon,(char *cp))
 PROTO (int okname,(char *cp0))
 PROTO (int susystem,(char *s))
 PROTO (void verifydir,(char *cp))
 PROTO (void rsource,(char *name, struct stat *statp))
 PROTO (struct buffer *allocbuf,(struct buffer *bp, int fd, int blksize))
 main (int argc, char **argv)
void verifydir (char *cp)
char * colon (char *cp)
int okname (char *cp0)
int susystem (char *s)
void source (int argc, char **argv)
void rsource (char *name, struct stat *statp)
int response ()
void lostconn (int sig)
void sink (int argc, char **argv)
bufferallocbuf (struct buffer *bp, int fd, int blksize)
 error (char *fmt)
void usage ()

Variables

char copyright []
static char sccsid [] = "@(#)rcp.c 1.1 87/12/21 SMI"
int rem
int errs
int errno
int iamremote
int targetshouldbedirectory
int iamrecursive
int myuid
int pflag
passwdpwd
int userid
int port


Define Documentation

#define atime   utimbuf.actime
 

Referenced by next_file().

 
#define ga  )     (void) write(rem, "", 1)
 

Definition at line 85 of file rcp.c.

Referenced by sink().

#define getnum t   )     (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0');
 

Referenced by getnum(), give_prompt(), and prnum().

#define mtime   utimbuf.modtime
 

Referenced by latest_version(), next_file(), unix_copydir(), and unix_write().

#define NAMESERVER
 

Definition at line 22 of file rcp.c.

#define PROTO func,
args   )     func ()
 

Definition at line 49 of file rcp.c.

#define SCREWUP str   )     { whopp = str; goto screwup; }
 

Referenced by sink().

#define vfork   fork
 

Definition at line 66 of file rcp.c.

Referenced by susystem().


Function Documentation

struct buffer* allocbuf struct buffer bp,
int  fd,
int  blksize
 

Definition at line 791 of file rcp.c.

References errno, error, free, fstat, malloc(), stb, and strerror().

char* colon char *  cp  ) 
 

Definition at line 355 of file rcp.c.

error char *  fmt  ) 
 

Definition at line 826 of file rcp.c.

References BUFSIZ, cp, errs, iamremote, rem, strlen(), va_end, va_start, vsprintf(), and write.

void lostconn int  sig  ) 
 

Definition at line 589 of file rcp.c.

References exit(), fprintf(), iamremote, and stderr.

Referenced by response().

main int  argc,
char **  argv
 

Definition at line 87 of file rcp.c.

References BUFSIZ, exit(), fprintf(), getpwuid(), getservbyname(), getuid, host, i, NULL, perror(), pwd, response(), seteuid, sink(), source, sp, stderr, and usage.

int okname char *  cp0  ) 
 

Definition at line 371 of file rcp.c.

References bad, c, cp, fprintf(), isalpha, isdigit, and stderr.

PROTO struct buffer allocbuf,
(struct buffer *bp, int fd, int blksize) 
 

PROTO void  rsource,
(char *name, struct stat *statp) 
 

PROTO void  verifydir,
(char *cp
 

PROTO int  susystem,
(char *s
 

PROTO int  okname,
(char *cp0) 
 

PROTO char *  colon,
(char *cp
 

PROTO void  usage,
(void) 
 

PROTO void  source,
(int argc, char *argv[]) 
 

PROTO int  response,
(void) 
 

PROTO void  error,
(char *fmt,...) 
 

PROTO void  lostconn,
(int sig
 

PROTO int  main,
(int argc, char *argv[]) 
 

int response  ) 
 

Definition at line 557 of file rcp.c.

References BUFSIZ, c, cp, errs, exit(), iamremote, lostconn(), read, rem, and write.

Referenced by main(), and rsource().

void rsource char *  name,
struct stat statp
 

Definition at line 504 of file rcp.c.

References BUFSIZ, closedir, d, dirent::d_ino, dirent::d_name, errno, error, opendir, pflag, readdir, rem, response(), source, sprintf(), stat::st_atime, stat::st_mode, stat::st_mtime, strcmp, strerror(), strlen(), strrchr(), and write.

void sink int  argc,
char **  argv
 

Definition at line 599 of file rcp.c.

References bp, buffer, BUFSIZ, cmdbuf, count, cp, dummy, error, errs, exit(), first, ga, iamremote, j, pflag, passwd::pw_uid, pwd, read, rem, S_IFDIR, SCREWUP, seteuid, size, stat::st_mode, stat, stb, strlen(), targetshouldbedirectory, time_t, umask, verifydir(), and write.

Referenced by main().

void source int  argc,
char **  argv
 

Definition at line 417 of file rcp.c.

References bp, buffer, BUFSIZ, errno, error, open, stb, strerror(), and x.

int susystem char *  s  ) 
 

Definition at line 392 of file rcp.c.

References _exit, execl, myuid, pid, PROTO, SIG_IGN, SIGINT, signal(), SIGQUIT, status, vfork, and wait.

void usage void   ) 
 

Definition at line 845 of file rcp.c.

References fprintf(), and stderr.

void verifydir char *  cp  ) 
 

Definition at line 340 of file rcp.c.

References ENOTDIR, errno, error, exit(), S_IFDIR, S_IFMT, stat::st_mode, stat, stb, and strerror().

Referenced by sink().


Variable Documentation

char copyright[]
 

Initial value:

"@(#) Copyright (c) 1983 Regents of the University of California.\n\
 All rights reserved.\n"

Definition at line 8 of file rcp.c.

int errno
 

Definition at line 70 of file rcp.c.

int errs
 

Definition at line 69 of file rcp.c.

int iamrecursive
 

Definition at line 72 of file rcp.c.

int iamremote
 

Definition at line 71 of file rcp.c.

Referenced by error(), lostconn(), response(), and sink().

int myuid
 

Definition at line 73 of file rcp.c.

Referenced by susystem().

int pflag
 

Definition at line 74 of file rcp.c.

int port
 

Definition at line 77 of file rcp.c.

struct passwd* pwd
 

Definition at line 75 of file rcp.c.

Referenced by AreWeIn(), do_chown(), doPASS(), iruserok(), main(), make_header(), passnone(), passpass(), sink(), subvpath(), and write_log().

int rem
 

Definition at line 68 of file rcp.c.

Referenced by adler32_combine(), cp_file(), doit(), error(), lunpipe(), main(), rd_wrfile(), response(), rsource(), sbx_aout(), sbx_ready(), select_region(), sink(), uInt64_qrm10(), and writedata().

char sccsid[] = "@(#)rcp.c 1.1 87/12/21 SMI" [static]
 

Definition at line 14 of file rcp.c.

int targetshouldbedirectory
 

Definition at line 71 of file rcp.c.

Referenced by sink().

int userid
 

Definition at line 76 of file rcp.c.

Referenced by cuserid(), and getlogin().


Generated on Fri Apr 14 23:07:17 2006 for minix by  doxygen 1.4.6