usr.bin/ssh/auth.c
/*
 * Version of secure_path() that accepts an open file descriptor to
 * avoid races.
 *
 * Returns 0 on success and -1 on failure
 */
Version of secure_path() that accepts an open file descriptor to
avoid races.

Returns 0 on success and -1 on failure
Version of secure_path () that accepts an open file descriptor to avoid races . Returns 0 on success and - 1 on failure
static int
secure_filename(FILE *f, const char *file, struct passwd *pw,
    char *err, size_t errlen)
{
	struct stat st;
	if (fstat(fileno(f), &st) < 0) {
		snprintf(err, errlen, "cannot stat file %s: %s",
		    file, strerror(errno));
		return -1;
	}
	return auth_secure_path(file, &st, pw->pw_dir, pw->pw_uid, err, errlen);
}
static int secure_filename ( FILE * f , const char * file , struct passwd * pw , char * err , size_t errlen ) { struct stat st ; if ( fstat ( fileno ( f ) , & st ) < 0 ) { snprintf ( err , errlen , " " , file , strerror ( errno ) ) ; return -1 ; } return auth_secure_path ( file , & st , pw -> pw_dir , pw -> pw_uid , err , errlen ) ; }
Version of secure_path() that accepts an open file descriptor to
 avoid races.
Version of secure_path () that accepts an open file descriptor to avoid races .
/* check the open file to avoid races */