summaryrefslogtreecommitdiff
path: root/sftp-int.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
commit9f0f5c64bc4b6144e3fed6a7f538f7c21819a492 (patch)
treef79317ab211f59181a61b526f566e9c8cfe70c73 /sftp-int.c
parent89681214ca2f50a1b1ed6164c3afe1ce14995ffc (diff)
- deraadt@cvs.openbsd.org 2001/12/19 07:18:56
[auth1.c auth2.c auth2-chall.c auth-bsdauth.c auth.c authfile.c auth.h] [auth-krb4.c auth-rhosts.c auth-skey.c bufaux.c canohost.c channels.c] [cipher.c clientloop.c compat.c compress.c deattack.c key.c log.c mac.c] [match.c misc.c nchan.c packet.c readconf.c rijndael.c rijndael.h scard.c] [servconf.c servconf.h serverloop.c session.c sftp.c sftp-client.c] [sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c] [sshconnect1.c sshconnect2.c sshconnect.c sshd.8 sshd.c sshd_config] [ssh-keygen.c sshlogin.c sshpty.c sshtty.c ttymodes.c uidswap.c] basic KNF done while i was looking for something else
Diffstat (limited to 'sftp-int.c')
-rw-r--r--sftp-int.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sftp-int.c b/sftp-int.c
index 841e562e1..d8eec3f3d 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -26,7 +26,7 @@
26/* XXX: recursive operations */ 26/* XXX: recursive operations */
27 27
28#include "includes.h" 28#include "includes.h"
29RCSID("$OpenBSD: sftp-int.c,v 1.40 2001/08/14 09:23:02 markus Exp $"); 29RCSID("$OpenBSD: sftp-int.c,v 1.41 2001/12/19 07:18:56 deraadt Exp $");
30 30
31#include "buffer.h" 31#include "buffer.h"
32#include "xmalloc.h" 32#include "xmalloc.h"
@@ -205,7 +205,7 @@ path_append(char *p1, char *p2)
205 205
206 ret = xmalloc(len); 206 ret = xmalloc(len);
207 strlcpy(ret, p1, len); 207 strlcpy(ret, p1, len);
208 if (strcmp(p1, "/") != 0) 208 if (strcmp(p1, "/") != 0)
209 strlcat(ret, "/", len); 209 strlcat(ret, "/", len);
210 strlcat(ret, p2, len); 210 strlcat(ret, p2, len);
211 211
@@ -393,7 +393,7 @@ process_get(int in, int out, char *src, char *dst, char *pwd, int pflag)
393 goto out; 393 goto out;
394 } 394 }
395 395
396 for(i = 0; g.gl_pathv[i]; i++) { 396 for (i = 0; g.gl_pathv[i]; i++) {
397 if (infer_path(g.gl_pathv[i], &tmp)) { 397 if (infer_path(g.gl_pathv[i], &tmp)) {
398 err = -1; 398 err = -1;
399 goto out; 399 goto out;
@@ -475,7 +475,7 @@ process_put(int in, int out, char *src, char *dst, char *pwd, int pflag)
475 goto out; 475 goto out;
476 } 476 }
477 477
478 for(i = 0; g.gl_pathv[i]; i++) { 478 for (i = 0; g.gl_pathv[i]; i++) {
479 if (infer_path(g.gl_pathv[i], &tmp)) { 479 if (infer_path(g.gl_pathv[i], &tmp)) {
480 err = -1; 480 err = -1;
481 goto out; 481 goto out;
@@ -517,7 +517,7 @@ parse_args(const char **cpp, int *pflag, unsigned long *n_arg,
517 return(-1); 517 return(-1);
518 518
519 /* Figure out which command we have */ 519 /* Figure out which command we have */
520 for(i = 0; cmds[i].c; i++) { 520 for (i = 0; cmds[i].c; i++) {
521 int cmdlen = strlen(cmds[i].c); 521 int cmdlen = strlen(cmds[i].c);
522 522
523 /* Check for command followed by whitespace */ 523 /* Check for command followed by whitespace */
@@ -688,7 +688,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd)
688 case I_RM: 688 case I_RM:
689 path1 = make_absolute(path1, *pwd); 689 path1 = make_absolute(path1, *pwd);
690 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g); 690 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g);
691 for(i = 0; g.gl_pathv[i]; i++) { 691 for (i = 0; g.gl_pathv[i]; i++) {
692 printf("Removing %s\n", g.gl_pathv[i]); 692 printf("Removing %s\n", g.gl_pathv[i]);
693 if (do_rm(in, out, g.gl_pathv[i]) == -1) 693 if (do_rm(in, out, g.gl_pathv[i]) == -1)
694 err = -1; 694 err = -1;
@@ -781,7 +781,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd)
781 a.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS; 781 a.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS;
782 a.perm = n_arg; 782 a.perm = n_arg;
783 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g); 783 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g);
784 for(i = 0; g.gl_pathv[i]; i++) { 784 for (i = 0; g.gl_pathv[i]; i++) {
785 printf("Changing mode on %s\n", g.gl_pathv[i]); 785 printf("Changing mode on %s\n", g.gl_pathv[i]);
786 do_setstat(in, out, g.gl_pathv[i], &a); 786 do_setstat(in, out, g.gl_pathv[i], &a);
787 } 787 }
@@ -789,7 +789,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd)
789 case I_CHOWN: 789 case I_CHOWN:
790 path1 = make_absolute(path1, *pwd); 790 path1 = make_absolute(path1, *pwd);
791 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g); 791 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g);
792 for(i = 0; g.gl_pathv[i]; i++) { 792 for (i = 0; g.gl_pathv[i]; i++) {
793 if (!(aa = do_stat(in, out, g.gl_pathv[i], 0))) 793 if (!(aa = do_stat(in, out, g.gl_pathv[i], 0)))
794 continue; 794 continue;
795 if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) { 795 if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) {
@@ -806,7 +806,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd)
806 case I_CHGRP: 806 case I_CHGRP:
807 path1 = make_absolute(path1, *pwd); 807 path1 = make_absolute(path1, *pwd);
808 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g); 808 remote_glob(in, out, path1, GLOB_NOCHECK, NULL, &g);
809 for(i = 0; g.gl_pathv[i]; i++) { 809 for (i = 0; g.gl_pathv[i]; i++) {
810 if (!(aa = do_stat(in, out, g.gl_pathv[i], 0))) 810 if (!(aa = do_stat(in, out, g.gl_pathv[i], 0)))
811 continue; 811 continue;
812 if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) { 812 if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) {
@@ -899,7 +899,7 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2)
899 setlinebuf(infile); 899 setlinebuf(infile);
900#endif 900#endif
901 901
902 for(;;) { 902 for (;;) {
903 char *cp; 903 char *cp;
904 904
905 printf("sftp> "); 905 printf("sftp> ");