From 6e61c304f382cf1fe31352ef3c80b261c0712b30 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 16 Apr 2018 11:47:55 +0200 Subject: White-space clean-up at EOLs. --- AUTHORS | 8 ++++---- AUTHORS.Canonical | 8 ++++---- ChangeLog.until-1.0.0 | 12 ++++++------ Makefile.am.coverage | 10 +++++----- debian/changelog | 2 +- debian/control | 2 +- m4/gcov.m4 | 4 ++-- src/crypt.c | 24 ++++++++++++------------ src/main.c | 12 ++++++------ src/uccs-server.c | 16 ++++++++-------- tests/dbus-interface.c | 6 +++--- tests/slmock | 16 ++++++++-------- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/AUTHORS b/AUTHORS index 0eda140..91bce00 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,7 +1,7 @@ # Generated by Makefile. Do not edit. - Albert Astals - Albert Astals Cid - Michael Terry + Albert Astals + Albert Astals Cid + Michael Terry Tarmac - Ted Gould + Ted Gould diff --git a/AUTHORS.Canonical b/AUTHORS.Canonical index 6163413..ac60fdf 100644 --- a/AUTHORS.Canonical +++ b/AUTHORS.Canonical @@ -1,5 +1,5 @@ - Albert Astals - Albert Astals Cid - Michael Terry + Albert Astals + Albert Astals Cid + Michael Terry Tarmac - Ted Gould + Ted Gould diff --git a/ChangeLog.until-1.0.0 b/ChangeLog.until-1.0.0 index b79e9b1..f446e33 100644 --- a/ChangeLog.until-1.0.0 +++ b/ChangeLog.until-1.0.0 @@ -7,7 +7,7 @@ 2012-09-20 Albert Astals Cid Handle the SetLastUsedServer calls - + The data is saved in a file that is encrypted with the password and whose name is the hash of the username to provide as much privacy/security possible 2012-09-20 Albert Astals @@ -97,7 +97,7 @@ 2012-09-14 Albert Astals Change the if line so the previously added test passes - + Not sure i fully understand what this line is trying to do 2012-09-14 Albert Astals @@ -123,7 +123,7 @@ 2012-09-14 Albert Astals Set AM_CPPFLAGS to be AM_CFLAGS too - + Since it seems we are compiling in CPP mode 2012-09-14 Ted Gould @@ -205,7 +205,7 @@ 2012-09-13 Albert Astals Add a test that fails regarding default/last_used server - + Make the default property of the servers map to the last_used on in rls speak 2012-09-12 Ted Gould @@ -246,7 +246,7 @@ 2012-09-11 Ted Gould - Gettin' some soup! + Gettin' some soup! 2012-09-11 Ted Gould @@ -846,7 +846,7 @@ 2012-08-10 Ted Gould - Adding a couple fun little calls to get this party started! + Adding a couple fun little calls to get this party started! 2012-08-10 Ted Gould diff --git a/Makefile.am.coverage b/Makefile.am.coverage index fb97747..e134a61 100644 --- a/Makefile.am.coverage +++ b/Makefile.am.coverage @@ -16,16 +16,16 @@ clean-gcno: clean-gcda: @echo Removing old coverage results -find -name '*.gcda' -print | xargs -r rm - + coverage-html: clean-gcda -$(MAKE) $(AM_MAKEFLAGS) -k check $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html - + generate-coverage-html: @echo Collecting coverage data $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info - + clean-coverage-html: clean-gcda -$(LCOV) --directory $(top_builddir) -z -rm -rf coverage.info coveragereport @@ -35,11 +35,11 @@ if HAVE_GCOVR coverage-gcovr: clean-gcda -$(MAKE) $(AM_MAKEFLAGS) -k check $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr - + generate-coverage-gcovr: @echo Generating coverage GCOVR report $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml - + clean-coverage-gcovr: clean-gcda -rm -rf $(top_builddir)/coverage.xml diff --git a/debian/changelog b/debian/changelog index 18c3d1b..9216eda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,7 +34,7 @@ remote-login-service (1.0.0-0ubuntu1) quantal; urgency=low * New upstream release. * Support caching the recently used server - * debian/control: Add build dep on libgcrypt11-dev + * debian/control: Add build dep on libgcrypt11-dev -- Ted Gould Thu, 20 Sep 2012 23:55:05 -0500 diff --git a/debian/control b/debian/control index 3e88ad3..1756156 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Mike Gabriel Build-Depends: dbus-test-runner, debhelper (>= 9), dpkg-dev (>= 1.16.1.1), - intltool (>= 0.35.0), + intltool (>= 0.35.0), libdbus-1-dev, libdbustest1-dev, libgcrypt11-dev, diff --git a/m4/gcov.m4 b/m4/gcov.m4 index 3163584..d243eeb 100644 --- a/m4/gcov.m4 +++ b/m4/gcov.m4 @@ -3,7 +3,7 @@ # * lcov # * genhtml # * gcovr -# +# # Sets ac_cv_check_gcov to yes if tooling is present # and reports the executables to the variables LCOV, GCOVR and GENHTML. AC_DEFUN([AC_TDD_GCOV], @@ -71,7 +71,7 @@ AC_DEFUN([AC_TDD_GCOV], # Add the special gcc flags COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage" - COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage" + COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage" COVERAGE_LDFLAGS="-lgcov" # Check availability of gcovr diff --git a/src/crypt.c b/src/crypt.c index 4e8775f..146aa7e 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -28,10 +28,10 @@ setup_cipher (const gchar * password) { gcry_error_t gcryError; gcry_cipher_hd_t gcryHandle; - + const size_t keyLength = gcry_cipher_get_algo_keylen(GCRY_CIPHER_AES); const size_t blkLength = gcry_cipher_get_algo_blklen(GCRY_CIPHER_AES); - + // We are assuming keyLength and blkLength are the same, check it if (keyLength != blkLength) return NULL; @@ -42,7 +42,7 @@ setup_cipher (const gchar * password) size_t i; for (i = passwordLength; i < blkLength; ++i) aesSymKey[i] = 0; - + gcryError = gcry_cipher_open(&gcryHandle, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_CBC, 0); if (gcryError) { g_warning("gcry_cipher_open failed: %s/%s\n", gcry_strsource(gcryError), gcry_strerror(gcryError)); @@ -80,12 +80,12 @@ do_aes_encrypt(const gchar *origBuffer, const gchar * password, size_t *outBuffe { gcry_error_t gcryError; gcry_cipher_hd_t gcryHandle; - + gcryHandle = setup_cipher (password); if (gcryHandle == NULL) { return NULL; } - + const size_t blkLength = gcry_cipher_get_algo_blklen(GCRY_CIPHER_AES); const size_t origBufferLength = strlen(origBuffer); const size_t bufferLength = ceil((double)origBufferLength / blkLength) * blkLength; @@ -94,7 +94,7 @@ do_aes_encrypt(const gchar *origBuffer, const gchar * password, size_t *outBuffe int i; for (i = origBufferLength; i < bufferLength; ++i) buffer[i] = 0; - + char * encBuffer = malloc(bufferLength); size_t lengthDone = 0; while (lengthDone < bufferLength) { @@ -107,9 +107,9 @@ do_aes_encrypt(const gchar *origBuffer, const gchar * password, size_t *outBuffe } lengthDone += blkLength; } - + gcry_cipher_close(gcryHandle); - + *outBufferLength = bufferLength; return encBuffer; } @@ -127,13 +127,13 @@ do_aes_decrypt(const gchar *encBuffer, const gchar * password, const size_t encB { gcry_error_t gcryError; gcry_cipher_hd_t gcryHandle; - + gcryHandle = setup_cipher (password); if (gcryHandle == NULL) { return NULL; } - - const size_t blkLength = gcry_cipher_get_algo_blklen(GCRY_CIPHER_AES128); + + const size_t blkLength = gcry_cipher_get_algo_blklen(GCRY_CIPHER_AES128); const size_t bufferLength = encBufferLength; char * outBuffer = malloc(bufferLength); size_t lengthDone = 0; @@ -146,7 +146,7 @@ do_aes_decrypt(const gchar *encBuffer, const gchar * password, const size_t encB } lengthDone += blkLength; } - + gcry_cipher_close(gcryHandle); char *result = g_strndup(outBuffer, bufferLength); free(outBuffer); diff --git a/src/main.c b/src/main.c index 5fa4187..9a17576 100644 --- a/src/main.c +++ b/src/main.c @@ -342,11 +342,11 @@ handle_set_last_used_server (RemoteLogon * rl, GDBusMethodInvocation * invocatio child = g_variant_get_child_value(params, 0); uccsUri = g_variant_get_string(child, NULL); g_variant_unref(child); /* fine as we know params is still ref'd */ - + child = g_variant_get_child_value(params, 1); serverUri = g_variant_get_string(child, NULL); g_variant_unref(child); /* fine as we know params is still ref'd */ - + GList * lserver = NULL; Server * server = NULL; for (lserver = config_file_servers; lserver != NULL; lserver = g_list_next(lserver)) { @@ -364,13 +364,13 @@ handle_set_last_used_server (RemoteLogon * rl, GDBusMethodInvocation * invocatio break; } } - + if (server != NULL) { server_set_last_used_server (server, serverUri); } - + g_dbus_method_invocation_return_value(invocation, NULL); - + return TRUE; } @@ -404,7 +404,7 @@ main (int argc, char * argv[]) #endif /* Setup i18n */ - setlocale (LC_ALL, ""); + setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); textdomain (GETTEXT_PACKAGE); diff --git a/src/uccs-server.c b/src/uccs-server.c index 69c716b..8365489 100644 --- a/src/uccs-server.c +++ b/src/uccs-server.c @@ -542,7 +542,7 @@ parse_json (UccsServer * server, GInputStream * json) g_warning("Malformed 'RemoteDesktopServer' entry. Not an array but a: %s", json_node_type_name(rds_node)); passed = FALSE; } - + if (json_object_has_member(root_object, "DefaultServer")) { JsonNode * ds_node = json_object_get_member(root_object, "DefaultServer"); if (JSON_NODE_TYPE(ds_node) == JSON_NODE_VALUE && json_node_get_value_type(ds_node) == G_TYPE_STRING) { @@ -551,7 +551,7 @@ parse_json (UccsServer * server, GInputStream * json) GList * lserver; for (lserver = server->subservers; lserver != NULL; lserver = g_list_next(lserver)) { Server * serv = SERVER(lserver->data); - + if (g_strcmp0(serv->name, default_server_name) == 0) { serv->last_used = TRUE; break; @@ -803,7 +803,7 @@ uccs_server_get_servers (UccsServer * server, const gchar * address) g_warning("Address '%s' is not authorized", address); return null_server_array(); } - + gchar *last_used_server_name = NULL; if (server->username != NULL && server->password != NULL) { gchar *username_sha = g_compute_checksum_for_string (G_CHECKSUM_SHA256, server->username, -1); @@ -830,7 +830,7 @@ uccs_server_get_servers (UccsServer * server, const gchar * address) g_variant_builder_init(&array, G_VARIANT_TYPE_ARRAY); GList * lserver; gint servercnt = 0; - + Server * last_used_server = NULL; if (last_used_server_name != NULL) { for (lserver = server->subservers; last_used_server == NULL && lserver != NULL; lserver = g_list_next(lserver)) { @@ -853,7 +853,7 @@ uccs_server_get_servers (UccsServer * server, const gchar * address) if (serv->state != SERVER_STATE_ALLGOOD) { continue; } - + if (last_used_server != NULL) serv->last_used = last_used_server == serv; @@ -916,10 +916,10 @@ static void set_last_used_server (Server * server, const gchar * uri) { Server * subserver = server_find_uri(server, uri); - + if (subserver != NULL) { subserver->last_used = TRUE; - + /* Write to disk */ if (UCCS_SERVER(server)->username != NULL && UCCS_SERVER(server)->password) { GKeyFile * key_file = g_key_file_new(); @@ -927,7 +927,7 @@ set_last_used_server (Server * server, const gchar * uri) gsize data_length; gchar *data = g_key_file_to_data (key_file, &data_length, NULL); g_key_file_free (key_file); - + size_t enc_data_length; gchar *enc_data = do_aes_encrypt(data, UCCS_SERVER(server)->password, &enc_data_length); g_free (data); diff --git a/tests/dbus-interface.c b/tests/dbus-interface.c index e67b60c..560a971 100644 --- a/tests/dbus-interface.c +++ b/tests/dbus-interface.c @@ -515,7 +515,7 @@ test_setlastused_basic (void) GDBusConnection * session = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); g_dbus_connection_set_exit_on_close(session, FALSE); - + g_assert(slmock_check_login(session, &slmock_table[1], TRUE)); GError * error = NULL; @@ -540,13 +540,13 @@ test_setlastused_basic (void) g_assert(retval != NULL); g_assert(g_variant_n_children(retval) == 0); g_variant_unref(retval); - + g_assert(slmock_check_login(session, &slmock_table[3], FALSE)); g_object_unref(session); g_object_unref(rls); g_object_unref(service); - + return; } diff --git a/tests/slmock b/tests/slmock index 10ccc95..e7026f1 100755 --- a/tests/slmock +++ b/tests/slmock @@ -43,7 +43,7 @@ class AdditionalManagementServer(): self.Name = name class TerminalServer(): - def __init__(self, url, name, protocol, domainRequired = True, + def __init__(self, url, name, protocol, domainRequired = True, username = None, password = None): self.URL = url self.Name = name @@ -68,7 +68,7 @@ def convert_to_builtin_type(obj): def freerdp(email): ms = ManagementServer("http://tc.arctica-project.org", "Landscape") - ts1 = TerminalServer("23.21.151.133", "FreeRDP US", "freerdp", False, + ts1 = TerminalServer("23.21.151.133", "FreeRDP US", "freerdp", False, "Administrator") ts2 = TerminalServer("46.137.222.181", "FreeRDP Asia", "freerdp", False, "Administrator") @@ -82,7 +82,7 @@ def freerdp(email): def x2go(email): ms = ManagementServer("http://x2go.intern", "X2GoSessionBroker") - ts1 = TerminalServer("10.0.2.11", "X2Go Server 1", "x2go", False, + ts1 = TerminalServer("10.0.2.11", "X2Go Server 1", "x2go", False, "foo") ts2 = TerminalServer("10.0.2.12", "X2Go Server 2", "x2go", False, "bar") @@ -102,7 +102,7 @@ def error(email): def citrix(email): ms = ManagementServer("http://tc.arctica-project.org", "Landscape") - ts1 = TerminalServer("107.21.17.35", "Citrix USA", "ICA", True, + ts1 = TerminalServer("107.21.17.35", "Citrix USA", "ICA", True, "useradmin1") ts2 = TerminalServer("107.21.17.35", "Citrix 2", "ICA", True, "useradmin2") @@ -122,7 +122,7 @@ def citrix(email): def vmware(email): ms = ManagementServer("http://tc.arctica-project.org", "Landscape") - ts = TerminalServer("https://10.193.37.140", "VMWare-View Lexington", + ts = TerminalServer("https://10.193.37.140", "VMWare-View Lexington", "vmware", True, "Administrator") ts.add_domain("VMWARE") ms.add_terminal_server(ts) @@ -174,12 +174,12 @@ def big(email): ms = ManagementServer("http://tc.arctica-project.org", "Landscape") ts1 = TerminalServer("107.21.17.35", "XenServer", "ICA") - ts2 = TerminalServer("http://1.2.3.4", "Citrix2", "ICA", True, + ts2 = TerminalServer("http://1.2.3.4", "Citrix2", "ICA", True, "fakeuser", "fakepassword") - ts3 = TerminalServer("10.21.17.35", "Accenture", "freerdp", True, + ts3 = TerminalServer("10.21.17.35", "Accenture", "freerdp", True, "fakeuser") ts4 = TerminalServer("https://4.5.6.7", "Accenture 2", "freerdp", False) - ts5 = TerminalServer("5.21.17.35", "VmWare Cloud", "vmware", False, + ts5 = TerminalServer("5.21.17.35", "VmWare Cloud", "vmware", False, "fakeuser", "fakepassword") ts6 = TerminalServer("http://8.9.10.11", "Canonicloud", "vmware", True) -- cgit v1.2.3