From: Henrik Nordstrom Date: Mon, 1 Feb 2010 14:30:22 +0000 (+0100) Subject: basic_smb_auth is C++, adjust make flags accordingly. Also clean up string types... X-Git-Tag: SQUID_3_2_0_1~436 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4327acf14279b24327699bd7dcee1e2d41d85f7c;p=thirdparty%2Fsquid.git basic_smb_auth is C++, adjust make flags accordingly. Also clean up string types a bit to make g++ happier --- diff --git a/helpers/basic_auth/SMB/Makefile.am b/helpers/basic_auth/SMB/Makefile.am index e8f8685649..62d8c37262 100644 --- a/helpers/basic_auth/SMB/Makefile.am +++ b/helpers/basic_auth/SMB/Makefile.am @@ -15,7 +15,7 @@ libexec_SCRIPTS = $(SMB_AUTH_HELPER) libexec_PROGRAMS = basic_smb_auth basic_smb_auth_SOURCES= basic_smb_auth.cc -basic_smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" +basic_smb_auth_CXXFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" basic_smb_auth_LDADD = $(COMPAT_LIB) $(XTRA_LIBS) EXTRA_DIST = basic_smb_auth.sh COPYING-2.0 diff --git a/helpers/basic_auth/SMB/basic_smb_auth.cc b/helpers/basic_auth/SMB/basic_smb_auth.cc index 4ea3a3daeb..497ee52920 100644 --- a/helpers/basic_auth/SMB/basic_smb_auth.cc +++ b/helpers/basic_auth/SMB/basic_smb_auth.cc @@ -60,13 +60,13 @@ #define NMB_BROADCAST 2 struct SMBDOMAIN { - char *name; /* domain name */ - char *sname; /* match this with user input */ - char *passthrough; /* pass-through authentication */ - char *nmbaddr; /* name service address */ + const char *name; /* domain name */ + const char *sname; /* match this with user input */ + const char *passthrough; /* pass-through authentication */ + const char *nmbaddr; /* name service address */ int nmbcast; /* broadcast or unicast */ char *authshare; /* share name of auth file */ - char *authfile; /* pathname of auth file */ + const char *authfile; /* pathname of auth file */ struct SMBDOMAIN *next; /* linked list */ }; @@ -115,7 +115,7 @@ main(int argc, char *argv[]) char *domname; FILE *p; int debug = 0; - char *shcmd; + const char *shcmd; /* make standard output line buffered */ if (setvbuf(stdout, NULL, _IOLBF, 0) != 0) @@ -139,7 +139,7 @@ main(int argc, char *argv[]) dom->passthrough = ""; dom->nmbaddr = ""; dom->nmbcast = NMB_BROADCAST; - dom->authshare = "NETLOGON"; + dom->authshare = (char *)"NETLOGON"; dom->authfile = "proxyauth"; dom->next = NULL; @@ -202,7 +202,7 @@ main(int argc, char *argv[]) shcmd = debug ? HELPERSCRIPT : HELPERSCRIPT " > /dev/null 2>&1"; /* pass to helper script */ - if (putenv("SAMBAPREFIX=" SAMBAPREFIX) != 0) + if (putenv((char *)"SAMBAPREFIX=" SAMBAPREFIX) != 0) return 1; while (1) {