=== modified file 'TODO'
--- TODO 2008-08-10 16:13:23 +0000
+++ TODO 2008-08-10 20:22:27 +0000
@@ -7,33 +7,27 @@
* Mandos-client
** [#A] Man page: man8/mandos-client.8mandos
-*** EXIT STATUS
- Create this section
-*** USAGE
+*** DESCRIPTION
Describe the plus sign syntax for passing options from crypttab
+*** EXIT STATUS
+ Text needed
*** EXAMPLES
Examples of normal usage, debug usage, debugging single or all
plugins, examples of crypttab lines with plus syntax, etc.
*** FILES
- Describe plugin directory
-*** DIAGNOSTICS
- Create this section
+ Text needed
*** SECURITY
- Create this section
+ Text needed
*** NOTES
- Create this section (if needed)
+ Text needed
*** BUGS
- Create this section
+ Text needed
*** SEE ALSO
- Refer to mandos(8), password-request(8mandos), and
- password-prompt(8mandos)
+ Explaining test on what you can read
** Use asprintf instead of malloc and strcat?
** use strsep instead of strtok?
** use config file in addition to arguments
** pass things in environment, like device name, etc
-** Fallback
- As a fallback, if no plugins can be found or if all of them failed,
- run getpass(3) itself.
* Password-request
** [#A] Man page: man8/password-request.8mandos
=== modified file 'clients.conf'
--- clients.conf 2008-08-09 01:39:09 +0000
+++ clients.conf 2008-08-10 20:35:01 +0000
@@ -18,10 +18,10 @@
;####
-;# Example client named "foo"
+;# Example client
;[foo]
;
-;# OpenPGP key fingerprint for "foo"
+;# OpenPGP key fingerprint
;fingerprint = 7788 2722 5BA7 DE53 9C5A 7CFA 59CF F7CD BD9A 5920
;
;# This is base64-encoded binary data. It will be decoded and sent to
=== modified file 'mandos-client.c'
--- mandos-client.c 2008-08-10 03:32:42 +0000
+++ mandos-client.c 2008-08-10 20:22:27 +0000
@@ -170,6 +170,18 @@
proc->completed = true;
}
+bool print_out_password(const char *buffer, size_t length){
+ size_t ret;
+ for(size_t written = 0; written < length; written += ret){
+ ret = TEMP_FAILURE_RETRY(write(STDOUT_FILENO, buffer + written,
+ length - written));
+ if(ret < 0){
+ return false;
+ }
+ }
+ return true;
+}
+
int main(int argc, char *argv[]){
const char *plugindir = "/conf/conf.d/mandos/plugins.d";
size_t d_name_len;
@@ -583,9 +595,9 @@
dir = NULL;
if (process_list == NULL){
- fprintf(stderr, "No plugin processes started, exiting\n");
- exitstatus = EXIT_FAILURE;
- goto end;
+ fprintf(stderr, "No plugin processes started. Incorrect plugin"
+ " directory?\n");
+ process_list = NULL;
}
while(process_list){
fd_set rfds = rfds_all;
@@ -654,17 +666,11 @@
break;
}
/* This process exited nicely, so print its buffer */
- for(size_t written = 0; written < proc->buffer_length;
- written += (size_t)ret){
- ret = TEMP_FAILURE_RETRY(write(STDOUT_FILENO,
- proc->buffer + written,
- proc->buffer_length
- - written));
- if(ret < 0){
- perror("write");
- exitstatus = EXIT_FAILURE;
- goto end;
- }
+
+ bool bret = print_out_password(proc->buffer, proc->buffer_length);
+ if(not bret){
+ perror("print_out_password");
+ exitstatus = EXIT_FAILURE;
}
goto end;
}
@@ -699,12 +705,26 @@
}
}
}
+
if(process_list == NULL){
- fprintf(stderr, "All plugin processes failed, exiting\n");
- exitstatus = EXIT_FAILURE;
+ bool bret;
+ fprintf(stderr, "Going to fallback mode using getpass(3)\n");
+ char *passwordbuffer = getpass("Password: ");
+ bret = print_out_password(passwordbuffer, strlen(passwordbuffer));
+ if(not bret){
+ perror("print_out_password");
+ exitstatus = EXIT_FAILURE;
+ goto end;
+ }
+ bret = print_out_password("\n", 1);
+ if(not bret){
+ perror("print_out_password");
+ exitstatus = EXIT_FAILURE;
+ }
}
-
+
end:
+
/* Restore old signal handler */
sigaction(SIGCHLD, &old_sigchld_action, NULL);
=== modified file 'mandos-client.xml'
--- mandos-client.xml 2008-08-10 01:10:04 +0000
+++ mandos-client.xml 2008-08-10 19:14:12 +0000
@@ -220,4 +220,53 @@
+
+
+ EXIT STATUS
+
+
+
+
+
+ FILES
+
+
+
+
+
+ NOTES
+
+
+
+
+
+ BUGS
+
+
+
+
+
+ EXAMPLES
+
+
+
+
+
+ SECURITY
+
+
+
+
+
+ SEE ALSO
+
+ mandos
+ 8,
+ password-request
+ 8mandos and
+ password-prompt
+ 8mandos
+
+
+