version 1.35, 2015/01/20 04:45:43 |
version 1.36, 2015/01/20 09:00:16 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
|
#include <sys/stat.h> |
|
#include <sys/time.h> |
|
#include <sys/wait.h> |
|
|
|
#include <errno.h> |
|
#include <fcntl.h> |
|
#include <grp.h> |
|
#include <limits.h> |
|
#include <paths.h> |
|
#include <stdarg.h> |
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
#include <string.h> |
|
#include <unistd.h> |
|
|
#include "defs.h" |
#include "defs.h" |
|
|
/* |
/* |
* Things common to both the client and server. |
* Things common to both the client and server. |
*/ |
*/ |
|
|
#include <sys/wait.h> |
|
#include <sys/socket.h> |
|
|
|
/* |
/* |
* Variables common to both client and server |
* Variables common to both client and server |
*/ |
*/ |
|
|
int rem_w = -1; /* Client file descriptor */ |
int rem_w = -1; /* Client file descriptor */ |
struct passwd *pw = NULL; /* Local user's pwd entry */ |
struct passwd *pw = NULL; /* Local user's pwd entry */ |
volatile sig_atomic_t contimedout = FALSE; /* Connection timed out */ |
volatile sig_atomic_t contimedout = FALSE; /* Connection timed out */ |
int proto_version = -1; /* Protocol version */ |
|
int rtimeout = RTIMEOUT; /* Response time out */ |
int rtimeout = RTIMEOUT; /* Response time out */ |
jmp_buf finish_jmpbuf; /* Finish() jmp buffer */ |
jmp_buf finish_jmpbuf; /* Finish() jmp buffer */ |
int setjmp_ok = FALSE; /* setjmp()/longjmp() status */ |
int setjmp_ok = FALSE; /* setjmp()/longjmp() status */ |
|
|
void |
void |
finish(void) |
finish(void) |
{ |
{ |
extern jmp_buf finish_jmpbuf; |
|
|
|
debugmsg(DM_CALL, |
debugmsg(DM_CALL, |
"finish() called: do_fork = %d amchild = %d isserver = %d", |
"finish() called: do_fork = %d amchild = %d isserver = %d", |
do_fork, amchild, isserver); |
do_fork, amchild, isserver); |
|
|
{ |
{ |
char *pw_dir, *rest; |
char *pw_dir, *rest; |
size_t len; |
size_t len; |
extern char *homedir; |
|
|
|
if (*file != '~') { |
if (*file != '~') { |
notilde: |
notilde: |