0

Some precision :

$> iex --version
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

IEx 1.4.4

$> mix --version
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Mix 1.4.4

I'm a french people and i don't understand why

$> iex -S mix

have some bugs with :

$> sudo iex -S mix

I want execute the command in IEx :

System.cmd("mount", ["-t", "ecryptfs", ".private", "private", "-o", ~s(key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n)], [stderr_to_stdout: true])

For test and mount a ecryptfs partition. In

$> iex -S mix
iex(2)> System.cmd("mount", ["-t", "ecryptfs", ".private", "private", "-o", ~s(key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n)], [stderr_to_stdout: true])

{"mount: mount : seul le superutilisateur peut utiliser l'option « --options »\n",1}

And I have the correct value, unprivileged mount.

With:

$> sudo iex -S mix
iex(2)> System.cmd("mount", ["-t", "ecryptfs", ".private", "private", "-o", ~s(key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n)], [stderr_to_stdout: true])

The command bugs and prints anything. It just block. Without return error code, without anything, just blocking. IEx don't print anything.

I have a screenshot for that bug :

enter image description here

jww
  • 97,681
  • 90
  • 411
  • 885
  • What happens if you run the command directly in the shell? `sudo mount -t ecryptfs .private private -o 'key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n'`? Does it finish executing instantly? Does it ask for a password or anything? – Dogbert Jun 13 '17 at 09:47
  • So, the sudo password is asking, but It print `Select cipher: 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 Selection [aes]: ` so, i have precise this in the command ? – Antoine Ciuccoli-Favarel Jun 13 '17 at 09:49
  • Yes, if you can somehow specify that value in CLI arguments so that it doesn't prompt this from the user, it should work from `System.cmd`. – Dogbert Jun 13 '17 at 09:57
  • I think I, I will create a type for option for my module with all specified value. Thinks a lot :) – Antoine Ciuccoli-Favarel Jun 13 '17 at 10:09

1 Answers1

0

Okay, System.cmd don't want to quote in argument. Okay. :/