[PATCH] for clearenv

Günther Deschner gd at samba.org
Fri Apr 29 11:30:49 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Volker,

This code won't compile in the non-clearenv case with:

../source3/client/smbspool_krb5_wrapper.c: In function ‘main’:
../source3/client/smbspool_krb5_wrapper.c:202:2: error: ISO C90
forbids mixed declarations and code [-Werror=declaration-after-statement
]
  extern char **environ;
  ^
../source3/client/smbspool_krb5_wrapper.c:203:12: error:
‘__ERROR_DONT_USE_CALLOC_DIRECTLY’ undeclared (first use in this functio
n)
  environ = calloc(1, sizeof(*environ));

Maybe we add something like the attached fix ?

Thanks,
Guenther


On 28/04/16 12:57, Volker Lendecke wrote:
> Hi!
> 
> Attached find your patch from bug 11864 with my reviewed-by. To 
> complete the bureaucracy, I've added your Signed-off-by.
> 
> Jeremy, feel free to push :-)
> 
> Volker
> 
> P.S: Isn't this something we might want in libreplace?
> 


- -- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlcjReEACgkQSOk3aI7hFojAxACfRjs9OMFv3n3Go/izFDf4zFsi
8usAoIh89tsxlJNj1JvmHjKjOEZKzNiS
=2rY+
-----END PGP SIGNATURE-----
-------------- next part --------------
From f223884877b3db7d2e3125c27ab50c8da7abfe7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 29 Apr 2016 13:28:42 +0200
Subject: [PATCH] s3:client:smbspool_krb5_wrapper: fix the non clearenv build.

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source3/client/smbspool_krb5_wrapper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c
index 89db5e0..d26a7a6 100644
--- a/source3/client/smbspool_krb5_wrapper.c
+++ b/source3/client/smbspool_krb5_wrapper.c
@@ -31,6 +31,8 @@
 
 #include "dynconfig/dynconfig.h"
 
+#undef calloc
+
 enum cups_smb_dbglvl_e {
 	CUPS_SMB_LOG_DEBUG = 0,
 	CUPS_SMB_LOG_ERROR,
@@ -199,8 +201,10 @@ int main(int argc, char *argv[])
 #ifdef HAVE_CLEARENV
 	clearenv();
 #else
-	extern char **environ;
-	environ = calloc(1, sizeof(*environ));
+	{
+		extern char **environ;
+		environ = calloc(1, sizeof(*environ));
+	}
 #endif
 
 	CUPS_SMB_DEBUG("Setting KRB5CCNAME to '%s'", gen_cc);
-- 
2.5.5



More information about the samba-technical mailing list