|
Lines 223-229
killchild(int signo)
Link Here
|
| 223 |
{ |
223 |
{ |
| 224 |
if (sshpid > 1) { |
224 |
if (sshpid > 1) { |
| 225 |
kill(sshpid, SIGTERM); |
225 |
kill(sshpid, SIGTERM); |
| 226 |
waitpid(sshpid, NULL, 0); |
226 |
(void) waitpid(sshpid, NULL, 0); |
| 227 |
} |
227 |
} |
| 228 |
|
228 |
|
| 229 |
_exit(1); |
229 |
_exit(1); |
|
Lines 335-341
local_do_ls(const char *args)
Link Here
|
| 335 |
|
335 |
|
| 336 |
/* Strip one path (usually the pwd) from the start of another */ |
336 |
/* Strip one path (usually the pwd) from the start of another */ |
| 337 |
static char * |
337 |
static char * |
| 338 |
path_strip(char *path, char *strip) |
338 |
path_strip(const char *path, const char *strip) |
| 339 |
{ |
339 |
{ |
| 340 |
size_t len; |
340 |
size_t len; |
| 341 |
|
341 |
|
|
Lines 353-359
path_strip(char *path, char *strip)
Link Here
|
| 353 |
} |
353 |
} |
| 354 |
|
354 |
|
| 355 |
static char * |
355 |
static char * |
| 356 |
make_absolute(char *p, char *pwd) |
356 |
make_absolute(char *p, const char *pwd) |
| 357 |
{ |
357 |
{ |
| 358 |
char *abs_str; |
358 |
char *abs_str; |
| 359 |
|
359 |
|
|
Lines 551-557
parse_no_flags(const char *cmd, char **argv, int argc)
Link Here
|
| 551 |
} |
551 |
} |
| 552 |
|
552 |
|
| 553 |
static int |
553 |
static int |
| 554 |
is_dir(char *path) |
554 |
is_dir(const char *path) |
| 555 |
{ |
555 |
{ |
| 556 |
struct stat sb; |
556 |
struct stat sb; |
| 557 |
|
557 |
|
|
Lines 563-569
is_dir(char *path)
Link Here
|
| 563 |
} |
563 |
} |
| 564 |
|
564 |
|
| 565 |
static int |
565 |
static int |
| 566 |
remote_is_dir(struct sftp_conn *conn, char *path) |
566 |
remote_is_dir(struct sftp_conn *conn, const char *path) |
| 567 |
{ |
567 |
{ |
| 568 |
Attrib *a; |
568 |
Attrib *a; |
| 569 |
|
569 |
|
|
Lines 577-583
remote_is_dir(struct sftp_conn *conn, char *path)
Link Here
|
| 577 |
|
577 |
|
| 578 |
/* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */ |
578 |
/* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */ |
| 579 |
static int |
579 |
static int |
| 580 |
pathname_is_dir(char *pathname) |
580 |
pathname_is_dir(const char *pathname) |
| 581 |
{ |
581 |
{ |
| 582 |
size_t l = strlen(pathname); |
582 |
size_t l = strlen(pathname); |
| 583 |
|
583 |
|
|
Lines 585-592
pathname_is_dir(char *pathname)
Link Here
|
| 585 |
} |
585 |
} |
| 586 |
|
586 |
|
| 587 |
static int |
587 |
static int |
| 588 |
process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd, |
588 |
process_get(struct sftp_conn *conn, const char *src, const char *dst, |
| 589 |
int pflag, int rflag, int resume, int fflag) |
589 |
const char *pwd, int pflag, int rflag, int resume, int fflag) |
| 590 |
{ |
590 |
{ |
| 591 |
char *abs_src = NULL; |
591 |
char *abs_src = NULL; |
| 592 |
char *abs_dst = NULL; |
592 |
char *abs_dst = NULL; |
|
Lines 669-676
out:
Link Here
|
| 669 |
} |
669 |
} |
| 670 |
|
670 |
|
| 671 |
static int |
671 |
static int |
| 672 |
process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd, |
672 |
process_put(struct sftp_conn *conn, const char *src, const char *dst, |
| 673 |
int pflag, int rflag, int resume, int fflag) |
673 |
const char *pwd, int pflag, int rflag, int resume, int fflag) |
| 674 |
{ |
674 |
{ |
| 675 |
char *tmp_dst = NULL; |
675 |
char *tmp_dst = NULL; |
| 676 |
char *abs_dst = NULL; |
676 |
char *abs_dst = NULL; |
|
Lines 779-785
sdirent_comp(const void *aa, const void *bb)
Link Here
|
| 779 |
|
779 |
|
| 780 |
/* sftp ls.1 replacement for directories */ |
780 |
/* sftp ls.1 replacement for directories */ |
| 781 |
static int |
781 |
static int |
| 782 |
do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag) |
782 |
do_ls_dir(struct sftp_conn *conn, const char *path, const char *strip_path, int lflag) |
| 783 |
{ |
783 |
{ |
| 784 |
int n; |
784 |
int n; |
| 785 |
u_int c = 1, colspace = 0, columns = 1; |
785 |
u_int c = 1, colspace = 0, columns = 1; |
|
Lines 864-870
do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
Link Here
|
| 864 |
|
864 |
|
| 865 |
/* sftp ls.1 replacement which handles path globs */ |
865 |
/* sftp ls.1 replacement which handles path globs */ |
| 866 |
static int |
866 |
static int |
| 867 |
do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, |
867 |
do_globbed_ls(struct sftp_conn *conn, const char *path, const char *strip_path, |
| 868 |
int lflag) |
868 |
int lflag) |
| 869 |
{ |
869 |
{ |
| 870 |
char *fname, *lname; |
870 |
char *fname, *lname; |
|
Lines 949-955
do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
Link Here
|
| 949 |
} |
949 |
} |
| 950 |
|
950 |
|
| 951 |
static int |
951 |
static int |
| 952 |
do_df(struct sftp_conn *conn, char *path, int hflag, int iflag) |
952 |
do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag) |
| 953 |
{ |
953 |
{ |
| 954 |
struct sftp_statvfs st; |
954 |
struct sftp_statvfs st; |
| 955 |
char s_used[FMT_SCALED_STRSIZE]; |
955 |
char s_used[FMT_SCALED_STRSIZE]; |