- if (nflag || debug) {
- printf("%s%s%s%s%s %s %s\n", opts & VERIFY ? "verify":"install",
- opts & WHOLE ? " -w" : "",
- opts & YOUNGER ? " -y" : "",
- opts & COMPARE ? " -b" : "",
- opts & REMOVE ? " -r" : "", src, dest);
- if (nflag)
- return;
- }
- /*
- * Pass the destination file/directory name to remote.
- */
- (void) sprintf(buf, "%c%s\n", destdir ? 'T' : 't', dest);
- if (debug)
- printf("buf = %s", buf);
- (void) write(rem, buf, strlen(buf));
-
- if (!destdir && (opts & WHOLE))
- opts |= STRIP;
- if (opts & REMOVE) {
- opts &= ~REMOVE;
- rmchk(src, NULL, opts);
- }
- sendf(src, NULL, opts);
+ do {
+ c = *cp;
+ if (c & 0200)
+ goto bad;
+ if (!isalpha(c) && !isdigit(c) && c != '_' && c != '-')
+ goto bad;
+ cp++;
+ } while (*cp);
+ return(1);
+bad:
+ error("invalid user name %s\n", name);
+ return(0);