1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-30 01:15:52 +00:00
freebsd-ports/security/libbeid/files/patch-dialogs
2015-06-02 09:23:15 +00:00

158 lines
8.0 KiB
Plaintext

--- cardcomm/pkcs11/src/dialogs/dialogs.h.orig 2015-06-02 08:02:25 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogs.h
@@ -27,6 +27,7 @@
#ifndef __DIALOGS_H__
#define __DIALOGS_H__
+#include <sys/types.h>
#include <string>
#ifdef WIN32
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-askaccess.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-askaccess.c
@@ -31,7 +31,7 @@
enum { MSG_ACCESS_CARD_TITLE=1, MSG_ACCESS_CARD_QUESTION };
-char* beid_messages[4][3]={
+static char const *const beid_messages[4][3]={
{"en", "beID: Card Access", "The application [%s] wants to access the eID card. Do you want to accept it?"},
{"nl", "beID: Lezen Kaart", "Het Programma [%s] vraagt toegang tot de eID kaart. Wil U dit toelaten?"},
{"fr", "beID: Lecture de Carte", "l'application [%s] essaye d'accéder à la carte eID. Acceptez-vous?"},
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-askpin.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-askpin.c
@@ -34,7 +34,7 @@
#define EXIT_ERROR 2
enum { MSG_PIN_CODE_REQUIRED=1, MSG_PLEASE_ENTER_PIN };
-char* beid_messages[4][3]={
+static char const *const beid_messages[4][3]={
{"en", "beID: PIN Code Required", "The application\n[%s]\nrequests your eID PIN code."},
{"nl", "beID: PINcode Vereist", "Het programma\n[%s]\nvraagt uw eID PINcode"},
{"fr", "beID: Code PIN Necessaire", "l'application\n[%s]\nvous demande votre code PIN eID"},
@@ -57,7 +57,7 @@ typedef struct
///////////////////////////////////////////////////////////////////////////////////////////
void update_pin_label(PinDialogInfo *pindialog)
{
- int i;
+ size_t i;
gchar tmp[MAX_PIN_LENGTH*6];
tmp[0]='\0';
for(i=0;i<strlen(pindialog->pin);i++)
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-badpin.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-badpin.c
@@ -16,6 +16,7 @@
* http://www.gnu.org/licenses/.
**************************************************************************** */
+#include <ctype.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
@@ -30,7 +31,7 @@
#define EXIT_ERROR 2
enum msgs { MSG_INCORRECT_PIN_CODE=1, MSG_N_ATTEMPTS_LEFT, MSG_LAST_ATTEMPT };
-char* beid_messages[4][4]={
+static char const *const beid_messages[4][4]={
{"en", "beID: Incorrect PIN Code", "You have entered an incorrect PIN code.\nPlease note that you have only %d attempts left before your PIN is blocked.", "You have entered an incorrect PIN code.\nPlease note that at the next incorrect entry your PIN code will be blocked."},
{"nl", "beID: Foutive PINcode", "U hebt een foutive PIN code ingegeven.\nGelieve te noteren dat u nog slechts %d pogingen hebt alvorens uw PIN code geblokkeerd wordt.", "U hebt een foutive PIN code ingegeven.\nGelieve te noteren dat bij de volgende incorrecte ingave uw PIN code geblokkeerd wordt."},
{"fr", "beID: Code PIN incorrect", "Vous avez entré un code PIN incorrect.\nVeuillez noter qu'il ne vous reste plus que %d tentatives avant que votre PIN soit bloqué", "Vous avez entré un code PIN incorrect.\nVieullez noter qu'a la prochaine entree incorrecte votre code PIN sera bloqué"},
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-changepin.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-changepin.c
@@ -17,6 +17,7 @@
* http://www.gnu.org/licenses/.
**************************************************************************** */
+#include <ctype.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
@@ -36,7 +37,7 @@
#define EXIT_ERROR 2
enum { MSG_CHANGE_PIN_CODE=1, MSG_PLEASE_ENTER_OLD_AND_NEW_PINS, MSG_CURRENT_PIN, MSG_NEW_PIN, MSG_NEW_PIN_AGAIN };
-char* beid_messages[4][6]={
+static char const *const beid_messages[4][6]={
{"en", "beID: Change PIN Code", "Request from Application [%s]:\n\nPlease enter your current eID PIN, followed by your new eID PIN (twice)", "Current PIN:", "New PIN:", "New PIN (again):"},
{"nl", "beID: PIN Code Wijzigen", "Verzoek van programma [%s]:\n\nGelieve Uw bestaande eID PIN code, en tweemaal uw nieuwe eID PINcode in te voeren.", "Huidige PIN:", "Nieuwe PIN:", "Nieuwe PIN (opnieuw):"},
{"fr", "beID: Changement de code PIN", "Demande de l'application [%s]:\n\nVeuillez entrer votre code PIN eID existant, suivi de votre nouveau code PIN eID (2 fois)", "Code PIN existant:", "Nouveau code PIN:","Nouveau code PIN (verification):"},
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-i18n.h.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-i18n.h
@@ -1,7 +1,7 @@
-char* _MSG_(int msgnum)
+char const *_MSG_(int msgnum)
{
- char* message=beid_messages[0][msgnum]; // default=English
- char* lang=getenv("LANG");
+ char const *message=beid_messages[0][msgnum]; // default=English
+ char const *lang=getenv("LANG");
if(lang!=NULL && strlen(lang)==5 && lang[2]=='_')
{
int i;
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-spr-askpin.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-spr-askpin.c
@@ -33,7 +33,7 @@
#define EXIT_ERROR 2
enum { MSG_PIN_CODE_REQUIRED=1, MSG_PLEASE_ENTER_PIN };
-char* beid_messages[4][3]={
+static char const* const beid_messages[4][3]={
{"en", "beID: PIN Code Required", "The application [%s] requests your eID PIN code on the secure pinpad reader:\n[%s].."},
{"nl", "beID: PINcode Vereist", "Het programma [%s] vraagt uw eID PIN code in te geven op de beveiligde kaartlezer:\n[%s]."},
{"fr", "beID: Code PIN Necessaire", "l'application [%s] vous demande d'entrer votre code PIN eID sur le lecteur securise\n[%s].."},
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-spr-changepin.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/beid-spr-changepin.c
@@ -33,7 +33,7 @@
#define EXIT_ERROR 2
enum { MSG_CHANGE_PIN_CODE=1, MSG_PLEASE_CHANGE_PIN };
-char* beid_messages[4][3]={
+static char const *const beid_messages[4][3]={
{"en", "beID: Change PIN Code", "Request from Application [%s]:\n\nPlease change your eID PIN code on the secure pinpad reader:\n[%s].."},
{"nl", "beID: Wijziging PINcode", "Verzoek van programma [%s]:\n\nGelieve uw eID PIN code op de beveiligde kaartlezer:\n[%s]\nte willen wijzigen."},
{"fr", "beID: Changement de code PIN", "Demande de l'application [%s]:\n\nVeuillez changer votre code PIN eID sur le lecteur securise\n[%s].."},
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/dlgs_gtk.cpp.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/dlgs_gtk.cpp
@@ -55,12 +55,14 @@ extern "C"
+static
bool MW_PERROR(tLevel level, tModule mod, const char* comment)
{
char err_txt[256],log_txt[1024];
wchar_t wide_log_txt[1024];
- snprintf(log_txt,sizeof(log_txt),"%s:%s",comment,strerror_r(errno,err_txt,sizeof(err_txt)));
+ strerror_r(errno,err_txt,sizeof(err_txt));
+ snprintf(log_txt,sizeof(log_txt),"%s:%s",comment,err_txt);
mbstowcs(wide_log_txt,log_txt,sizeof(wide_log_txt)/sizeof(wchar_t));
return MWLOG(level,mod,wide_log_txt);
}
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/parent.c.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/parent.c
@@ -1,4 +1,6 @@
+#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "config.h"
#include "parent.h"
#include <unistd.h>
@@ -11,7 +13,7 @@ ssize_t get_parent_path(char* exec_path,
char proc_path[32];
ssize_t exec_path_len=-1;
- snprintf(proc_path,sizeof(proc_path)-1,"/proc/%d/exe",getppid());
+ snprintf(proc_path,sizeof(proc_path)-1,"/proc/%d/file",getppid());
if((exec_path_len=readlink(proc_path,exec_path,exec_path_size-1))!=-1)
exec_path[exec_path_len]='\0';
return exec_path_len;
--- cardcomm/pkcs11/src/dialogs/dialogsgtk/parent.h.orig 2015-02-19 13:59:02 UTC
+++ cardcomm/pkcs11/src/dialogs/dialogsgtk/parent.h
@@ -1,2 +1,4 @@
+#include <sys/types.h>
+
ssize_t get_parent_path(char* exec_path, size_t exec_path_size);