|
Lines 54-59
Link Here
|
| 54 |
#include <ctype.h> |
54 |
#include <ctype.h> |
| 55 |
#include <errno.h> |
55 |
#include <errno.h> |
| 56 |
#include <fcntl.h> |
56 |
#include <fcntl.h> |
|
|
57 |
#include <libgen.h> |
| 57 |
#include <netdb.h> |
58 |
#include <netdb.h> |
| 58 |
#include <paths.h> |
59 |
#include <paths.h> |
| 59 |
#include <pwd.h> |
60 |
#include <pwd.h> |
|
Lines 899-904
control_persist_detach(void)
Link Here
|
| 899 |
{ |
900 |
{ |
| 900 |
pid_t pid; |
901 |
pid_t pid; |
| 901 |
int devnull; |
902 |
int devnull; |
|
|
903 |
char *newpwd; |
| 902 |
|
904 |
|
| 903 |
debug("%s: backgrounding master process", __func__); |
905 |
debug("%s: backgrounding master process", __func__); |
| 904 |
|
906 |
|
|
Lines 935-940
control_persist_detach(void)
Link Here
|
| 935 |
if (devnull > STDERR_FILENO) |
937 |
if (devnull > STDERR_FILENO) |
| 936 |
close(devnull); |
938 |
close(devnull); |
| 937 |
} |
939 |
} |
|
|
940 |
/* |
| 941 |
* Change directory to the one holding the mux socket to avoid |
| 942 |
* blocking unmount by holding pwd open. |
| 943 |
*/ |
| 944 |
if ((newpwd = dirname(options.control_path)) != NULL) |
| 945 |
chdir(newpwd); |
| 946 |
else |
| 947 |
chdir("/"); |
| 938 |
} |
948 |
} |
| 939 |
|
949 |
|
| 940 |
/* Do fork() after authentication. Used by "ssh -f" */ |
950 |
/* Do fork() after authentication. Used by "ssh -f" */ |