Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

rpmio/getpass.c

Go to the documentation of this file.
00001 
00005 #include "system.h"
00006 #if HAVE_KEYUTILS_H
00007 #include <argv.h>
00008 #include <keyutils.h>
00009 #endif
00010 #include "debug.h"
00011 
00012 char * _GetPass(const char * prompt)
00013 {
00014 /*@-unrecog@*/
00015     return getpass( prompt ? prompt : "" );
00016 /*@=unrecog@*/
00017 }
00018 
00019 char * _RequestPass(const char * prompt)
00020 {
00021     static char * password = NULL;
00022 #if HAVE_KEYUTILS_H
00023     const char * foo = "user rpm:yyyy spoon";
00024     ARGV_t av = NULL;
00025     int xx = argvSplit(&av, foo, NULL);
00026     key_serial_t dest = 0;
00027     key_serial_t key = 0;
00028 
00029     if (password) {
00030         free(password);
00031         password = NULL;
00032     }
00033     key = request_key(av[0], av[1], av[2], dest);
00034 
00035     xx = keyctl_read_alloc(key, (void *)&password);
00036 #endif
00037 
00038     return password;
00039 }
00040 
00041 char * (*Getpass) (const char * prompt) = _GetPass;

Generated on Wed Dec 28 07:45:58 2016 for rpm by  doxygen 1.4.4