mirror of
http://galexander.org/git/simplesshd.git
synced 2025-03-01 15:31:59 +00:00
Remaining conflicts are more straightforward. Preserve both my hack and
dropbear's new behavior (as a fallabck) for when renaming a file using hardlinks fails. Either one alone would probably suffice but I know the rename() hack works.
This commit is contained in:
parent
ec37382a5c
commit
4f0a0c7e8e
@ -160,15 +160,8 @@ int signkey_generate(enum signkey_type keytype, int bits, const char* filename,
|
|||||||
if (link(fn_temp, filename) < 0) {
|
if (link(fn_temp, filename) < 0) {
|
||||||
/* If generating keys on connection (skipexist) it's OK to get EEXIST
|
/* If generating keys on connection (skipexist) it's OK to get EEXIST
|
||||||
- we probably just lost a race with another connection to generate the key */
|
- we probably just lost a race with another connection to generate the key */
|
||||||
<<<<<<< HEAD
|
|
||||||
/* fallback to rename() if the fs doesn't support link() */
|
|
||||||
if ((!(skip_exist && errno == EEXIST)) &&
|
if ((!(skip_exist && errno == EEXIST)) &&
|
||||||
(rename(fn_temp, filename) < 0)) {
|
(rename(fn_temp, filename) < 0)) {
|
||||||
dropbear_log(LOG_ERR, "Failed moving key file to %s: %s", filename,
|
|
||||||
strerror(errno));
|
|
||||||
ret = DROPBEAR_FAILURE;
|
|
||||||
=======
|
|
||||||
if (!(skip_exist && errno == EEXIST)) {
|
|
||||||
if (errno == EPERM || errno == EACCES) {
|
if (errno == EPERM || errno == EACCES) {
|
||||||
/* Non-atomic fallback when hard-links not allowed or unsupported */
|
/* Non-atomic fallback when hard-links not allowed or unsupported */
|
||||||
buf_setpos(buf, 0);
|
buf_setpos(buf, 0);
|
||||||
@ -179,7 +172,6 @@ int signkey_generate(enum signkey_type keytype, int bits, const char* filename,
|
|||||||
ret = DROPBEAR_FAILURE;
|
ret = DROPBEAR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
>>>>>>> dropbear
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,18 +380,7 @@ static int checkpubkey(const char* keyalgo, unsigned int keyalgolen,
|
|||||||
|
|
||||||
TRACE(("enter checkpubkey"))
|
TRACE(("enter checkpubkey"))
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/* check that we can use the algo */
|
|
||||||
if (have_algo(algo, algolen, sshhostkey) == DROPBEAR_FAILURE) {
|
|
||||||
dropbear_log(LOG_WARNING,
|
|
||||||
"Pubkey auth attempt with unknown algo for '%s' from %s",
|
|
||||||
ses.authstate.pw_name, svr_ses.addrstring);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
=======
|
|
||||||
>>>>>>> dropbear
|
|
||||||
/* check file permissions, also whether file exists */
|
/* check file permissions, also whether file exists */
|
||||||
if (checkpubkeyperms() == DROPBEAR_FAILURE) {
|
if (checkpubkeyperms() == DROPBEAR_FAILURE) {
|
||||||
TRACE(("bad authorized_keys permissions, or file doesn't exist"))
|
TRACE(("bad authorized_keys permissions, or file doesn't exist"))
|
||||||
|
Loading…
Reference in New Issue
Block a user