free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
break;
case 'b':
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
argc--;
argv++;
}
if (!ldapServer)
- ldapServer = strdup("localhost");
+ ldapServer = xstrdup("localhost");
if (!basedn) {
fprintf(stderr, "Usage: " PROGRAM_NAME " -b basedn [options] [ldap_server_name[:port]]...\n\n");
-
/*
* usersfile.c
* (C) 2000 Antonino Iannella, Stellar-X Pty Ltd
* The code originated from denyusers.c.
*/
+#define SQUID_NO_ALLOC_PROTECT 1
+#include "config.h"
+#include "util.h"
+
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
} else {
if (uf->path)
free(uf->path);
- uf->path = strdup(path);
+ uf->path = xstrdup(path);
}
/* Open the users file. Report any errors. */
'\0',
(uf->Alloc >> 1) * sizeof(*uf->names));
}
- uf->names[uf->Inuse] = strdup(buf);
+ uf->names[uf->Inuse] = xstrdup(buf);
uf->Inuse++;
}
fclose(fp);
* Compile this program with: gcc -o basic_pam_auth basic_pam_auth.cc -lpam -ldl
*/
#define SQUID_NO_ALLOC_PROTECT 1
-#define SQUID_NO_STRING_BUFFER_PROTECT 1
#include "config.h"
#include "rfc1738.h"
#if HAVE_ASSERT_H
#include <assert.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
fprintf(stderr, "ERROR: Out of memory!\n");
return PAM_CONV_ERR;
}
- (*resp)[0].resp = strdup((char *) appdata_ptr);
+ (*resp)[0].resp = xstrdup((char *) appdata_ptr);
(*resp)[0].resp_retcode = 0;
return ((*resp)[0].resp ? PAM_SUCCESS : PAM_CONV_ERR);
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*/
+#define SQUID_NO_ALLOC_PROTECT 1
#include "config.h"
#include "rfc1738.h"
#include "util.h"
#if HAVE_STDIO_H
#include <stdio.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
}
if (strcmp(argv[i], "-S") == 0) {
if (lastdom != NULL) {
- if ((lastdom->authshare = strdup(argv[++i])) == NULL)
+ if ((lastdom->authshare = xstrdup(argv[++i])) == NULL)
return 1;
/* convert backslashes to forward slashes */
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
+#define SQUID_NO_ALLOC_PROTECT 1
+#include "config.h"
#include "digest_common.h"
* ldap_backend.c
* AUTHOR: Flavio Pescuma, MARA Systems AB <flavio@marasystems.com>
*/
+#define SQUID_NO_ALLOC_PROTECT 1
+#include "config.h"
#define LDAP_DEPRECATED 1
}
}
} else if (userdnattr) {
- sprintf(searchbase, "%s=%s, %s", userdnattr, login, userbasedn);
+ snprintf(searchbase, 8192, "%s=%s, %s", userdnattr, login, userbasedn);
retrydnattr:
if (debug)
if (debug)
printf("password: %s\n", password);
if (password)
- password = strdup(password);
+ password = xstrdup(password);
if (edir_universal_passwd) {
free(values);
free(universal_password);
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
break;
case 'A':
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
argc--;
argv++;
if ((e = strrchr(buf, '\r')))
*e = 0;
- bindpasswd = strdup(buf);
+ bindpasswd = xstrdup(buf);
if (!bindpasswd) {
fprintf(stderr, PROGRAM_NAME " ERROR: can not allocate memory\n");
}
* ldap_backend.c
* AUTHOR: Flavio Pescuma, MARA Systems AB <flavio@marasystems.com>
*/
+#define SQUID_NO_ALLOC_PROTECT 1
+#include "config.h"
+#include "util.h"
#define LDAP_DEPRECATED 1
}
}
} else if (userdnattr) {
- sprintf(searchbase, "%s=%s, %s", userdnattr, login, userbasedn);
+ snprintf(searchbase, 8192, "%s=%s, %s", userdnattr, login, userbasedn);
retrydnattr:
if (debug)
if (debug)
printf("password: %s\n", password);
if (password)
- password = strdup(password);
+ password = xstrdup(password);
ldap_value_free(values);
ldap_msgfree(res);
return password;
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
break;
case 'A':
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
argc--;
argv++;
if ((e = strrchr(buf, '\r')))
*e = 0;
- bindpasswd = strdup(buf);
+ bindpasswd = xstrdup(buf);
if (!bindpasswd) {
fprintf(stderr, PROGRAM_NAME " ERROR: can not allocate memory\n");
}
* as published by the Free Software Foundation; either version 2,
* or (at your option) any later version.
*/
+#define SQUID_NO_ALLOC_PROTECT 1
+#include "config.h"
#define LDAP_DEPRECATED 1
#include <stdio.h>
#include <string.h>
-#include <stdlib.h>
#include <ctype.h>
#ifdef _SQUID_MSWIN_ /* Native Windows port and MinGW */
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
break;
case 'b':
free(ldapServer);
ldapServer = newhost;
} else {
- ldapServer = strdup(value);
+ ldapServer = xstrdup(value);
}
argc--;
argv++;
} else if (userdnattr) {
char dn[8192];
if (extension_dn && *extension_dn)
- sprintf(dn, "%s=%s, %s, %s", userdnattr, login, extension_dn, userbasedn ? userbasedn : basedn);
+ snprintf(dn, 8192, "%s=%s, %s, %s", userdnattr, login, extension_dn, userbasedn ? userbasedn : basedn);
else
- sprintf(dn, "%s=%s, %s", userdnattr, login, userbasedn ? userbasedn : basedn);
+ snprintf(dn, 8192, "%s=%s, %s", userdnattr, login, userbasedn ? userbasedn : basedn);
return searchLDAPGroup(ld, group, dn, extension_dn);
} else {
return searchLDAPGroup(ld, group, login, extension_dn);
if ((e = strrchr(buf, '\r')))
*e = 0;
- bindpasswd = strdup(buf);
+ bindpasswd = xstrdup(buf);
if (!bindpasswd) {
fprintf(stderr, PROGRAM_NAME " ERROR: can not allocate memory\n");
}