~ubuntu-branches/ubuntu/trusty/ntp/trusty-proposed

« back to all changes in this revision

Viewing changes to include/ntp_malloc.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-04-03 07:21:01 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20130403072101-v3vt8xcs18b6uhjf
Tags: 1:4.2.6.p5+dfsg-2ubuntu1
* New upstream version, fixing build failure in raring.
* Merge with Debian; remaining changes:
  + debian/ntp.conf, debian/ntpdate.default: Change default server to
    ntp.ubuntu.com.
  + debian/ntpdate.ifup: Stop ntp before running ntpdate when an interface
    comes up, then start again afterwards.
  + debian/ntp.init, debian/rules: Only stop when entering single user mode.
  + Add enforcing AppArmor profile:
    - debian/control: Add Conflicts/Replaces on apparmor-profiles.
    - debian/control: Add Suggests on apparmor.
    - debian/ntp.dirs: Add apparmor directories.
    - debian/ntp.preinst: Force complain on certain upgrades.
    - debian/ntp.postinst: Reload apparmor profile.
    - debian/ntp.postrm: Remove the force-complain file.
    - add debian/apparmor-profile*.
    - debian/rules: install apparmor-profile and apparmor-profile.tunable.
    - debian/README.Debian: Add note on AppArmor.
  + debian/{control,rules}: Add and enable hardened build for PIE.
  + debian/apparmor-profile: Adjust location of drift files.
  + debian/rules, debian/ntp.dirs, debian/source_ntp.py: Add apport hook.
  + debian/ntpdate-debian: Disregard empty ntp.conf files.
  + debian/ntp.preinst: Remove empty /etc/ntp.conf on fresh intallation.
  + debian/ntpdate.ifup: Fix interaction with openntpd.
  + debian/source_ntp.py: Add filter on AppArmor profile names to prevent
    false positives from denials originating in other packages.
  + debian/apparmor-profile: Add samba4 ntp signing socket to ntpd apparmor
    profile.
  + debian/apparmor-profile: adjust for IPv6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#ifndef NTP_MALLOC_H
5
5
#define NTP_MALLOC_H
6
6
 
7
 
#ifdef HAVE_CONFIG_H
8
 
# include <config.h>
9
 
#endif
10
 
 
11
7
#ifdef HAVE_STDLIB_H
12
8
# include <stdlib.h>
13
9
#else
16
12
# endif
17
13
#endif
18
14
 
 
15
/*
 
16
 * Deal with platform differences declaring alloca()
 
17
 * This comes nearly verbatim from:
 
18
 *
 
19
 * http://www.gnu.org/software/autoconf/manual/autoconf.html#Particular-Functions
 
20
 *
 
21
 * The only modifications were to remove C++ support and guard against
 
22
 * redefining alloca.
 
23
 */
 
24
#ifdef HAVE_ALLOCA_H
 
25
# include <alloca.h>
 
26
#elif defined __GNUC__
 
27
# ifndef alloca
 
28
#  define alloca __builtin_alloca
 
29
# endif
 
30
#elif defined _AIX
 
31
# ifndef alloca
 
32
#  define alloca __alloca
 
33
# endif
 
34
#elif defined _MSC_VER
 
35
# include <malloc.h>
 
36
# ifndef alloca
 
37
#  define alloca _alloca
 
38
# endif
 
39
#else
 
40
# include <stddef.h>
 
41
void * alloca(size_t);
 
42
#endif
 
43
 
 
44
#ifdef EREALLOC_IMPL
 
45
# define EREALLOC_CALLSITE      /* preserve __FILE__ and __LINE__ */
 
46
#else
 
47
# define EREALLOC_IMPL(ptr, newsz, filenm, loc) \
 
48
         realloc(ptr, (newsz))
 
49
#endif
 
50
 
 
51
#ifdef HAVE_STRINGS_H
 
52
# include <strings.h>
 
53
# define zero_mem(p, s)         bzero(p, s)
 
54
#endif
 
55
 
 
56
#ifndef zero_mem
 
57
# define zero_mem(p, s)         memset(p, 0, s)
 
58
#endif
 
59
#define ZERO(var)               zero_mem(&(var), sizeof(var))
 
60
 
19
61
#endif  /* NTP_MALLOC_H */