lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 292 forks source link

lpass edit changes not sync'd, lots of upload-queue files generated on export #557

Open theooze opened 4 years ago

theooze commented 4 years ago

i'm writing a zsh script to fixup existing entries and merge in some passwords from other sources, i'm seeing a couple different things and i'm not sure if they are related or not. i'm using lastpass-cli-1.3.3-1.fc30.x86_64.

if i run something like:

echo "${mypassword}" | lpass login "${myuser}"
while IFS=, read name id url
        do
        < some shell processing here>
        echo "updated attribute value " | lpass edit --non-interactive --sync=now --url "${id}"
done <<< "$(lpass export --fields=name,id,url | tr -d '\r')"

and then run a lpass export after, the changes don't seem to have been propagated up to the lastpass server. i was expecting w/ the 'sync=now', the change would be sent to the server and then the local cache sync'd based on the man page entry: If now is set, and the command makes a change, the change is synchronized before the command exits. i was poking around and noticed a lot of files in $HOME/.local/share/lpass/upload-queue after running my script.

so i decided to run a lpass sync, and then those files are cleared out and sometimes the change sticks (i need to test this more) - but as noted, i don't expect to need to run the sync, the edit w/ sync-now should be sufficient ?

while looking into this, i also noticed that if i do just:

echo "${mypassword}" | lpass login "${lUser}"
while IFS=, read name id url
        do
       echo hello
done <<< "$(lpass export --fields=name,id,url | tr -d '\r')"

i end up w/ a lot of files in the upload-queue dir. i was assuming that directory was only queuing up changes to be sent to the server. running a lpass sync would eventually clear the directory.

should i be running a lpass sync after every edit, even w/ the --sync=now parameter to the edit ?