RDEV-1131 Additional border for the qrcode
This commit is contained in:
parent
a7329b6e02
commit
d021a99ecc
Binary file not shown.
@ -68,15 +68,28 @@ char *parseJson(char source[], char name[] ) {
|
||||
|
||||
void printQr(const uint8_t qrcode[],pam_handle_t *pamh) {
|
||||
char *qrCodeString = "";
|
||||
char *white = "\u2588\u2588";
|
||||
char *black = " ";
|
||||
int size = qrcodegen_getSize(qrcode);
|
||||
int border = 1;
|
||||
int y;
|
||||
//additional line above
|
||||
for(y = -border; y < size + border + 2; y++){
|
||||
asprintf(&qrCodeString,"%s%s", qrCodeString, white);
|
||||
}
|
||||
asprintf(&qrCodeString,"%s%s", qrCodeString, "\n");
|
||||
for(y = -border; y < size + border; y++) {
|
||||
int x;
|
||||
asprintf(&qrCodeString,"%s%s",qrCodeString,white);
|
||||
for(x = -border; x < size + border; x++)
|
||||
asprintf(&qrCodeString,"%s%s",qrCodeString,qrcodegen_getModule(qrcode, x, y) ? " " : "\u2588\u2588");
|
||||
asprintf(&qrCodeString,"%s%s",qrCodeString,qrcodegen_getModule(qrcode, x, y) ? black : white);
|
||||
asprintf(&qrCodeString,"%s%s",qrCodeString,white);
|
||||
asprintf(&qrCodeString,"%s%s",qrCodeString,"\n");
|
||||
}
|
||||
//additional line below
|
||||
for(y = -border; y < size + border + 2; y++){
|
||||
asprintf(&qrCodeString,"%s%s", qrCodeString, white);
|
||||
}
|
||||
asprintf(&qrCodeString,"%s%s",qrCodeString,"\n");
|
||||
|
||||
pam_prompt(pamh, PAM_TEXT_INFO, NULL, "%s",qrCodeString);
|
||||
|
||||
6
Vagrantfile
vendored
6
Vagrantfile
vendored
@ -86,8 +86,8 @@ Vagrant.configure("2") do |config|
|
||||
make selinux
|
||||
make install
|
||||
|
||||
useradd -s /bin/bash -m kwa
|
||||
echo "kwa:kwa"|chpasswd
|
||||
useradd -s /bin/bash -m psz
|
||||
echo "psz:psz"|chpasswd
|
||||
|
||||
grep -q -e '#auth substack password-auth' /etc/pam.d/sshd || sed -i -e 's/auth substack password-auth/#auth substack password-auth/g' /etc/pam.d/sshd
|
||||
grep -q -e 'auth requisite pam_unix.so' /etc/pam.d/sshd || sed -i '\$aauth requisite pam_unix.so' /etc/pam.d/sshd
|
||||
@ -96,6 +96,6 @@ Vagrant.configure("2") do |config|
|
||||
|
||||
service sshd restart
|
||||
|
||||
#vagrant ssh -p -- -l kwa
|
||||
#vagrant ssh -p -- -l psz
|
||||
SHELL
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user