Skip to content

Commit

Permalink
Release v2.4.3
Browse files Browse the repository at this point in the history
Fixes #204
Fixes #203
Fixes a bug in the andOTP export
  • Loading branch information
paolostivanin committed Mar 25, 2021
1 parent 712a83e commit 588747d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 24 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(OTPClient VERSION "2.4.2" LANGUAGES "C")
project(OTPClient VERSION "2.4.3" LANGUAGES "C")

configure_file("src/common/version.h.in" "version.h")
include_directories(${PROJECT_BINARY_DIR})
Expand All @@ -11,11 +11,11 @@ option(BUILD_GUI "Build the GUI" ON)
option(BUILD_CLI "Build the CLI" ON)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
set(CMAKE_C_FLAGS "-Wall -Wextra -O2 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
endif()
Expand Down
15 changes: 15 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* add "border-width: 5" to:
newdb_pwd_diag_id
decpwd_diag_id
changepwd_diag_id
unlock_pwd_diag_id
diag_webcam_id
diag_qr_clipboard_id
diag_webcam_id
manual_add_diag_id
dialog_rcdb_id
edit_diag_id
warning_diag_id
settings_diag_id

* change all paths to UI file
2 changes: 1 addition & 1 deletion data/com.github.paolostivanin.OTPClient.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Terminal=false
Name=OTPClient
Comment=GTK+ TOTP and HOTP client
Categories=GTK;GNOME;Utility;

StartupWMClass=otpclient
8 changes: 4 additions & 4 deletions src/common/andotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,18 @@ parse_json_data (const gchar *data,
otp->secret = secure_strdup (json_string_value (json_object_get (obj, "secret")));

const gchar *issuer = json_string_value (json_object_get (obj, "issuer"));
otp->issuer = g_strdup (g_strstrip (issuer));
otp->issuer = g_strstrip (g_strdup (issuer));

const gchar *label_with_prefix = json_string_value (json_object_get (obj, "label"));
gchar **tokens = g_strsplit (label_with_prefix, ":", -1);
if (tokens[0] && tokens[1]) {
if(issuer != NULL && g_ascii_strcasecmp(issuer, tokens[0]) == 0) {
otp->account_name = g_strdup (g_strstrip (tokens[1]));
otp->account_name = g_strstrip (g_strdup (tokens[1]));
} else {
otp->account_name = g_strdup (g_strstrip (label_with_prefix));
otp->account_name = g_strstrip (g_strdup (label_with_prefix));
}
} else {
otp->account_name = g_strdup (g_strstrip (tokens[0]));
otp->account_name = g_strstrip (g_strdup (tokens[0]));
}
g_strfreev (tokens);

Expand Down
8 changes: 3 additions & 5 deletions src/common/version.h.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#define PROJECT_NAME "@PROJECT_NAME@"
#define PROJECT_VER "@PROJECT_VERSION@"
#define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
#define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@"
#define PTOJECT_VER_PATCH "@PROJECT_VERSION_PATCH@"
#define PROJECT_NAME "@PROJECT_NAME@"
#define PROJECT_VER "@PROJECT_VERSION@"
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
15 changes: 5 additions & 10 deletions src/get-builder.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#include <gtk/gtk.h>

#include "version.h"

GtkBuilder *
get_builder_from_partial_path (const gchar *partial_path)
{
const gchar *prefix;
#ifndef USE_FLATPAK_APP_FOLDER
if (g_file_test (g_strconcat ("/usr/", partial_path, NULL), G_FILE_TEST_EXISTS)) {
prefix = "/usr/";
} else if (g_file_test (g_strconcat ("/usr/local/", partial_path, NULL), G_FILE_TEST_EXISTS)) {
prefix = "/usr/local/";
} else {
return NULL;
}
// cmake trims the last '/', so we have to manually add it later on
prefix = INSTALL_PREFIX;
#else
prefix = "/app/";
prefix = "/app";
#endif
gchar *path = g_strconcat (prefix, partial_path, NULL);
gchar *path = g_strconcat (prefix, "/", partial_path, NULL);

GtkBuilder *builder = gtk_builder_new_from_file (path);

Expand Down
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ main (gint argc,
{
GtkApplication *app = gtk_application_new ("com.github.paolostivanin.OTPClient", G_APPLICATION_FLAGS_NONE);
g_set_application_name (PROJECT_NAME);
g_set_prgname (PROJECT_VER);

g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);

Expand Down

0 comments on commit 588747d

Please sign in to comment.