[pass] [PATCH v2] clip: don't race between pass instances in restore

Matthew Cengia mattcen at gmail.com
Thu Mar 20 14:57:05 CET 2014


On 2014-03-21 00:54, Matthew Cengia wrote:
[...]
>   while read -r pid cmd; do [[ $cmd = $sleep_argv0* ]] && kill -9 "$pid"; done < <(ps -opid=,args= -u"$(id -u)") && sleep 0.1

Oh, caveat re: ps 'args' option:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
args

    The command with all its arguments as a string. The implementation
    may truncate this value to the field width; it is
    implementation-defined whether any further truncation occurs.

I didn't hit any issues with a truncated command line, and I suspect the
length of sleep_argv0 is short enough it'd never hit such a truncation,
but I can't be certain.

-- 
Regards,
Matthew Cengia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: Digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140321/9ffc3843/attachment.asc>


More information about the Password-Store mailing list