8000 Replace expect with yes · Issue #5 · dbfun/cryptopro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace expect with yes #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
chenger opened this issue Jan 31, 2020 · 1 comment
Open

Replace expect with yes #5

chenger opened this issue Jan 31, 2020 · 1 comment

Comments

@chenger
Copy link
chenger commented Jan 31, 2020

./lib/root.exp "$file" вызывает вот это:
https://github.com/dbfun/cryptopro/blob/master/scripts/lib/root.exp
Cейчас делал для кубера это, можно сделать вот так:
yes o | /opt/cprocsp/bin/amd64/certmgr -inst -all -store uroot -file /opt/cacer.p7b;
yes сам понажимает o, и yes есть в большинстве образов, в отличии от expect
Поэтому можно из Dockerfile выпилить установку expect

@dbfun
Copy link
Owner
dbfun commented Jan 31, 2020

Да, можно. В этом образе не нужен, но вообще если стоит пароль на подписание, expect нужен. Через yes такой случай не обходится:

#!/usr/bin/expect
 
#
# Обход проблемы с интерактивным вводом пароля для подписания
#
 
set timeout 3
 
set thumbprint [lindex $argv 0]
set password [lindex $argv 1]
set src_file [lindex $argv 2]
set dest_file [lindex $argv 3]
 
spawn cryptcp -sign -thumbprint $thumbprint -nochain -der $src_file $dest_file
 
expect "Password:" { send "$password\r" }
 
expect {
  "Password:" { exit 1 }
  "(o) OK, (c) Cancel" {
    send "o\r"
    exp_continue
  }
  eof { exit 0 }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0