CVS commit: src/lib/libc/ssp

2010-01-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jan 17 23:13:32 UTC 2010

Modified Files:
src/lib/libc/ssp: gets_chk.c

Log Message:
Free malloc()ed buffer in error case. Found by cppcheck.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/ssp/gets_chk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/ssp

2023-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 15 03:15:28 UTC 2023

Modified Files:
src/lib/libc/ssp: Makefile.inc
Added Files:
src/lib/libc/ssp: ssp_redirect.c

Log Message:
provide materialized functions for the ssp overriden inlines


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/ssp/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/ssp/ssp_redirect.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/ssp

2023-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 15 03:15:28 UTC 2023

Modified Files:
src/lib/libc/ssp: Makefile.inc
Added Files:
src/lib/libc/ssp: ssp_redirect.c

Log Message:
provide materialized functions for the ssp overriden inlines


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/ssp/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/ssp/ssp_redirect.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/ssp/Makefile.inc
diff -u src/lib/libc/ssp/Makefile.inc:1.5 src/lib/libc/ssp/Makefile.inc:1.6
--- src/lib/libc/ssp/Makefile.inc:1.5	Sun Apr  6 15:29:37 2014
+++ src/lib/libc/ssp/Makefile.inc	Tue Nov 14 22:15:28 2023
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile.inc,v 1.5 2014/04/06 19:29:37 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2023/11/15 03:15:28 christos Exp $
 
 .PATH: ${.CURDIR}/ssp
 
 SSP_SRCS=	gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
 		snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \
 		strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \
-		vsnprintf_chk.c vsprintf_chk.c
+		vsnprintf_chk.c vsprintf_chk.c ssp_redirect.c
 
 .for i in ${SSP_SRCS}
 SRCS+=${i}

Added files:

Index: src/lib/libc/ssp/ssp_redirect.c
diff -u /dev/null src/lib/libc/ssp/ssp_redirect.c:1.1
--- /dev/null	Tue Nov 14 22:15:28 2023
+++ src/lib/libc/ssp/ssp_redirect.c	Tue Nov 14 22:15:28 2023
@@ -0,0 +1,56 @@
+/*	$NetBSD: ssp_redirect.c,v 1.1 2023/11/15 03:15:28 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2023 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#undef _FORTIFY_SOURCE
+#define _FORTIFY_SOURCE 2
+#define __ssp_inline
+
+#include 
+__RCSID("$NetBSD: ssp_redirect.c,v 1.1 2023/11/15 03:15:28 christos Exp $");
+
+#include 
+
+int ssp_use(void);
+
+/*
+ * Provide definitions of the redirect functions in libc.
+ */
+int
+ssp_use(void)
+{
+	if (getcwd(NULL, 0) == NULL)
+		return -1;
+	if (read(-1, NULL, 0) == -1)
+		return -1;
+	if (readlink(NULL, NULL, 0) == -1)
+		return -1;
+	return 0;
+}



CVS commit: src/lib/libc/ssp

2023-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 15 03:35:04 UTC 2023

Modified Files:
src/lib/libc/ssp: ssp_redirect.c

Log Message:
don't expose extra symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/ssp/ssp_redirect.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/ssp

2023-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 15 03:35:04 UTC 2023

Modified Files:
src/lib/libc/ssp: ssp_redirect.c

Log Message:
don't expose extra symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/ssp/ssp_redirect.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/ssp/ssp_redirect.c
diff -u src/lib/libc/ssp/ssp_redirect.c:1.1 src/lib/libc/ssp/ssp_redirect.c:1.2
--- src/lib/libc/ssp/ssp_redirect.c:1.1	Tue Nov 14 22:15:28 2023
+++ src/lib/libc/ssp/ssp_redirect.c	Tue Nov 14 22:35:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssp_redirect.c,v 1.1 2023/11/15 03:15:28 christos Exp $	*/
+/*	$NetBSD: ssp_redirect.c,v 1.2 2023/11/15 03:35:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -34,17 +34,16 @@
 #define __ssp_inline
 
 #include 
-__RCSID("$NetBSD: ssp_redirect.c,v 1.1 2023/11/15 03:15:28 christos Exp $");
+__RCSID("$NetBSD: ssp_redirect.c,v 1.2 2023/11/15 03:35:04 christos Exp $");
 
 #include 
 
-int ssp_use(void);
 
 /*
  * Provide definitions of the redirect functions in libc.
  */
-int
-ssp_use(void)
+static int __used
+__ssp_use(void)
 {
 	if (getcwd(NULL, 0) == NULL)
 		return -1;



Re: CVS commit: src/lib/libc/ssp

2023-11-14 Thread Jörg Sonnenberger
On Wednesday, November 15, 2023 4:15:28 AM CET you wrote:
> Module Name:  src
> Committed By: christos
> Date: Wed Nov 15 03:15:28 UTC 2023
> 
> Modified Files:
>   src/lib/libc/ssp: Makefile.inc
> Added Files:
>   src/lib/libc/ssp: ssp_redirect.c
> 
> Log Message:
> provide materialized functions for the ssp overriden inlines

The functions are supposed to be transparent and they used to be. Can we 
please just go back to the working state before? IMO wanting to overriding 
getcwd is absolutely no justification for this. If the prototype (and inline 
function) is visible from the header, userland should *not* be abled to 
interpose it. If it is not visible due to standard headers, there was no 
problem in first place.

Joerg