Making pam_panic_pw cunit ready
This commit is contained in:
parent
09fa4f648f
commit
d1412beb45
@ -21,9 +21,9 @@ LICENSE : GNU-GPLv3
|
||||
|
||||
#define _(String) gettext(String)
|
||||
|
||||
int writePasswords(char pw[][99]){
|
||||
int writePasswords(char pw[][99], char* pwfile){
|
||||
|
||||
FILE *f = fopen(PPASSFILE, "w");
|
||||
FILE *f = fopen(pwfile, "w");
|
||||
if(f == NULL){
|
||||
fprintf(stderr, _("ERROR opening file!\n"));
|
||||
return 2;
|
||||
@ -33,11 +33,12 @@ int writePasswords(char pw[][99]){
|
||||
|
||||
fclose(f);
|
||||
|
||||
chmod(PPASSFILE, 0644);
|
||||
chmod(pwfile, 0644);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef TEST
|
||||
|
||||
int main(void){
|
||||
|
||||
@ -105,6 +106,6 @@ int main(void){
|
||||
|
||||
/* Save the results. */
|
||||
|
||||
return writePasswords(pw);
|
||||
return writePasswords(pw, PPASSFILE);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -5,4 +5,4 @@ DATE : 2018-03-27T02:34:08+02:00
|
||||
LICENSE : GNU-GPLv3
|
||||
*/
|
||||
|
||||
int writePassword(char pw[][99]);
|
||||
int writePasswords(char pw[][99], char* pwfile);
|
||||
|
Loading…
Reference in New Issue
Block a user