projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4 release
[unix-history]
/
usr
/
src
/
cmd
/
uucp
/
uux.c
diff --git
a/usr/src/cmd/uucp/uux.c
b/usr/src/cmd/uucp/uux.c
index
6f8bc98
..
66df20a
100644
(file)
--- a/
usr/src/cmd/uucp/uux.c
+++ b/
usr/src/cmd/uucp/uux.c
@@
-1,6
+1,9
@@
+ /* uux 2.2 5/24/79 18:33:11 */
#include "uucp.h"
#include "uucpdefs.h"
#include "uucp.h"
#include "uucpdefs.h"
+static char SiD[] = "@(#)uux 2.2";
+
#define NOSYSPART 0
#define HASSYSPART 1
#define NOSYSPART 0
#define HASSYSPART 1
@@
-47,7
+50,7
@@
char *argv[];
int uid, ret;
char redir = '\0';
int uid, ret;
char redir = '\0';
-
Debug = 0
;
+
uucpname(Myname)
;
Ofn = 1;
Ifn = 0;
while (argc>1 && argv[1][0] == '-') {
Ofn = 1;
Ifn = 0;
while (argc>1 && argv[1][0] == '-') {
@@
-81,7
+84,10
@@
char *argv[];
}
DEBUG(4, "arg - %s\n", inargs);
ret = gwd(Wrkdir);
}
DEBUG(4, "arg - %s\n", inargs);
ret = gwd(Wrkdir);
- ASSERT(ret == 0, "GWD FAILED %d", ret);
+ if (ret != 0) {
+ fprintf(stderr, "can't get working directory; will try to continue\n");
+ strcpy(Wrkdir, "/UNKNOWN");
+ }
chdir(Spool);
uid = getuid();
guinfo(uid, User, path);
chdir(Spool);
uid = getuid();
guinfo(uid, User, path);
@@
-129,12
+135,18
@@
char *argv[];
}
if (pipein) {
}
if (pipein) {
+ register int c;
+
gename(DATAPRE, xsys, 'B', dfile);
fpd = fopen(dfile, "w");
ASSERT(fpd != NULL, "CAN'T OPEN %s", dfile);
chmod(dfile, 0666);
gename(DATAPRE, xsys, 'B', dfile);
fpd = fopen(dfile, "w");
ASSERT(fpd != NULL, "CAN'T OPEN %s", dfile);
chmod(dfile, 0666);
+ while ((c = getc(stdin)) != EOF)
+ putc(c, fpd);
+#ifdef notdef
while (fgets(buf, BUFSIZ, stdin) != NULL)
fputs(buf, fpd);
while (fgets(buf, BUFSIZ, stdin) != NULL)
fputs(buf, fpd);
+#endif
fclose(fpd);
if (strcmp(local, xsys) != SAME) {
GENSEND(fpc, dfile, dfile, User, dfile);
fclose(fpd);
if (strcmp(local, xsys) != SAME) {
GENSEND(fpc, dfile, dfile, User, dfile);
@@
-206,22
+218,26
@@
char *argv[];
/* generate send file */
expfile(rest);
gename(DATAPRE, xsys, 'A', dfile);
/* generate send file */
expfile(rest);
gename(DATAPRE, xsys, 'A', dfile);
- if (redir == '<') {
- fprintf(fprx, "%c %s\n", X_STDIN, dfile);
- }
DEBUG(4, "rest %s\n", rest);
DEBUG(4, "rest %s\n", rest);
- if (
chkpth(User, "", rest
) != 0) {
+ if (
(chkpth(User, "", rest) || anyread(rest)
) != 0) {
fprintf(stderr, "permission denied %s\n", rest);
cleanup(1);
}
fprintf(stderr, "permission denied %s\n", rest);
cleanup(1);
}
- if (xcp(rest, dfile) != 0)
+ if (xcp(rest, dfile) != 0) {
+ fprintf(stderr, "can't copy %s to %s\n", rest, dfile);
cleanup(1);
cleanup(1);
+ }
GENSEND(fpc, rest, dfile, User, dfile);
cflag++;
GENSEND(fpc, rest, dfile, User, dfile);
cflag++;
- fprintf(fprx, "%c %s %s\n", X_RQDFILE,
- dfile, lastpart(rest));
- if (redir != '<')
+ if (redir == '<') {
+ fprintf(fprx, "%c %s\n", X_STDIN, dfile);
+ fprintf(fprx, "%c %s\n", X_RQDFILE, dfile);
+ }
+ else {
APPCMD(lastpart(rest));
APPCMD(lastpart(rest));
+ fprintf(fprx, "%c %s %s\n", X_RQDFILE,
+ dfile, lastpart(rest));
+ }
redir = '\0';
continue;
}
redir = '\0';
continue;
}
@@
-238,14
+254,18
@@
char *argv[];
GENRCV(fp, rest, dfile, User);
fclose(fp);
rflag++;
GENRCV(fp, rest, dfile, User);
fclose(fp);
rflag++;
- fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile,
- lastpart(rest));
if (rest[0] != '~')
expfile(rest);
if (rest[0] != '~')
expfile(rest);
- if (redir == '<')
+ if (redir == '<') {
+ fprintf(fprx, "%c %s\n", X_RQDFILE, dfile);
fprintf(fprx, "%c %s\n", X_STDIN, dfile);
fprintf(fprx, "%c %s\n", X_STDIN, dfile);
- else
+ }
+ else {
+ fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile,
+ lastpart(rest));
APPCMD(lastpart(rest));
APPCMD(lastpart(rest));
+ }
+
redir = '\0';
continue;
}
redir = '\0';
continue;
}
@@
-263,12
+283,15
@@
char *argv[];
fclose(fpd);
GENSEND(fpc, dfile, tfile, User, dfile);
cflag++;
fclose(fpd);
GENSEND(fpc, dfile, tfile, User, dfile);
cflag++;
- fprintf(fprx, "%c %s %s\n", X_RQDFILE, t2file,
- lastpart(rest));
- if (redir == '<')
+ if (redir == '<') {
+ fprintf(fprx, "%c %s\n", X_RQDFILE, t2file);
fprintf(fprx, "%c %s\n", X_STDIN, t2file);
fprintf(fprx, "%c %s\n", X_STDIN, t2file);
- else
+ }
+ else {
+ fprintf(fprx, "%c %s %s\n", X_RQDFILE, t2file,
+ lastpart(rest));
APPCMD(lastpart(rest));
APPCMD(lastpart(rest));
+ }
redir = '\0';
continue;
}
redir = '\0';
continue;
}