--- /dev/null
+; Sets emacs variables based on mode.
+; A list of (major-mode . ((var1 . value1) (var2 . value2)))
+; Mode can be nil, which gives default values.
+
+((nil . ((indent-tabs-mode . nil)
+ (tab-width . 8)))
+)
%.pc: %.pc.in
$(AM_V_GEN)sed -e 's,@prefix\@,$(prefix),g' \
-e 's,@libdir\@,$(libdir),g' \
+ -e 's,@HOWL_COMPAT_VERSION\@,$(HOWL_COMPAT_VERSION),g' \
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
pkgconfig_DATA = avahi-core.pc
n->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
n->nlmsg_type = RTM_GETLINK;
n->nlmsg_seq = seq;
- n->nlmsg_flags = NLM_F_MATCH|NLM_F_REQUEST|NLM_F_ACK;
+ n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
n->nlmsg_pid = 0;
ifi = NLMSG_DATA(n);
DBUS_TYPE_INT32, &i_protocol,
DBUS_TYPE_STRING, &domain,
DBUS_TYPE_INT32, &bt,
- DBUS_TYPE_UINT32, &flags,
+ DBUS_TYPE_UINT32, &u_flags,
DBUS_TYPE_INVALID))) {
avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
goto fail;
dbus_error_free (&error);
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-
/* done */;
else
{
- const char *last;
-
- last = p;
if ((*(const unsigned char *)p & 0xe0) == 0xc0) /* 110xxxxx */
{
if ( ((*(const unsigned char *)p & 0x1e) == 0))
avahi_s_record_browser_free(r);
avahi_s_host_name_resolver_free(hnr);
avahi_s_address_resolver_free(ar);
+ avahi_s_domain_browser_free(db);
avahi_s_service_type_browser_free(stb);
avahi_s_service_browser_free(sb);
avahi_s_service_resolver_free(sr);
n = (struct nlmsghdr*) req;
n->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));
n->nlmsg_type = type;
- n->nlmsg_flags = NLM_F_ROOT|NLM_F_REQUEST;
+ n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
n->nlmsg_pid = 0;
gen = NLMSG_DATA(n);
AvahiInterface *i;
struct rtattr *a = NULL;
size_t l;
- AvahiAddress raddr;
- int raddr_valid = 0;
+ AvahiAddress raddr, rlocal, *r;
+ int raddr_valid = 0, rlocal_valid = 0;
/* We are only interested in IPv4 and IPv6 */
if (ifaddrmsg->ifa_family != AF_INET && ifaddrmsg->ifa_family != AF_INET6)
return;
/* Fill in address family for our new address */
- raddr.proto = avahi_af_to_proto(ifaddrmsg->ifa_family);
+ rlocal.proto = raddr.proto = avahi_af_to_proto(ifaddrmsg->ifa_family);
l = NLMSG_PAYLOAD(n, sizeof(struct ifaddrmsg));
a = IFA_RTA(ifaddrmsg);
while (RTA_OK(a, l)) {
switch(a->rta_type) {
+
case IFA_ADDRESS:
- /* Fill in address data */
+
+ if ((rlocal.proto == AVAHI_PROTO_INET6 && RTA_PAYLOAD(a) != 16) ||
+ (rlocal.proto == AVAHI_PROTO_INET && RTA_PAYLOAD(a) != 4))
+ return;
+
+ memcpy(rlocal.data.data, RTA_DATA(a), RTA_PAYLOAD(a));
+ rlocal_valid = 1;
+
+ break;
+
+ case IFA_LOCAL:
+
+ /* Fill in local address data. Usually this is
+ * preferable over IFA_ADDRESS if both are set,
+ * since this refers to the local address of a PPP
+ * link while IFA_ADDRESS refers to the other
+ * end. */
if ((raddr.proto == AVAHI_PROTO_INET6 && RTA_PAYLOAD(a) != 16) ||
(raddr.proto == AVAHI_PROTO_INET && RTA_PAYLOAD(a) != 4))
}
/* If there was no adress attached to this message, let's quit. */
- if (!raddr_valid)
+ if (rlocal_valid)
+ r = &rlocal;
+ else if (raddr_valid)
+ r = &raddr;
+ else
return;
if (n->nlmsg_type == RTM_NEWADDR) {
AvahiInterfaceAddress *addr;
/* This address is new or has been modified, so let's get an object for it */
- if (!(addr = avahi_interface_monitor_get_address(m, i, &raddr)))
+ if (!(addr = avahi_interface_monitor_get_address(m, i, r)))
/* Mmm, no object existing yet, so let's create a new one */
- if (!(addr = avahi_interface_address_new(m, i, &raddr, ifaddrmsg->ifa_prefixlen)))
+ if (!(addr = avahi_interface_address_new(m, i, r, ifaddrmsg->ifa_prefixlen)))
return; /* OOM */
/* Update the scope field for the address */
assert(n->nlmsg_type == RTM_DELADDR);
/* Try to get a reference to our AvahiInterfaceAddress object for this address */
- if (!(addr = avahi_interface_monitor_get_address(m, i, &raddr)))
+ if (!(addr = avahi_interface_monitor_get_address(m, i, r)))
return;
/* And free it */
static void* reflect_cache_walk_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void* userdata) {
AvahiServer *s = userdata;
+ AvahiRecord* r;
assert(c);
assert(pattern);
assert(e);
assert(s);
+ /* Don't reflect cache entry with ipv6 link-local addresses. */
+ r = e->record;
+ if ((r->key->type == AVAHI_DNS_TYPE_AAAA) &&
+ (r->data.aaaa.address.address[0] == 0xFE) &&
+ (r->data.aaaa.address.address[1] == 0x80))
+ return NULL;
+
avahi_record_list_push(s->record_list, e->record, e->cache_flush, 0, 0);
return NULL;
}
goto fail;
}
- /* For corrupt packets FIONREAD returns zero size (See rhbz #607297) */
- if (!ms)
- goto fail;
-
p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE);
io.iov_base = AVAHI_DNS_PACKET_DATA(p);
goto fail;
}
- if (sa.sin_addr.s_addr == INADDR_ANY) {
+ /* For corrupt packets FIONREAD returns zero size (See rhbz #607297). So
+ * fail after having read them. */
+ if (!ms)
+ goto fail;
+
+ if (sa.sin_addr.s_addr == INADDR_ANY)
/* Linux 2.4 behaves very strangely sometimes! */
goto fail;
- }
assert(!(msg.msg_flags & MSG_CTRUNC));
assert(!(msg.msg_flags & MSG_TRUNC));
goto fail;
}
- /* For corrupt packets FIONREAD returns zero size (See rhbz #607297) */
- if (!ms)
- goto fail;
-
p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE);
io.iov_base = AVAHI_DNS_PACKET_DATA(p);
goto fail;
}
+ /* For corrupt packets FIONREAD returns zero size (See rhbz #607297). So
+ * fail after having read them. */
+ if (!ms)
+ goto fail;
+
assert(!(msg.msg_flags & MSG_CTRUNC));
assert(!(msg.msg_flags & MSG_TRUNC));
return -1;
}
- if (write(helper_fd, &command, sizeof(command)) < 0) {
+ if (write(helper_fd, &command, sizeof(command)) < 0 &&
+ (errno != EPIPE && errno != ECONNRESET)) {
avahi_log_error("write() failed: %s\n", strerror(errno));
return -1;
}
- if ((r = read(helper_fd, &c, sizeof(c))) < 0) {
+ if ((r = read(helper_fd, &c, sizeof(c))) < 0 &&
+ (errno != EPIPE && errno != ECONNRESET)) {
avahi_log_error("read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
return -1;
}
server->reconnect_timeout = server->poll_api->timeout_new(server->poll_api, &tv, reconnect_callback, NULL);
} else {
avahi_log_warn("Disconnected from D-Bus, exiting.");
- raise(SIGQUIT);
+ raise(SIGTERM);
}
return DBUS_HANDLER_RESULT_HANDLED;
switch (sig) {
case SIGINT:
- case SIGQUIT:
case SIGTERM:
avahi_log_info(
"Got %s, quitting.",
- sig == SIGINT ? "SIGINT" :
- (sig == SIGQUIT ? "SIGQUIT" : "SIGTERM"));
+ sig == SIGINT ? "SIGINT" : "SIGTERM");
avahi_simple_poll_quit(simple_poll_api);
break;
poll_api = avahi_simple_poll_get(simple_poll_api);
- if (daemon_signal_init(SIGINT, SIGQUIT, SIGHUP, SIGTERM, SIGUSR1, 0) < 0) {
+ if (daemon_signal_init(SIGINT, SIGHUP, SIGTERM, SIGUSR1, 0) < 0) {
avahi_log_error("Could not register signal handlers (%s).", strerror(errno));
goto finish;
}
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
+#include <stddef.h>
#include "sd-daemon.h"
if (length <= 0)
/* Unnamed socket */
- return l == sizeof(sa_family_t);
+ return l == offsetof(struct sockaddr_un, sun_path);
if (path[0])
/* Normal path socket */
return
- (l >= sizeof(sa_family_t) + length + 1) &&
+ (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) &&
memcmp(path, sockaddr.un.sun_path, length+1) == 0;
else
/* Abstract namespace socket */
return
- (l == sizeof(sa_family_t) + length) &&
+ (l == offsetof(struct sockaddr_un, sun_path) + length) &&
memcmp(path, sockaddr.un.sun_path, length) == 0;
}
memset(&msghdr, 0, sizeof(msghdr));
msghdr.msg_name = &sockaddr;
- msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e);
+ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);
if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
msghdr.msg_namelen = sizeof(struct sockaddr_un);
return a.st_dev != b.st_dev;
#endif
}
-
-static int touch(const char *path) {
-
-#if !defined(DISABLE_SYSTEMD) && defined(__linux__)
- int fd;
-
- mkdir("/dev/.systemd", 0755);
- mkdir("/dev/.systemd/readahead", 0755);
-
- if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666)) < 0)
- return -errno;
-
- for (;;) {
- if (close(fd) >= 0)
- break;
-
- if (errno != -EINTR)
- return -errno;
- }
-
-#endif
- return 0;
-}
-
-int sd_readahead(const char *action) {
-
- if (!action)
- return -EINVAL;
-
- if (strcmp(action, "cancel") == 0)
- return touch("/dev/.systemd/readahead/cancel");
- else if (strcmp(action, "done") == 0)
- return touch("/dev/.systemd/readahead/done");
- else if (strcmp(action, "noreplay") == 0)
- return touch("/dev/.systemd/readahead/noreplay");
-
- return -EINVAL;
-}
See sd-daemon(7) for more information.
*/
+#ifndef _sd_printf_attr_
#if __GNUC__ >= 4
#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
#else
#define _sd_printf_attr_(a,b)
#endif
+#endif
+#ifndef _sd_hidden_
#if (__GNUC__ >= 4) && !defined(SD_EXPORT_SYMBOLS)
#define _sd_hidden_ __attribute__ ((visibility("hidden")))
#else
#define _sd_hidden_
#endif
+#endif
/*
Log levels for usage on stderr:
READY=1 Tells systemd that daemon startup is finished (only
relevant for services of Type=notify). The passed
argument is a boolean "1" or "0". Since there is
- little value in signalling non-readiness the only
+ little value in signaling non-readiness the only
value daemons should send is "READY=1".
STATUS=... Passes a single-line status string back to systemd
fork off the process itself. Example: "MAINPID=4711"
Daemons can choose to send additional variables. However, it is
- recommened to prefix variable names not listed above with X_.
+ recommended to prefix variable names not listed above with X_.
Returns a negative errno-style error code on failure. Returns > 0
if systemd could be notified, 0 if it couldn't possibly because
fine. You should NOT protect them with a call to this function. Also
note that this function checks whether the system, not the user
session is controlled by systemd. However the functions above work
- for both session and system services.
+ for both user and system services.
See sd_booted(3) for more information.
*/
int sd_booted(void) _sd_hidden_;
-/*
- Controls ongoing disk read-ahead operations during boot-up. The argument
- must be a string, and either "cancel", "done" or "noreplay".
-
- cancel = terminate read-ahead data collection, drop collected information
- done = terminate read-ahead data collection, keep collected information
- noreplay = terminate read-ahead replay
-*/
-int sd_readahead(const char *action);
-
#ifdef __cplusplus
}
#endif
va_end(ap);
setproctitle("-%s", t);
-#elif __linux__
+#elif defined(__linux__)
size_t l;
va_list ap;
if (n == 1) {
int r;
- if ((r = sd_is_socket(AF_LOCAL, SOCK_STREAM, 1, 0)) < 0) {
+ if ((r = sd_is_socket(SD_LISTEN_FDS_START, AF_LOCAL, SOCK_STREAM, 1)) < 0) {
avahi_log_warn("Passed systemd file descriptor is of wrong type: %s", strerror(-r));
goto fail;
}
[Service]
Type=simple
ExecStart=@sbindir@/avahi-dnsconfd -s
-ExecReload=@sbindir@/avahi-dnsconfd -r
[Install]
WantedBy=multi-user.target
}
}
-GaServiceBrowser *ga_service_browser_new(gchar * type) {
+GaServiceBrowser *ga_service_browser_new(const gchar * type) {
return ga_service_browser_new_full(AVAHI_IF_UNSPEC,
AVAHI_PROTO_UNSPEC, type, NULL, 0);
}
GaServiceBrowser *ga_service_browser_new_full(AvahiIfIndex interface,
AvahiProtocol protocol,
- gchar * type, gchar * domain,
+ const gchar * type, gchar * domain,
GaLookupFlags flags) {
return g_object_new(GA_TYPE_SERVICE_BROWSER,
"interface", interface,
#define GA_SERVICE_BROWSER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GA_TYPE_SERVICE_BROWSER, GaServiceBrowserClass))
-GaServiceBrowser *ga_service_browser_new(gchar * type);
+GaServiceBrowser *ga_service_browser_new(const gchar * type);
GaServiceBrowser *ga_service_browser_new_full(AvahiIfIndex interface,
AvahiProtocol protocol,
- gchar * type, gchar * domain,
+ const gchar * type, gchar * domain,
GaLookupFlags flags);
gboolean
def insert_row(self, model,parent,
content, name, interface,protocol,stype,domain):
myiter=model.insert_after(parent,None)
- model.set(myiter,0,content,1,name,2,interface,3,protocol,4,stype,5,domain)
+ model.set(myiter,0,content,1,name,2,str(interface),3,str(protocol),4,stype,5,domain)
return myiter
def new(self):
gtk_widget_set_sensitive(GTK_WIDGET(dialog), FALSE);
cursor = gdk_cursor_new(GDK_WATCH);
gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(dialog)), cursor);
- gdk_cursor_unref(cursor);
+ g_object_unref(G_OBJECT(cursor));
if (!(d->priv->resolver = avahi_service_resolver_new(
d->priv->client, interface, protocol, name, type, d->priv->domain,
# USA.
AC_PREREQ(2.63)
-AC_INIT([avahi],[0.6.28],[avahi (at) lists (dot) freedesktop (dot) org])
+AC_INIT([avahi],[0.6.29],[avahi (at) lists (dot) freedesktop (dot) org])
AC_CONFIG_SRCDIR([avahi-core/server.c])
AC_CONFIG_MACRO_DIR([common])
AC_CONFIG_HEADERS([config.h])
AC_SUBST(PACKAGE_URL, [http://avahi.org/])
AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [8:2:5])
-AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [7:0:0])
+AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [7:1:0])
AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:8:2])
AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:2:0])
-AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:3:0])
+AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:4:0])
AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:2:0])
AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:2:0])
-AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:3:1])
+AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:4:1])
# Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
+Avahi 0.6.29
+============
+
+This is a bugfix release.
+
+ * Updates regarding systemd integration
+ * Compatibility with newer gtk3 and gobject introspection
+ * i18n updates
+ * Minor other updates
+ * Fix CVE-2011-1002, fixing the fix for CVE-2010-2244
+
+This release is backwards compatible with Avahi 0.6.x with x < 29.
+
Avahi 0.6.28
============
### BEGIN INIT INFO
# Provides: avahi
# Required-Start: $network $remote_fs dbus
+# Required-Stop: $network $remote_fs dbus
# Default-Start: 3 5
# Default-Stop:
# Short-Description: ZeroConf daemon
$AVAHI_BIN -k 2>/dev/null || /bin/true
rc_status -v
;;
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset
+ fi
+ rc_status
+ ;;
restart)
$0 stop
$0 start
rc_status -v
;;
*)
- echo "Usage: $0 {start|stop|status|restart|force-reload|reload}"
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
### BEGIN INIT INFO
# Provides: avahi-dnsconfd
# Required-Start: $remote_fs avahi
+# Required-Stop: $remote_fs avahi
# Default-Start: 3 5
# Default-Stop:
# Short-Description: ZeroConf daemon
$0 start
rc_status
;;
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset
+ fi
+ rc_status
+ ;;
force-reload|reload)
echo -n "Reloading Avahi DNS Configuration daemon "
$AVAHI_BIN -r
;;
status)
echo -n "Checking for Avahi DNS Configuration daemon: "
- $AVAHI_BIN -c
+ $AVAHI_BIN -c || _rc_status=3
rc_status -v
;;
*)
- echo "Usage: $0 {start|stop|status|restart|force-reload|reload}"
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
<option>
<p><opt>-r | --refresh</opt></p>
- <optdesc><p>Tell an already running avahi-autoipd to reannounce the acquired IP address on the specified network interface. (Equivalent to sending a SIGHUP)</p></optdesc>
+ <optdesc><p>Tell an already running avahi-autoipd to re-announce the acquired IP address on the specified network interface. (Equivalent to sending a SIGHUP)</p></optdesc>
</option>
<option>
<option>
<p><opt>-w | --wait</opt></p>
- <optdesc><p>Wait until a IP address has been sucessfully acquired before detaching. Only valid in combination with <opt>--daemonize</opt>.</p></optdesc>
+ <optdesc><p>Wait until a IP address has been successfully acquired before detaching. Only valid in combination with <opt>--daemonize</opt>.</p></optdesc>
</option>
<option>
</section>
<section name="Signals">
- <p><arg>SIGINT, SIGTERM, SIGQUIT</arg>: avahi-autoipd will shutdown. (Same as <opt>--kill</opt>)</p>
- <p><arg>SIGHUP</arg>: avahi-autoipd will reannounce the acquired IP address. (Same as <opt>--refresh</opt>)</p>
+ <p><arg>SIGINT, SIGTERM</arg>: avahi-autoipd will shutdown. (Same as <opt>--kill</opt>)</p>
+ <p><arg>SIGHUP</arg>: avahi-autoipd will re-announce the acquired IP address. (Same as <opt>--refresh</opt>)</p>
</section>
<section name="Authors">
<option>
<p><opt>argv[1]</opt> An event string: one of BIND, CONFLICT,
UNBIND or STOP. If BIND is passed an IP address has been
- sucessfully acquired and the script shall add it to the
+ successfully acquired and the script shall add it to the
network interface. If CONFLICT is passed avahi-autopid
detected a IP address on the local network, the action script
should remove the configured IP address. If UNBIND is passed
</section>
<section name="Signals">
- <p><arg>SIGINT, SIGTERM, SIGQUIT</arg>: avahi-daemon will shutdown. (Same as <opt>--kill</opt>).</p>
+ <p><arg>SIGINT, SIGTERM</arg>: avahi-daemon will shutdown. (Same as <opt>--kill</opt>).</p>
<p><arg>SIGHUP</arg>: avahi-daemon will reload unicast DNS
server data from <file>/etc/resolv.conf</file> and static
service definitions from <file>@servicedir@/</file>. (Same as <opt>--reload</opt>)</p>
</section>
<section name="Signals">
- <p><arg>SIGINT, SIGTERM, SIGQUIT</arg>: avahi-dnsconfd will shutdown. This is issued by passing --kill to avahi-daemon.</p>
+ <p><arg>SIGINT, SIGTERM</arg>: avahi-dnsconfd will shutdown. This is issued by passing --kill to avahi-daemon.</p>
<p><arg>SIGHUP</arg>: avahi-dnsconfd will refresh the DNS server data.</p>
</section>