homework-cifs: Pass password via fd
authorAdrian Vovk <adrianvovk@gmail.com>
Thu, 7 Mar 2024 18:38:26 +0000 (13:38 -0500)
committerAdrian Vovk <adrianvovk@gmail.com>
Mon, 11 Mar 2024 17:07:06 +0000 (13:07 -0400)
commit606a1f203c8871871bc8c5833d66ccbef870b010
tree32abaea779e96a25949a4c8efa652ce3b1dac561
parent58d061b5aafc72c3b7593c07717ced05bc9e2d17
homework-cifs: Pass password via fd

Pass the password into mount.cifs via a file descriptor, rather
than putting it into a plain-text file in /tmp. This uses the $PASSWD_FD
environment variable, which is undocumented but has existed since
forever (initial commit from 2010 [1] has it already)

[1]:
https://git.samba.org/?p=cifs-utils.git;a=blob;f=mount.cifs.c;hb=ce0b1609a9eedce6c5eb20eab287ea44217c0a6a#l1477
src/home/homework-cifs.c