version 1.81, 2020/06/26 05:02:03 |
version 1.82, 2020/06/26 05:42:16 |
|
|
return; |
return; |
len = p - filename; |
len = p - filename; |
dotsshdir = tilde_expand_filename("~/" _PATH_SSH_USER_DIR, getuid()); |
dotsshdir = tilde_expand_filename("~/" _PATH_SSH_USER_DIR, getuid()); |
if ((strlen(dotsshdir) > len || strncmp(filename, dotsshdir, len) != 0 |
if (strlen(dotsshdir) > len || strncmp(filename, dotsshdir, len) != 0) |
|| stat(dotsshdir, &st)) == 0) |
goto out; /* not ~/.ssh prefixed */ |
; /* do nothing, path not in ~/.ssh or dir already exists */ |
if (stat(dotsshdir, &st) == 0) |
|
goto out; /* dir already exists */ |
else if (errno != ENOENT) |
else if (errno != ENOENT) |
error("Could not stat %s: %s", dotsshdir, strerror(errno)); |
error("Could not stat %s: %s", dotsshdir, strerror(errno)); |
else if (mkdir(dotsshdir, 0700) == -1) |
else { |
error("Could not create directory '%.200s' (%s).", |
if (mkdir(dotsshdir, 0700) == -1) |
dotsshdir, strerror(errno)); |
error("Could not create directory '%.200s' (%s).", |
else if (notify) |
dotsshdir, strerror(errno)); |
logit("Created directory '%s'.", dotsshdir); |
else if (notify) |
|
logit("Created directory '%s'.", dotsshdir); |
|
} |
|
out: |
free(dotsshdir); |
free(dotsshdir); |
} |
} |
|
|
|
|
/* |
/* |
* Appends an entry to the host file. Returns false if the entry could not |
* Appends an entry to the host file. Returns false if the entry could not |