diff options
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | hwdb/70-mouse.hwdb | 12 | ||||
-rw-r--r-- | shell-completion/zsh/_busctl | 15 | ||||
-rw-r--r-- | src/boot/bootctl.c | 2 | ||||
-rw-r--r-- | src/gpt-auto-generator/gpt-auto-generator.c | 165 | ||||
-rw-r--r-- | src/libsystemd/sd-daemon/sd-daemon.c | 14 | ||||
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-message.c | 2 | ||||
-rw-r--r-- | src/login/logind-inhibit.c | 16 | ||||
-rw-r--r-- | src/systemctl/systemctl.c | 1 | ||||
-rw-r--r-- | src/udev/udev-ctrl.c | 3 |
10 files changed, 135 insertions, 96 deletions
@@ -464,6 +464,7 @@ Features: ReadOnlyDirectories=... for whitelisting files for a service. * sd-bus: + - figure out wat the UNPRIVILEGED flag shall mean for props that can be read *and* written - GetAllProperties() on a non-existing object does not result in a failure currently - kdbus: process fd=-1 for incoming msgs - port to sd-resolve for connecting to TCP dbus servers diff --git a/hwdb/70-mouse.hwdb b/hwdb/70-mouse.hwdb index 7373be4778..1451fc02cc 100644 --- a/hwdb/70-mouse.hwdb +++ b/hwdb/70-mouse.hwdb @@ -171,6 +171,8 @@ mouse:usb:v17efp6044:name:ThinkPad USB Laser Mouse: # Logitech M-BJ58 Optical Mouse mouse:usb:v046dpc00e:name:Logitech USB-PS/2 Optical Mouse: +# Logitech Mini Optical Mouse +mouse:usb:v046dpc016:name:Logitech Optical USB Mouse: # Logitech MX310 Optical Mouse mouse:usb:v046dpc01b:name:Logitech USB-PS/2 Optical Mouse: # Logitech USB-PS/2 M-BT58 @@ -219,6 +221,8 @@ mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4008: # Logitech M705 (marathon mouse) mouse:usb:v046dp101b:name:Logitech M705: mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:101b: +# Logitech Performance MX +mouse:usb:v046dp101a:name:Logitech Performance MX: MOUSE_DPI=800@166 # Logitech MX Revolution @@ -300,6 +304,10 @@ mouse:usb:v046dpc068:name:Logitech G500: mouse:bluetooth:v046dpb00d:name:Ultrathin Touch Mouse: MOUSE_DPI=1000@1000 +# ImPS/2 Logitech Wheel Mouse +mouse:ps2:*:name:ImPS/2 Logitech Wheel Mouse: + MOUSE_DPI=400@100 + # ImExPS/2 Logitech Wheel Mouse mouse:ps2:*:name:ImExPS/2 Logitech Wheel Mouse: MOUSE_DPI=400@250 @@ -314,6 +322,10 @@ mouse:usb:v045ep0040:name:Microsoft Microsoft 3-Button Mouse with IntelliEye(TM) # Note: unsure that these work, it's likely that all devices on these # receivers show up with the same vid/pid/name +# Microsoft Wireless Mouse 5000 +mouse:usb:v045ep0745:name:Microsoft Microsoft® 2.4GHz Transceiver v6.0: + MOUSE_DPI=800@142 + # Microsoft Sculpt Ergonomic Mouse mouse:usb:v045ep07a5:name:Microsoft Microsoft® 2.4GHz Transceiver v9.0: MOUSE_DPI=1000@142 diff --git a/shell-completion/zsh/_busctl b/shell-completion/zsh/_busctl index fb1841341e..ef790e558f 100644 --- a/shell-completion/zsh/_busctl +++ b/shell-completion/zsh/_busctl @@ -24,7 +24,14 @@ local -a _busctl_cmds _busctl_cmds=( "list:List bus names" + "status:Show bus service, process or bus owner credentials" "monitor:Show bus traffic" + "capture:Capture bus traffix as pcap" + "tree:Show object tree of service" + "introspect:Introspect object" + "call:Call a method" + "get-property:Get property value" + "set-property:Set property value" ) if (( CURRENT == 1 )); then _describe -t commands 'busctl command' _busctl_cmds || compadd "$@" @@ -54,4 +61,12 @@ _arguments \ '--acquired[Only show acquired names]' \ '--activatable[Only show activatable names]' \ '--match=[Only show matching messages]:match' \ + '--list[Do not show tree, but simple object path list]' \ + '--quiet[Do not show method call reply]'\ + '--verbose[Show result values in long format]' \ + '--expect-reply=[Expect a method call reply]:boolean:(1 0)' \ + '--auto-start=[Auto-start destination service]:boolean:(1 0)' \ + '--allow-interactive-authorization=[Allow interactive authorization for operation]:boolean:(1 0)' \ + '--timeout=[Maximum time to wait for method call completion]:timeout (seconds)' \ + '--augment-creds=[Extend credential data with data read from /proc/$PID]:boolean:(1 0)' \ '*::busctl command:_busctl_command' diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 359fde9998..ac1711b318 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -818,7 +818,7 @@ static int remove_boot_efi(const char *esp_path) { if (r < 0) return log_error_errno(errno, "Failed to remove \"%s/%s\": %m", p, de->d_name); - log_info("Removed \"%s/\%s\".", p, de->d_name); + log_info("Removed \"%s/%s\".", p, de->d_name); } c++; diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 40caec5ab5..0a34f86be7 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -240,82 +240,6 @@ static int add_mount( return 0; } -static int add_automount( - const char *id, - const char *what, - const char *where, - const char *fstype, - bool rw, - const char *options, - const char *description, - usec_t timeout) { - - _cleanup_free_ char *unit = NULL, *lnk = NULL; - _cleanup_free_ char *opt, *p = NULL; - _cleanup_fclose_ FILE *f = NULL; - int r; - - assert(id); - assert(where); - assert(description); - - if (options) - opt = strjoin(options, ",noauto", NULL); - else - opt = strdup("noauto"); - if (!opt) - return log_oom(); - - r = add_mount(id, - what, - where, - fstype, - rw, - opt, - description, - NULL); - if (r < 0) - return r; - - r = unit_name_from_path(where, ".automount", &unit); - if (r < 0) - return log_error_errno(r, "Failed to generate unit name: %m"); - - p = strjoin(arg_dest, "/", unit, NULL); - if (!p) - return log_oom(); - - f = fopen(p, "wxe"); - if (!f) - return log_error_errno(errno, "Failed to create unit file %s: %m", unit); - - fprintf(f, - "# Automatically generated by systemd-gpt-auto-generator\n\n" - "[Unit]\n" - "Description=%s\n" - "Documentation=man:systemd-gpt-auto-generator(8)\n" - "[Automount]\n" - "Where=%s\n" - "TimeoutIdleSec=%lld\n", - description, - where, - (unsigned long long)timeout / USEC_PER_SEC); - - r = fflush_and_check(f); - if (r < 0) - return log_error_errno(r, "Failed to write unit file %s: %m", p); - - lnk = strjoin(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/", unit, NULL); - if (!lnk) - return log_oom(); - mkdir_parents_label(lnk, 0755); - - if (symlink(p, lnk) < 0) - return log_error_errno(errno, "Failed to create symlink %s: %m", lnk); - - return 0; -} - static bool path_is_busy(const char *where) { int r; @@ -441,8 +365,84 @@ static int add_swap(const char *path) { return 0; } -static int add_boot(const char *what) { #ifdef ENABLE_EFI +static int add_automount( + const char *id, + const char *what, + const char *where, + const char *fstype, + bool rw, + const char *options, + const char *description, + usec_t timeout) { + + _cleanup_free_ char *unit = NULL, *lnk = NULL; + _cleanup_free_ char *opt, *p = NULL; + _cleanup_fclose_ FILE *f = NULL; + int r; + + assert(id); + assert(where); + assert(description); + + if (options) + opt = strjoin(options, ",noauto", NULL); + else + opt = strdup("noauto"); + if (!opt) + return log_oom(); + + r = add_mount(id, + what, + where, + fstype, + rw, + opt, + description, + NULL); + if (r < 0) + return r; + + r = unit_name_from_path(where, ".automount", &unit); + if (r < 0) + return log_error_errno(r, "Failed to generate unit name: %m"); + + p = strjoin(arg_dest, "/", unit, NULL); + if (!p) + return log_oom(); + + f = fopen(p, "wxe"); + if (!f) + return log_error_errno(errno, "Failed to create unit file %s: %m", unit); + + fprintf(f, + "# Automatically generated by systemd-gpt-auto-generator\n\n" + "[Unit]\n" + "Description=%s\n" + "Documentation=man:systemd-gpt-auto-generator(8)\n" + "[Automount]\n" + "Where=%s\n" + "TimeoutIdleSec=%lld\n", + description, + where, + (unsigned long long)timeout / USEC_PER_SEC); + + r = fflush_and_check(f); + if (r < 0) + return log_error_errno(r, "Failed to write unit file %s: %m", p); + + lnk = strjoin(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/", unit, NULL); + if (!lnk) + return log_oom(); + mkdir_parents_label(lnk, 0755); + + if (symlink(p, lnk) < 0) + return log_error_errno(errno, "Failed to create symlink %s: %m", lnk); + + return 0; +} + +static int add_boot(const char *what) { _cleanup_blkid_free_probe_ blkid_probe b = NULL; const char *fstype = NULL, *uuid = NULL; sd_id128_t id, type_id; @@ -532,10 +532,12 @@ static int add_boot(const char *what) { 120 * USEC_PER_SEC); return r; +} #else +static int add_boot(const char *what) { return 0; -#endif } +#endif static int enumerate_partitions(dev_t devnum) { @@ -616,9 +618,12 @@ static int enumerate_partitions(dev_t devnum) { errno = 0; r = blkid_do_safeprobe(b); - if (r == -2 || r == 1) /* no result or uncertain */ + if (r == 1) + return 0; /* no results */ + else if (r == -2) { + log_warning("%s: probe gave ambiguous results, ignoring", node); return 0; - else if (r != 0) + } else if (r != 0) return log_error_errno(errno ?: EIO, "%s: failed to probe: %m", node); errno = 0; diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index 82ac72c72a..d230a48daf 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -90,7 +90,7 @@ finish: _public_ int sd_is_fifo(int fd, const char *path) { struct stat st_fd; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); if (fstat(fd, &st_fd) < 0) return -errno; @@ -120,7 +120,7 @@ _public_ int sd_is_fifo(int fd, const char *path) { _public_ int sd_is_special(int fd, const char *path) { struct stat st_fd; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); if (fstat(fd, &st_fd) < 0) return -errno; @@ -155,7 +155,7 @@ _public_ int sd_is_special(int fd, const char *path) { static int sd_is_socket_internal(int fd, int type, int listening) { struct stat st_fd; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); assert_return(type >= 0, -EINVAL); if (fstat(fd, &st_fd) < 0) @@ -198,7 +198,7 @@ static int sd_is_socket_internal(int fd, int type, int listening) { _public_ int sd_is_socket(int fd, int family, int type, int listening) { int r; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); assert_return(family >= 0, -EINVAL); r = sd_is_socket_internal(fd, type, listening); @@ -226,7 +226,7 @@ _public_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint socklen_t l = sizeof(sockaddr); int r; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); assert_return(IN_SET(family, 0, AF_INET, AF_INET6), -EINVAL); r = sd_is_socket_internal(fd, type, listening); @@ -269,7 +269,7 @@ _public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path socklen_t l = sizeof(sockaddr); int r; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); r = sd_is_socket_internal(fd, type, listening); if (r <= 0) @@ -310,7 +310,7 @@ _public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path _public_ int sd_is_mq(int fd, const char *path) { struct mq_attr attr; - assert_return(fd >= 0, -EINVAL); + assert_return(fd >= 0, -EBADF); if (mq_getattr(fd, &attr) < 0) return -errno; diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index 3ba62a6be9..aee2ced2d9 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -501,7 +501,7 @@ static int netlink_message_read_internal(sd_netlink_message *m, unsigned short t assert_return(m, -EINVAL); assert_return(m->sealed, -EPERM); assert_return(data, -EINVAL); - assert(m->n_containers <= RTNL_CONTAINER_DEPTH); + assert(m->n_containers < RTNL_CONTAINER_DEPTH); assert(m->containers[m->n_containers].attributes); assert(type < m->containers[m->n_containers].n_attributes); diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index a261e6a719..cfae186edd 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -109,20 +109,24 @@ int inhibitor_save(Inhibitor *i) { _cleanup_free_ char *cc = NULL; cc = cescape(i->who); - if (!cc) + if (!cc) { r = -ENOMEM; - else - fprintf(f, "WHO=%s\n", cc); + goto fail; + } + + fprintf(f, "WHO=%s\n", cc); } if (i->why) { _cleanup_free_ char *cc = NULL; cc = cescape(i->why); - if (!cc) + if (!cc) { r = -ENOMEM; - else - fprintf(f, "WHY=%s\n", cc); + goto fail; + } + + fprintf(f, "WHY=%s\n", cc); } if (i->fifo_path) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 4e850ea1cf..1a9dbadbe1 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -7292,6 +7292,7 @@ static int halt_now(enum action a) { reboot(RB_POWER_OFF); return -errno; + case ACTION_KEXEC: case ACTION_REBOOT: { _cleanup_free_ char *param = NULL; diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index b0ad277f73..b4ae0944eb 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -379,13 +379,14 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) { cmsg_close_all(&smsg); cmsg = CMSG_FIRSTHDR(&smsg); - cred = (struct ucred *) CMSG_DATA(cmsg); if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) { log_error("no sender credentials received, message ignored"); goto err; } + cred = (struct ucred *) CMSG_DATA(cmsg); + if (cred->uid != 0) { log_error("sender uid="UID_FMT", message ignored", cred->uid); goto err; |