Skip to content

Switch to STD::ifstream for reading password files - #3

Open
eugenesan wants to merge 2 commits into
davidbartonau:stable-1.5from
eugenesan:stable-1.5
Open

Switch to STD::ifstream for reading password files#3
eugenesan wants to merge 2 commits into
davidbartonau:stable-1.5from
eugenesan:stable-1.5

Conversation

@eugenesan

@eugenesan eugenesan commented Jun 25, 2022

Copy link
Copy Markdown

Current implementation of reading password files uses lseek() to fetch file size.
On new systems that causes ESPIPE when using file descriptors for passing passwords.
[ lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) ]

Example of passing password using file descriptor from shell (bash):
$ read -s -p "Enter encryption password (echo off): " ZBPASS
$ zbackup --password-file <(echo "${ZBPASS}") init /home/user/backup

As a solution I sugest using STD::ifstream to read password files.

P.S.
The other commit is adding ability to build "mostly" static binary.
Only basic dependencies making the binary portable.

Current implementation of reading password files uses lseek() to fetch file size.
On new systems that causes ESPIPE when using file descriptors for passing passwords.
[ lseek(4, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek) ]

Example of passing password using file descriptor from shell (bash):
$ read -s -p "Enter encryption password (echo off): " ZBPASS
$ zbackup --password-file <(echo "${ZBPASS}") init /home/user/backup

As a solution I sugest using STD::ifstream to read password files.
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

Successfully merging this pull request may close these issues.

1 participant