This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 3515c4c63d729f8508d6c30cbedbf06c9c41df1e (commit)
via e4832ceda4a46567f234b0963e48790a45d3fa70 (commit)
via 515fb74c0c0b372b4c8f692141335206b3be24a5 (commit)
via 151d51edac68537953f5ddcd96ea30d895b14af3 (commit)
via 129873fcc7c77c9271e65de0acf10a803b76ef21 (commit)
via f66d16958bd6c0dd7e9fb75d58a70578acadb27c (commit)
via e2fdf5723288a6eed7bcc21bc9ba4b0e2a009538 (commit)
via b7ff8e4026ebb2238825dff5e887e7a1f022b3d2 (commit)
via 44f3f78ef6cf538f79fc058c89e13ae90a048061 (commit)
via 8b79bda49a93e3402d8b77d0de4f32f438b409b6 (commit)
via e5a43d6691c0e629402d87a4612abd50555cd5e5 (commit)
from 5edb19bb86b6d790603a4ddeb0384f2f2d95c52f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/3515c4c63d729f8508d6c30cbedbf06c9c41df1e
commit 3515c4c63d729f8508d6c30cbedbf06c9c41df1e
Author: Carlos R. Mafra <[email protected]>
Date: Sun May 18 01:10:06 2014 +0100
Coding style: Change 'foo * bar' to 'foo *bar' in function arguments
Since 'foo' and 'bar' are not being multiplied...
Done automatically with the sed script:
/(/{
s/ * ([a-zA-Z])/ *1/g
}
diff --git a/src/icon.c b/src/icon.c
index d297cbc5..b5bb3089 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -54,9 +54,9 @@
#define CACHE_ICON_PATH "/Library/WindowMaker/CachedPixmaps"
#define ICON_BORDER 3
-static void miniwindowExpose(WObjDescriptor * desc, XEvent * event);
-static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event);
-static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event);
+static void miniwindowExpose(WObjDescriptor *desc, XEvent *event);
+static void miniwindowMouseDown(WObjDescriptor *desc, XEvent *event);
+static void miniwindowDblClick(WObjDescriptor *desc, XEvent *event);
static WIcon *icon_create_core(WScreen *scr, int coord_x, int coord_y);
@@ -199,7 +199,7 @@ static WIcon *icon_create_core(WScreen *scr, int coord_x,
int coord_y)
return icon;
}
-void wIconDestroy(WIcon * icon)
+void wIconDestroy(WIcon *icon)
{
WCoreWindow *core = icon->core;
WScreen *scr = core->screen_ptr;
@@ -463,7 +463,7 @@ static RImage *get_wwindow_image_from_wmhints(WWindow
*wwin, WIcon *icon)
* Side effects:
* New directories might be created.
*/
-char *wIconStore(WIcon * icon)
+char *wIconStore(WIcon *icon)
{
char *path, *dir_path, *file;
int len = 0;
@@ -537,7 +537,7 @@ void wIconSetHighlited(WIcon *icon, Bool flag)
update_icon_pixmap(icon);
}
-void wIconSelect(WIcon * icon)
+void wIconSelect(WIcon *icon)
{
WScreen *scr = icon->core->screen_ptr;
icon->selected = !icon->selected;
@@ -785,7 +785,7 @@ void wIconPaint(WIcon *icon)
/******************************************************************/
-static void miniwindowExpose(WObjDescriptor * desc, XEvent * event)
+static void miniwindowExpose(WObjDescriptor *desc, XEvent *event)
{
/* Parameter not used, but tell the compiler that it is ok */
(void) event;
@@ -793,7 +793,7 @@ static void miniwindowExpose(WObjDescriptor * desc, XEvent
* event)
wIconPaint(desc->parent);
}
-static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event)
+static void miniwindowDblClick(WObjDescriptor *desc, XEvent *event)
{
WIcon *icon = desc->parent;
@@ -805,7 +805,7 @@ static void miniwindowDblClick(WObjDescriptor * desc,
XEvent * event)
wDeiconifyWindow(icon->owner);
}
-static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
+static void miniwindowMouseDown(WObjDescriptor *desc, XEvent *event)
{
WIcon *icon = desc->parent;
WWindow *wwin = icon->owner;
http://repo.or.cz/w/wmaker-crm.git/commit/e4832ceda4a46567f234b0963e48790a45d3fa70
commit e4832ceda4a46567f234b0963e48790a45d3fa70
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:46 2014 +0200
WUtil: remove duplicated information from 'wassertr(v)' message
The information about the File, Line and Function name that were included
in the assertion message are already present from the 'wwarning' macro, so
it is not necessary to include them in the macro's message.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h
index 01d03684..04e11975 100644
--- a/WINGs/WINGs/WUtil.h
+++ b/WINGs/WINGs/WUtil.h
@@ -40,15 +40,6 @@
#endif
-#ifndef __ASSERT_FUNCTION
-# if (!defined (__GNUC__) || (__GNUC__ < 2 && - __GNUC_MINOR__ < (defined
(__cplusplus) ? 6 : 4)))
-# define __ASSERT_FUNCTION ((char *) 0)
-# else
-# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
-# endif
-#endif
-
#ifndef __GNUC__
#define __attribute__(x) /*NOTHING*/
#endif
@@ -65,15 +56,13 @@
#define wassertr(expr) if (!(expr)) { - wwarning("%s line %i (%s):
assertion %s failed",- __FILE__, __LINE__, __ASSERT_FUNCTION,
#expr);+ wwarning("wassertr: assertion %s failed", #expr);
return; }
#define wassertrv(expr, val) if (!(expr)) { - wwarning("%s line %i
(%s): assertion %s failed",- __FILE__, __LINE__,
__ASSERT_FUNCTION, #expr);+ wwarning("wassertrv: assertion %s failed",
#expr); return (val); }
http://repo.or.cz/w/wmaker-crm.git/commit/515fb74c0c0b372b4c8f692141335206b3be24a5
commit 515fb74c0c0b372b4c8f692141335206b3be24a5
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:45 2014 +0200
WUtil: change 'wassertr(v)' to still perform check even if NDEBUG is set
In many places of the code these functions are counting on the "return"
effect of these macros to gracefully handle incorrect arguments. So, when
debug is not enabled, if it is okay to not display a message it is however
not good to completely skip the check and skip the early return.
This patch changes the macro to always perform the check and return to
avoid crashes, displaying a message only when NDEBUG is not set.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h
index da74dfc3..01d03684 100644
--- a/WINGs/WINGs/WUtil.h
+++ b/WINGs/WINGs/WUtil.h
@@ -55,20 +55,13 @@
#ifdef NDEBUG
-#define wassertr(expr) {}
-#define wassertrv(expr, val) {}
+#define wassertr(expr) + if (!(expr)) { return; }
-#else /* !NDEBUG */
-
-#ifdef DEBUG
-
-#include <assert.h>
+#define wassertrv(expr, val) + if (!(expr)) { return (val); }
-#define wassertr(expr) assert(expr)
-
-#define wassertrv(expr, val) assert(expr)
-
-#else /* !DEBUG */
+#else /* !NDEBUG */
#define wassertr(expr) if (!(expr)) { @@ -83,7 +76,6 @@
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr); return
(val); }
-#endif /* !DEBUG */
#endif /* !NDEBUG */
http://repo.or.cz/w/wmaker-crm.git/commit/151d51edac68537953f5ddcd96ea30d895b14af3
commit 151d51edac68537953f5ddcd96ea30d895b14af3
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:44 2014 +0200
WUtil: fix undefined behaviour with $VARS in wexpandpath (Coverity #50244)
As reported by coverity, calling 'wexpandpath' with a path that contains
either '$()', '$(0' or '$0' would cause an undefined behaviour because
the 'buffer2' would be uninitialised.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/findfile.c b/WINGs/findfile.c
index 6d0593cf..21ed7e22 100644
--- a/WINGs/findfile.c
+++ b/WINGs/findfile.c
@@ -138,17 +138,19 @@ char *wexpandpath(const char *path)
char *tmp;
if (*path == '$') {
- int j = 0;
+ int j;
+
path++;
/* expand $(HOME) or $HOME style environment variables
*/
if (*path == '(') {
path++;
+ j = 0;
while (*path != 0 && *path != ')') {
if (j > PATH_MAX)
goto error;
buffer2[j++] = *(path++);
- buffer2[j] = 0;
}
+ buffer2[j] = 0;
if (*path == ')') {
path++;
tmp = getenv(buffer2);
@@ -173,12 +175,13 @@ char *wexpandpath(const char *path)
goto error;
}
} else {
+ j = 0;
while (*path != 0 && *path != '/') {
if (j > PATH_MAX)
goto error;
buffer2[j++] = *(path++);
- buffer2[j] = 0;
}
+ buffer2[j] = 0;
tmp = getenv(buffer2);
if (!tmp) {
if ((i += strlen(buffer2) + 1) >
PATH_MAX ||
http://repo.or.cz/w/wmaker-crm.git/commit/129873fcc7c77c9271e65de0acf10a803b76ef21
commit 129873fcc7c77c9271e65de0acf10a803b76ef21
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:43 2014 +0200
WUtil: make use of secure_getenv if the function is available
As pointed by Coverity (#50226), the function getenv can return unreliable
data, so if a sensitive application makes uses of the function 'wgethomedir'
or 'wusergnusteppath' we'd better use the GNU function secure_getenv which
ignore environment variable when used in a known critical cases.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/findfile.c b/WINGs/findfile.c
index ea7980b8..6d0593cf 100644
--- a/WINGs/findfile.c
+++ b/WINGs/findfile.c
@@ -46,7 +46,11 @@ char *wgethomedir()
if (home)
return home;
+#ifdef HAVE_SECURE_GETENV
+ tmp = secure_getenv("HOME");
+#else
tmp = getenv("HOME");
+#endif
if (tmp) {
home = wstrdup(tmp);
return home;
diff --git a/WINGs/userdefaults.c b/WINGs/userdefaults.c
index 269e43e6..92f4e0f3 100644
--- a/WINGs/userdefaults.c
+++ b/WINGs/userdefaults.c
@@ -58,7 +58,11 @@ const char *wusergnusteppath()
/* Value have been already computed, re-use it */
return path;
+#ifdef HAVE_SECURE_GETENV
+ gspath = secure_getenv("GNUSTEP_USER_ROOT");
+#else
gspath = getenv("GNUSTEP_USER_ROOT");
+#endif
if (gspath) {
gspath = wexpandpath(gspath);
if (gspath) {
diff --git a/configure.ac b/configure.ac
index 684a6064..4ea1e32f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -253,6 +253,7 @@ dnl ============================
dnl not used anywhere
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
+WM_FUNC_SECURE_GETENV
AC_CHECK_FUNCS(gethostname select poll strcasecmp strncasecmp
setsid mallinfo mkstemp sysconf)
AC_SEARCH_LIBS([strerror], [cposix])
diff --git a/m4/windowmaker.m4 b/m4/windowmaker.m4
index 8ff1bd62..affdea47 100644
--- a/m4/windowmaker.m4
+++ b/m4/windowmaker.m4
@@ -182,3 +182,28 @@ m4_popdef([ENABLEVAR])dnl
m4_popdef([CACHEVAR])dnl
m4_popdef([USEVAR])dnl
])
+
+
+# WM_FUNC_SECURE_GETENV
+# ---------------------
+#
+# Check if the function 'secure_getenv' is available
+# If found, defines HAVE_SECURE_GETENV
+AC_DEFUN_ONCE([WM_FUNC_SECURE_GETENV],
+[AC_REQUIRE([_WM_LIB_CHECK_FUNCTS])
+AC_CACHE_CHECK([for secure_getenv], [wm_cv_func_secure_getenv],
+ [wm_cv_func_secure_getenv=no
+ wm_save_CFLAGS="$CFLAGS"
+ for wm_arg in "% yes" "-D_GNU_SOURCE"; do
+ AS_IF([wm_fn_lib_try_compile "stdlib.h" "const char *h;" "h =
secure_getenv("HOME")" dnl
+ "`echo "$wm_arg" | sed -e 's, *%.*$,,' `
-Werror=implicit-function-declaration"],
+ [wm_cv_func_secure_getenv="`echo "$wm_arg" | sed -e 's,^.*% *,,'
`"
+ break])
+ done
+ CFLAGS="$wm_save_CFLAGS"])
+AS_IF([test "x$wm_cv_func_secure_getenv" != "xno"],
+ [AS_IF([test "x$wm_cv_func_secure_getenv" != "xyes"],
+ [WM_APPEND_ONCE([$wm_cv_func_secure_getenv], [CPPFLAGS])])
+ AC_DEFINE([HAVE_SECURE_GETENV], [1],
+ [defined when GNU's secure_getenv function is available])])
+])
http://repo.or.cz/w/wmaker-crm.git/commit/f66d16958bd6c0dd7e9fb75d58a70578acadb27c
commit f66d16958bd6c0dd7e9fb75d58a70578acadb27c
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:42 2014 +0200
WUtil: fix type used in sizeof in function wtokensplit (Coverity #50208 +
#50209)
As pointed by Coverity, the type used to calculate the size to allocate was
not the right one. It now gets the compiler to deduce it from the variable
for which the memory is allocated.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/string.c b/WINGs/string.c
index 5ec333e2..a48d8d7f 100644
--- a/WINGs/string.c
+++ b/WINGs/string.c
@@ -103,9 +103,9 @@ void wtokensplit(char *command, char ***argv, int *argc)
token = wtokennext(line, &line);
if (token) {
if (count == 0)
- *argv = wmalloc(sizeof(char **));
+ *argv = wmalloc(sizeof(**argv));
else
- *argv = wrealloc(*argv, (count + 1) *
sizeof(char **));
+ *argv = wrealloc(*argv, (count + 1) *
sizeof(**argv));
(*argv)[count++] = token;
}
} while (token != NULL && line != NULL);
http://repo.or.cz/w/wmaker-crm.git/commit/e2fdf5723288a6eed7bcc21bc9ba4b0e2a009538
commit e2fdf5723288a6eed7bcc21bc9ba4b0e2a009538
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:41 2014 +0200
WUtil: remove unnecessary check in WMGetStandardUserDefaults (Coverity
#50191)
As pointed by Coverity, the return value of the function
'wdefaultspathfordomain'
cannot be NULL, so it is not necessary to check for that.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/userdefaults.c b/WINGs/userdefaults.c
index 6b55e8cf..269e43e6 100644
--- a/WINGs/userdefaults.c
+++ b/WINGs/userdefaults.c
@@ -303,8 +303,7 @@ WMUserDefaults *WMGetStandardUserDefaults(void)
if (!domain)
domain = WMCreatePLDictionary(NULL, NULL);
- if (path)
- wfree(path);
+ wfree(path);
defaults->appDomain = domain;
http://repo.or.cz/w/wmaker-crm.git/commit/b7ff8e4026ebb2238825dff5e887e7a1f022b3d2
commit b7ff8e4026ebb2238825dff5e887e7a1f022b3d2
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:40 2014 +0200
WUtil: fixed possible problem in wcopy_file (Coverity #50141)
As pointed by Coverity, the macro RETRY does not behave as expected, as it
assumes that errno is cleared on successful 'fopen' call which is not the
case.
This patch removes the uses of the macro RETRY:
- fopen: with the appropriate check
- fread/fwrite: nothing because they do not set errno
- fclose: nothing because retrying is not recommended
and took the opportunity to add a little bit more information in the error
messages.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/findfile.c b/WINGs/findfile.c
index 048731ec..ea7980b8 100644
--- a/WINGs/findfile.c
+++ b/WINGs/findfile.c
@@ -36,7 +36,6 @@
#define PATH_MAX 1024
#endif
-#define RETRY( x ) do { x; } while (errno == EINTR);
char *wgethomedir()
{
@@ -431,27 +430,31 @@ int wcopy_file(const char *dir, const char *src_file,
const char *dest_file)
if (stat(src_file, &st) != 0 || !S_ISREG(st.st_mode))
return -1;
- RETRY( src = fopen(src_file, "rb") )
+ do {
+ src = fopen(src_file, "rb");
+ } while ((src == NULL) && (errno == EINTR));
if (src == NULL) {
- werror(_("Could not open %s"), src_file);
+ werror(_("Could not open input file "%s""), src_file);
return -1;
}
dstpath = wstrconcat(dir, dest_file);
- RETRY( dst = fopen(dstpath, "wb") )
+ do {
+ dst = fopen(dstpath, "wb");
+ } while ((dst == NULL) && (errno == EINTR));
if (dst == NULL) {
- werror(_("Could not create %s"), dstpath);
+ werror(_("Could not create target file "%s""), dstpath);
wfree(dstpath);
- RETRY( fclose(src) )
+ fclose(src);
return -1;
}
do {
- RETRY( nread = fread(buf, 1, sizeof(buf), src) )
+ nread = fread(buf, 1, sizeof(buf), src);
if (ferror(src))
break;
- RETRY( nwritten = fwrite(buf, 1, nread, dst) )
+ nwritten = fwrite(buf, 1, nread, dst);
if (ferror(dst) || feof(src) || nread != nwritten)
break;
@@ -460,10 +463,11 @@ int wcopy_file(const char *dir, const char *src_file,
const char *dest_file)
if (ferror(src) || ferror(dst))
unlink(dstpath);
- RETRY( fclose(src) )
+ fclose(src);
fchmod(fileno(dst), st.st_mode);
fsync(fileno(dst));
- RETRY( fclose(dst) )
+ if (fclose(dst))
+ wwarning("error occured during fclose("%s")", dstpath);
wfree(dstpath);
return 0;
http://repo.or.cz/w/wmaker-crm.git/commit/44f3f78ef6cf538f79fc058c89e13ae90a048061
commit 44f3f78ef6cf538f79fc058c89e13ae90a048061
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:39 2014 +0200
WUtil: remove unnecessary check in wstrappend (Coverity #50138)
The function wrealloc never fails, and allocates enough storage to store
the resulting string, so it is useless to check if strcat failed.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/string.c b/WINGs/string.c
index 182d377e..5ec333e2 100644
--- a/WINGs/string.c
+++ b/WINGs/string.c
@@ -235,8 +235,7 @@ char *wstrappend(char *dst, const char *src)
slen = strlen(dst) + strlen(src) + 1;
dst = wrealloc(dst, slen);
- if (wstrlcat(dst, src, slen) >= slen)
- return NULL;
+ strcat(dst, src);
return dst;
}
http://repo.or.cz/w/wmaker-crm.git/commit/8b79bda49a93e3402d8b77d0de4f32f438b409b6
commit 8b79bda49a93e3402d8b77d0de4f32f438b409b6
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:38 2014 +0200
WUtil: make sure wmalloc/wrealloc won't fail because of abort handler
As pointed by Coverity (#50074), despite the expected behaviour that
'wmalloc' should never return NULL, it may still happen if an abort handler
set by user (with wsetabort) does not call exit() as expected. In such
case we call exit ourself to be sure not to return NULL.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/memory.c b/WINGs/memory.c
index 7f4f0a85..81476e45 100644
--- a/WINGs/memory.c
+++ b/WINGs/memory.c
@@ -30,6 +30,10 @@
#include <assert.h>
#include <signal.h>
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
#ifdef USE_BOEHM_GC
#ifndef GC_DEBUG
#define GC_DEBUG
@@ -54,7 +58,11 @@ static void defaultHandler(int bla)
static waborthandler *aborthandler = defaultHandler;
-#define wAbort(a) (*aborthandler)(a)
+static inline noreturn void wAbort(int bla)
+{
+ (*aborthandler)(bla);
+ exit(-1);
+}
waborthandler *wsetabort(waborthandler * handler)
{
http://repo.or.cz/w/wmaker-crm.git/commit/e5a43d6691c0e629402d87a4612abd50555cd5e5
commit e5a43d6691c0e629402d87a4612abd50555cd5e5
Author: Christophe CURIS <[email protected]>
Date: Sun May 18 00:56:37 2014 +0200
WUtil: fix posible crash in 'wgethomedir' (Coverity #50070)
As pointed by Coverity, if the user does not a an entry in the password
file then the function would assume its home path to be "/" but still
continue and later try to check for user->pw_dir which would dereference
the NULL pointer.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/findfile.c b/WINGs/findfile.c
index 42845d03..048731ec 100644
--- a/WINGs/findfile.c
+++ b/WINGs/findfile.c
@@ -57,6 +57,7 @@ char *wgethomedir()
if (!user) {
werror(_("could not get password entry for UID %i"), getuid());
home = "/";
+ return home;
}
if (!user->pw_dir)
-----------------------------------------------------------------------
Summary of changes:
WINGs/WINGs/WUtil.h | 33 +++++++--------------------------
WINGs/findfile.c | 38 +++++++++++++++++++++++++-------------
WINGs/memory.c | 10 +++++++++-
WINGs/string.c | 7 +++----
WINGs/userdefaults.c | 7 +++++--
configure.ac | 1 +
m4/windowmaker.m4 | 25 +++++++++++++++++++++++++
src/icon.c | 18 +++++++++---------
8 files changed, 84 insertions(+), 55 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].