Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package xmppc for openSUSE:Factory checked 
in at 2022-12-06 16:58:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xmppc (Old)
 and      /work/SRC/openSUSE:Factory/.xmppc.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xmppc"

Tue Dec  6 16:58:05 2022 rev:2 rq:1040713 version:0.1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/xmppc/xmppc.changes      2020-10-28 
14:33:56.419811113 +0100
+++ /work/SRC/openSUSE:Factory/.xmppc.new.1835/xmppc.changes    2022-12-06 
16:58:06.149600632 +0100
@@ -1,0 +2,8 @@
+Tue Dec  6 13:07:37 UTC 2022 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.1.2:
+  * Replaced strndupa by strncpy Fix: #17
+  * Display help, if no parameter has been set
+  * fixed g_error_matches handling for config file
+
+-------------------------------------------------------------------

Old:
----
  0.1.0.tar.gz

New:
----
  0.1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xmppc.spec ++++++
--- /var/tmp/diff_new_pack.SCZslS/_old  2022-12-06 16:58:06.641603255 +0100
+++ /var/tmp/diff_new_pack.SCZslS/_new  2022-12-06 16:58:06.645603277 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package xmppc
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           xmppc
-Version:        0.1.0
+Version:        0.1.2
 Release:        0
 Summary:        Command Line Interface Tool for XMPP
 License:        GPL-3.0-or-later

++++++ 0.1.0.tar.gz -> 0.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmppc/changelog new/xmppc/changelog
--- old/xmppc/changelog 2020-05-16 18:18:33.000000000 +0200
+++ new/xmppc/changelog 2022-03-31 11:07:01.000000000 +0200
@@ -1,3 +1,12 @@
+2022-05-16 Stefan Kropp <stefan.kr...@posteo.de>
+       Release 0.1.2
+       * Replaced strndupa by strncpy Fix: #17
+
+2020-05-16 Stefan Kropp <stefan.kr...@posteo.de>
+       Release 0.1.1
+       * Display help, if no parameter has been set
+       * fixed g_error_matches handling for config file
+
 2020-05-16 DebXWoody <ste...@debxwoody.de>
        
        Release 0.1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmppc/configure.ac new/xmppc/configure.ac
--- old/xmppc/configure.ac      2020-05-16 18:18:33.000000000 +0200
+++ new/xmppc/configure.ac      2022-03-31 11:07:01.000000000 +0200
@@ -1,4 +1,4 @@
-AC_INIT([xmppc], [0.1.0], [ste...@debxwoody.de])
+AC_INIT([xmppc], [0.1.2], [stefan.kr...@posteo.de])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR([src/main.c])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmppc/src/main.c new/xmppc/src/main.c
--- old/xmppc/src/main.c        2020-05-16 18:18:33.000000000 +0200
+++ new/xmppc/src/main.c        2022-03-31 11:07:01.000000000 +0200
@@ -338,6 +338,11 @@
   printf("!!! WARNING: XMPPC is running in development mode !!!\n");
 #endif
 
+  if(argc < 2) {
+    _show_help();
+    return EXIT_FAILURE;
+  }
+
   INIT_XMPPC(xmppc);
 
   static int verbose_flag = 0;
@@ -425,19 +430,29 @@
     &error);
 
   if (!configfilefound) {
-   if(!g_error_matches(error, G_KEY_FILE_ERROR, 
G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
-      logError(&xmppc, "Error loading key file: %s", error->message);
-      return -1;
+   if(error && !g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+      logError(&xmppc, "Error loading key file: %s\n", error->message);
+      return EXIT_FAILURE;
     }
-  } else {
-    if(jid == NULL && pwd == NULL) { 
-      logInfo(&xmppc,"Loading default account\n");
-      if( account == NULL ) {
-        account = "default";
-      }
-      jid = g_key_file_get_value (config_file, account, "jid" ,&error);
-      pwd = g_key_file_get_value (config_file, account, "pwd" ,&error);
+    if(jid == NULL && account == NULL) {
+      printf("You need either --jid or --account parameter or a default 
account\n");
+      _show_help();
+      return EXIT_FAILURE;
+    }
+  }
+  error = NULL;
+
+  if(jid == NULL && pwd == NULL) {
+    logInfo(&xmppc,"Loading default account\n");
+    if( account == NULL ) {
+      account = "default";
+    }
+    jid = g_key_file_get_value (config_file, account, "jid" ,&error);
+    if( error ) {
+      logError(&xmppc, "No jid found in configuration file. %s\n", 
error->message);
+      return EXIT_FAILURE;
     }
+    pwd = g_key_file_get_value (config_file, account, "pwd" ,&error);
   }
 
   if ( !pwd ) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmppc/src/mode/pgp.c new/xmppc/src/mode/pgp.c
--- old/xmppc/src/mode/pgp.c    2020-05-16 18:18:33.000000000 +0200
+++ new/xmppc/src/mode/pgp.c    2022-03-31 11:07:01.000000000 +0200
@@ -175,7 +175,9 @@
 }
 
 static char* _pgp_remove_PGP_MESSAGE_comment(const char* message) {
-  char* tmp = strndupa(message, strlen(message) - (strlen(PGP_END)+1));
+  char* tmp = alloca((strlen(message) - strlen(PGP_END)) + 1);
+  strncpy(tmp, message, strlen(message) - strlen(PGP_END));
+  tmp[(strlen(message) - strlen(PGP_END)+1)] = '\0';
   tmp = tmp+((strlen(PGP_BEGIN) +1) * sizeof(char));
   char* result = malloc(strlen(tmp)+1);
   strcpy(result, tmp);

Reply via email to