/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-request.c

  • Committer: Teddy Hogeborn
  • Date: 2008-09-06 00:19:53 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080906001953-5nk5uti6shzuyqdr
* plugins.d/password-prompt.c (main): If successful, output an extra
                                      newline to the console before
                                      exiting, to change to a new line
                                      away from the prompt.

* plugins.d/password-request.c (main): Bug fix: Moved calls to
                                       "init_gnutls_global()",
                                       "mkdtemp()", and "init_gpgme()"
                                       to *after* changing user &
                                       group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
918
918
      }
919
919
    }
920
920
    
921
 
    ret = init_gnutls_global(&mc, pubkey, seckey);
922
 
    if (ret == -1){
923
 
      fprintf(stderr, "init_gnutls_global failed\n");
924
 
      exitcode = EXIT_FAILURE;
925
 
      goto end;
926
 
    } else {
927
 
      gnutls_initalized = true;
928
 
    }
929
 
 
930
 
    if(mkdtemp(tempdir) == NULL){
931
 
      perror("mkdtemp");
932
 
      tempdir[0] = '\0';
933
 
      goto end;
934
 
    }
935
 
    
936
 
    if(not init_gpgme(&mc, pubkey, seckey, tempdir)){
937
 
      fprintf(stderr, "pgpme_initalized failed\n");
938
 
      exitcode = EXIT_FAILURE;
939
 
      goto end;
940
 
    } else {
941
 
      pgpme_initalized = true;
942
 
    }
943
 
    
944
921
    /* If the interface is down, bring it up */
945
922
    {
946
923
      sd = socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP);
984
961
      perror("setgid");
985
962
    }
986
963
    
 
964
    ret = init_gnutls_global(&mc, pubkey, seckey);
 
965
    if (ret == -1){
 
966
      fprintf(stderr, "init_gnutls_global failed\n");
 
967
      exitcode = EXIT_FAILURE;
 
968
      goto end;
 
969
    } else {
 
970
      gnutls_initalized = true;
 
971
    }
 
972
    
 
973
    if(mkdtemp(tempdir) == NULL){
 
974
      perror("mkdtemp");
 
975
      tempdir[0] = '\0';
 
976
      goto end;
 
977
    }
 
978
    
 
979
    if(not init_gpgme(&mc, pubkey, seckey, tempdir)){
 
980
      fprintf(stderr, "pgpme_initalized failed\n");
 
981
      exitcode = EXIT_FAILURE;
 
982
      goto end;
 
983
    } else {
 
984
      pgpme_initalized = true;
 
985
    }
 
986
    
987
987
    if_index = (AvahiIfIndex) if_nametoindex(interface);
988
988
    if(if_index == 0){
989
989
      fprintf(stderr, "No such interface: \"%s\"\n", interface);