version 1.2, 1996/06/26 05:37:39 |
version 1.3, 1996/07/19 21:57:33 |
|
|
gethostname(host, sizeof(host)); |
gethostname(host, sizeof(host)); |
strcpy(tempfile, _PATH_TMP); |
strcpy(tempfile, _PATH_TMP); |
strcat(tempfile, _RDIST_TMP); |
strcat(tempfile, _RDIST_TMP); |
if ((tempname = rindex(tempfile, '/')) != 0) |
tempname = xbasename(tempfile); |
tempname++; |
|
else |
|
tempname = tempfile; |
|
|
|
while (--argc > 0) { |
while (--argc > 0) { |
if ((arg = *++argv)[0] != '-') |
if ((arg = *++argv)[0] != '-') |
|
|
} |
} |
*hp = NULL; |
*hp = NULL; |
|
|
|
#if defined(DIRECT_RCMD) |
seteuid(userid); |
seteuid(userid); |
|
#else /* DIRECT_RCMD */ |
|
if (!iamremote && getuid() != geteuid()) { |
|
error("This version of rdist should not be installed setuid.\n"); |
|
exit(1); |
|
} |
|
#endif /* DIRECT_RCMD */ |
mktemp(tempfile); |
mktemp(tempfile); |
|
|
if (iamremote) { |
if (iamremote) { |
|
|
fin = fopen("Distfile", "r"); |
fin = fopen("Distfile", "r"); |
} else |
} else |
fin = fopen(distfile, "r"); |
fin = fopen(distfile, "r"); |
if(fin == NULL) { |
if (fin == NULL) { |
perror(distfile ? distfile : "distfile"); |
perror(distfile ? distfile : "distfile"); |
exit(1); |
exit(1); |
} |
} |
|
|
} |
} |
|
|
cp = args[i]; |
cp = args[i]; |
if ((dest = index(cp, ':')) != NULL) |
if ((dest = strchr(cp, ':')) != NULL) |
*dest++ = '\0'; |
*dest++ = '\0'; |
tnl.n_name = cp; |
tnl.n_name = cp; |
hosts = expand(&tnl, E_ALL); |
hosts = expand(&tnl, E_ALL); |
|
|
(void)vfprintf(stderr, fmt, ap); |
(void)vfprintf(stderr, fmt, ap); |
(void)fprintf(stderr, "\n"); |
(void)fprintf(stderr, "\n"); |
va_end(ap); |
va_end(ap); |
|
} |
|
|
|
/* |
|
* Private version of basename() |
|
*/ |
|
char *xbasename(path) |
|
char *path; |
|
{ |
|
register char *cp; |
|
|
|
if (cp = strrchr(path, '/')) |
|
return(cp+1); |
|
else |
|
return(path); |
} |
} |