/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/password-prompt.c

  • Committer: Teddy Hogeborn
  • Date: 2008-09-06 15:34:21 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080906153421-605ydhwyo404krh9
* initramfs-tools-hook: Use long options where available.  Use only
                        one "test" invocation instead of several.

* mandos-keygen: Use only one "test" invocation instead of several.
                 Use long options where available.  Strip newline from
                 entered password.

* plugin-runner.c (print_out_password): Do not strip trailing newline.
  (fallback): Strip trailing newline from getpass().

* plugin-runner.xml (PLUGINS): Plugins should not print trailing
                               newlines.

* plugins.d/password-prompt.c (main): Strip trailing newline.

* plugins.d/password-request.c (main): Bug fix: Read "pubkey.txt", not
                                       "pupkey.txt".

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
      status = EXIT_SUCCESS;
217
217
      /* Make n = data size instead of allocated buffer size */
218
218
      n = (size_t)ret;
 
219
      /* Strip final newline */
 
220
      if(n>0 and buffer[n-1] == '\n'){
 
221
        buffer[n-1] = '\0';     /* not strictly necessary */
 
222
        n--;
 
223
      }
219
224
      size_t written = 0;
220
225
      while(written < n){
221
226
        ret = write(STDOUT_FILENO, buffer + written, n - written);
256
261
    fprintf(stderr, "%s is exiting with status %d\n", argv[0],
257
262
            status);
258
263
  }
 
264
  if(status == EXIT_SUCCESS){
 
265
    fputc('\n', stderr);
 
266
  }
259
267
  
260
268
  return status;
261
269
}