* Check that the program was granted access to program_id (#13890)
(cherry picked from commit 733fcbaa6c
)
# Conflicts:
# programs/bpf/tests/programs.rs
* Resolve conflicts
* nudge
* nudge
Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
@@ -1036,6 +1036,20 @@ fn verify_instruction<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
// validate the caller has access to the program account
|
||||
let _ = callers_keyed_accounts
|
||||
.iter()
|
||||
.find_map(|keyed_account| {
|
||||
if &instruction.program_id == keyed_account.unsigned_key() {
|
||||
Some(keyed_account)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.ok_or(SyscallError::InstructionError(
|
||||
InstructionError::MissingAccount,
|
||||
))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user