diff --git a/board/common/rootfs/etc/avahi/avahi-autoipd.action b/board/common/rootfs/etc/avahi/avahi-autoipd.action index 20912b82e..464748d12 100755 --- a/board/common/rootfs/etc/avahi/avahi-autoipd.action +++ b/board/common/rootfs/etc/avahi/avahi-autoipd.action @@ -9,46 +9,20 @@ # $3 IP adddress PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin" -NAME="/etc/frr/static.d/$2-zeroconf.conf" -NEXT="${NAME}+" log() { logger -I $$ -t zeroconf -p user.notice "$*" } -# Reduce changes needed by comparing with previous route(s) -act() -{ - case $1 in - add) - echo "! Generated by avahi-autoipd" > "$NEXT" - echo "ip route 0.0.0.0/0 $2 254" >> "$NEXT" - cmp -s "$NAME" "$NEXT" && return - mv "$NEXT" "$NAME" - ;; - del) - [ -f "$NAME" ] || return - rm "$NAME" - ;; - *) - return - ;; - esac - - initctl -nbq restart staticd -} - case "$1" in BIND) ip addr flush dev "$2" proto random ip addr add "$3"/16 brd 169.254.255.255 scope link dev "$2" proto random - act add "$2" log "set ipv4ll $3 on iface $2" ;; CONFLICT|UNBIND|STOP) - act del "$2" ip addr flush dev "$2" proto random log "clr ipv4ll on iface $2" ;; diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 356a94606..f8f66b153 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -12,9 +12,13 @@ All notable changes to the project are documented in this file. - YANG type for SSH private/public keys has changed, from ietf-crypto-types to infix-crypto-types - Add support for link aggregation (lag), static (balance-xor) and LACP + - Drop automatic default route (interface route) for IPv4 autoconf, not + necessary and causes more confusion than good. Issue #923 ### Fixes - - N/A + - Fix #956: CLI `copy` command complains it cannot change owner when + copying `factory-config` to `running-config`. Bogus error, the + latter is not really a file [v25.01.0][] - 2025-01-31 diff --git a/src/bin/copy.c b/src/bin/copy.c index c16368d6d..1649c28c8 100644 --- a/src/bin/copy.c +++ b/src/bin/copy.c @@ -83,11 +83,14 @@ static void set_owner(const char *fn, const char *user) { struct passwd *pw; + if (!fn) + return; /* not an error, e.g., running-config is not a file */ + pw = getpwnam(user); if (pw && !chmod(fn, 0660) && !chown(fn, pw->pw_uid, pw->pw_gid)) return; - fprintf(stderr, ERRMSG "setting owner %s on %s: %s\n", fn, user, strerror(errno)); + fprintf(stderr, ERRMSG "setting owner %s on %s: %s\n", user, fn, strerror(errno)); } static const char *infix_ds(const char *text, struct infix_ds **ds)