I have a Cocoa Application that is using NSTask to run a shell script that receives variables upon task launch. These variables are dynamic, and the command that is run will vary based on these variables. (they are flags, directory paths, etc) The command is rsync and it HAS to be run with sudo because it is interacting with files that the current user will not have ownership of.
My question is this: How do I prompt the user for an Administrator username and password when the script would normally prompt for them if run in terminal? I CANNOT use a variable to store the password.
Is there some sort of way to use an input pipe? If so, how does NSTask know when to prompt for the username and password, and how would you send input through the input pipe to the script without using a variable?