native: 2 functions analysed · 2 typed · 0 untypeable · 0 timed out · 0 entry points (0 typed) · R: 17 definitions, 3 typed strict, 14 gradual, prelude debt 4 · fuzzing: 3 definitions, 0 unsound, 1 accept calls outside their domain · tyr dc7f1a7 · Rsem 7bcb45f · NativeSem 770a1eb · rstt 2b2696f unpinned
No .Call/.C/.Fortran/.External site in the R code, so no entry point.
SEXP pw_entry_dialog(SEXP prompt){
#ifndef _WIN32
const char *text = CHAR(STRING_ELT(prompt, 0));
const char *pass = getpass(text);
if(pass != NULL)
return Rf_mkString(pass);
#endif
return R_NilValue;
}void R_init_askpass(DllInfo *dll){
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
R_forceSymbols(dll, TRUE);
}argument: @("false"<> | null)
failing call: base::tolower(NULL)is_interactive <- function() {
opt <- getOption("rlib_interactive")
if (isTRUE(opt)) {
TRUE
} else if (identical(opt, FALSE)) {
FALSE
} else if (tolower(getOption("knitr.in.progress", "false")) == "true") {
FALSE
} else if (identical(Sys.getenv("TESTTHAT"), "true")) {
FALSE
} else {
interactive()
}
}Sys.info — a name the prelude does not declarename: Sys.info
is_macos <- function(){
identical(tolower(Sys.info()[['sysname']]), "darwin")
}is_windows <- function(){
.Platform$OS.type == 'windows'
}argument: @({ integer.max: INT1, double.eps: DBL1, double.xmax: DBL1, any }<>, "sizeof.pointer"<>)
failing call: base::$(list(integer.max = NA_integer_,
double.eps = NA_real_,
double.xmax = NA_real_),
"sizeof.pointer")askpass_path <- function(simple = TRUE){
if(is_windows()){
arch <- ifelse(identical(.Machine$sizeof.pointer, 4L), "32", "")
system.file(sprintf('win-askpass%s.exe', arch),
package = 'askpass', mustWork = TRUE)
} else if(is_macos()){
prog <- ifelse(isTRUE(simple), 'mac-simplepass', 'mac-askpass')
system.file(prog, package = 'askpass', mustWork = TRUE)
}
}rawToChar — a name the prelude does not declarename: rawToChar
out_without_eol <- function(x){
sub("\r?\n$", "", rawToChar(x))
}askpass_path — one of the package’s own names, itself untypedname: askpass_path
askpass_mac <- function(prompt){
tryCatch({
res <- sys::exec_internal(askpass_path(), prompt, timeout = 120)
out_without_eol(res$stdout)
}, error = function(e){
message(e$message)
})
}askpass_path — one of the package’s own names, itself untypedname: askpass_path
askpass_windows <- function(prompt, user = names(prompt)){
tryCatch({
res <- sys::exec_internal(askpass_path(), c(prompt, user), timeout = 120)
out_without_eol(res$stdout)
}, error = function(e){
message(e$message)
})
}is_unix <- function(){
.Platform$OS.type == "unix"
}stdin — a name the prelude does not declarename: stdin
readline_silent <- function(prompt, icon = "\U0001f511 "){
if(is_unix() && isatty(stdin())){
if(system('stty -echo') == 0){
on.exit(system('stty echo'))
}
}
cat(prompt, "\n")
out <- base::readline(icon)
cat(" OK\n")
out
}is_interactive — one of the package’s own names, itself untypedname: is_interactive
ask_password_default <- function(prompt){
if(!is_interactive())
return(NULL)
if(is_windows()){
askpass_windows(prompt)
} else if(is_macos() && !isatty(stdin())){
askpass_mac(prompt)
} else {
readline_silent(prompt)
}
}ask_password_default — one of the package’s own names, itself untypedname: ask_password_default
askpass <- function(prompt = "Please enter your password: "){
FUN <- getOption("askpass", ask_password_default)
FUN(prompt)
}askpass_path — one of the package’s own names, itself untypedname: askpass_path
ssh_askpass <- function(){
askpass_path(simple = FALSE)
}Sys.which — a name the prelude does not declarename: Sys.which
cmd_exists <- function(cmd){
nchar(Sys.which(cmd)) > 0
}cmd_exists — one of the package’s own names, itself untypedname: cmd_exists
fix_rstudio_path <- function(){
rs_path <- Sys.getenv('RS_RPOSTBACK_PATH')
git_askpass <- Sys.getenv('GIT_ASKPASS')
if(nchar(rs_path) && !cmd_exists(git_askpass)){
PATH <- Sys.getenv("PATH")
if(!grepl(normalizePath(rs_path, mustWork = FALSE), PATH, fixed = TRUE)){
rs_path <- unique(c(rs_path, sub("rpostback", 'postback', rs_path)))
Sys.setenv(PATH = paste(c(PATH, normalizePath(rs_path, mustWork = FALSE)),
collapse = .Platform$path.sep))
}
}
}| parameter | change | call | returned |
|---|---|---|---|
| var | kind:list | var_exists("var" = list()) | (LGL & ~vec1)<> with { } |
| var | kind:null | var_exists(NULL) | (LGL & ~vec1)<> with { names: (CHR & ~vec1)<> with { } } |
| var | wrap | var_exists(list(c(2147483647L, 1L, 1L, 1L, -1L))) | ff<> with { } |
var_exists <- function(var){
nchar(Sys.getenv(var)) > 0
}fix_rstudio_path — one of the package’s own names, itself untypedname: fix_rstudio_path
setup_askpass_vars <- function(){
if(var_exists('RSTUDIO')){
fix_rstudio_path()
} else {
# This is mostly for RGui and R.app (tty could mean MacOS server)
if(is_windows() || (is_macos() && !isatty(stdin()))){
askpass_bin = ssh_askpass()
if(!var_exists('GIT_ASKPASS')){
Sys.setenv("GIT_ASKPASS" = askpass_bin)
}
if(!var_exists('SSH_ASKPASS')){
Sys.setenv("SSH_ASKPASS" = askpass_bin)
}
}
}
}setup_askpass_vars — one of the package’s own names, itself untypedname: setup_askpass_vars
.onLoad <- function(libname, pkgname){
setup_askpass_vars()
}