summaryrefslogtreecommitdiffstats
path: root/usr.bin/rdist/expand.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-08-10 07:54:17 +0000
committerpeter <peter@FreeBSD.org>1996-08-10 07:54:17 +0000
commiteda223150ae28327a1899db37fe184b8b8942e70 (patch)
treea7f69e16c74cc884e69d51027b64a2371b6f57ac /usr.bin/rdist/expand.c
parentd6987f0ce13738a30ff52bb78cd8ff1fe6a63b23 (diff)
downloadFreeBSD-src-eda223150ae28327a1899db37fe184b8b8942e70.zip
FreeBSD-src-eda223150ae28327a1899db37fe184b8b8942e70.tar.gz
Remove the need for rdist(1) to run setuid, thus completely closing any
possibility of a security hole. It now does what rdist-6 does, and calls /usr/bin/rsh if not running as root. There are NO protocol changes, this is 100% compatable with the old rdist, except that it does not need setuid root privs. However, there are some minor differences to the base rdist-6 code in that if it is being run by root, it will call rcmd(3) directly rather than piping everything through rsh(1). This is a little more efficient as it doesn't involve context switching on pipe reads/writes. Also, the -P option was added from rdist-6.1.2, which allows an alternative rsh program to be specified, such as ssh. Note that it requires the fixes to the ssh port to disable the unconditional USE_PIPES option that was recently added. The rcmd(3) optimisation is disabled if a non-rsh program is speficied.
Diffstat (limited to 'usr.bin/rdist/expand.c')
-rw-r--r--usr.bin/rdist/expand.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/rdist/expand.c b/usr.bin/rdist/expand.c
index 555dbf1..4d1819b 100644
--- a/usr.bin/rdist/expand.c
+++ b/usr.bin/rdist/expand.c
@@ -91,7 +91,7 @@ expand(list, wh)
char *argvbuf[GAVSIZ];
if (debug) {
- printf("expand(%x, %d)\nlist = ", list, wh);
+ printf("expand(%p, %d)\nlist = ", list, wh);
prnames(list);
}
@@ -217,7 +217,7 @@ expstr(s)
cp1 = pw->pw_dir;
s = cp;
}
- for (cp = path; *cp++ = *cp1++; )
+ for (cp = path; (*cp++ = *cp1++); )
;
tpathp = pathp = cp - 1;
} else {
@@ -451,7 +451,7 @@ amatch(s, p)
case '[':
ok = 0;
lc = 077777;
- while (cc = *p++) {
+ while ((cc = *p++)) {
if (cc == ']') {
if (ok)
break;
@@ -534,7 +534,7 @@ smatch(s, p)
case '[':
ok = 0;
lc = 077777;
- while (cc = *p++) {
+ while ((cc = *p++)) {
if (cc == ']') {
if (ok)
break;
@@ -592,10 +592,10 @@ Cat(s1, s2)
eargv[eargc - 1] = s = malloc(len);
if (s == NULL)
fatal("ran out of memory\n");
- while (*s++ = *s1++ & TRIM)
+ while ((*s++ = *s1++ & TRIM))
;
s--;
- while (*s++ = *s2++ & TRIM)
+ while ((*s++ = *s2++ & TRIM))
;
}
@@ -655,12 +655,12 @@ exptilde(buf, file)
*s3 = '/';
s2 = pw->pw_dir;
}
- for (s1 = buf; *s1++ = *s2++; )
+ for (s1 = buf; (*s1++ = *s2++); )
;
s2 = --s1;
if (s3 != NULL) {
s2++;
- while (*s1++ = *s3++)
+ while ((*s1++ = *s3++))
;
}
return(s2);
OpenPOWER on IntegriCloud