SHA256
1
0
forked from pool/systemd
systemd/1083-udev-node-warn-if-chmod-chown-fails.patch
Stephan Kulow e7c96ab7f3 Accepting request 250254 from Base:System
- Add patch 0001-bnc888612-logind-polkit-acpi.patch from Frederic
  to solve bnc#888612 - AUDIT-0: Power button press at gdm login
  should not prompt for credentials 

- Add upstream bugfix patches
  0001-journal-Do-not-count-on-the-compiler-initializing-fo.patch
  0002-include-fcntl.h-rather-than-sys-fcntl.h.patch
  0003-mount-order-options-before-other-arguments-to-mount.patch
  0004-shared-wtmp-utmp-don-t-clear-store_wtmp-in-utmp_put_.patch
  0005-shared-label.h-add-missing-stdio.h-include.patch
  0006-shared-sparse-endian.h-add-missing-byteswap.h-includ.patch
  0007-libudev-monitor-warn-if-we-fail-to-request-SO_PASSCR.patch
  0008-shared-conf-parser-don-t-leak-memory-on-error-in-DEF.patch
  1080-udevd-parse_argv-warn-if-argumens-are-invalid.patch
  1081-udevd-check-return-of-various-functions.patch
  1082-udevadm-hwdb-check-return-value-of-fseeko.patch
  1083-udev-node-warn-if-chmod-chown-fails.patch
  1084-udev-ctrl-log-if-setting-SO_PASSCRED-fails.patch
  1085-udev-fix-typos.patch
  1086-udevd-don-t-fail-if-run-udev-exists.patch

- Add upstream bugfix patches
  0001-core-fix-resource-leak-in-manager_environment_add.patch
  0002-util-remove-a-unnecessary-check.patch
  0003-udev-event-explicitly-don-t-read-from-invalid-fd.patch
  0004-shared-conf-parser.patch
  0005-logind-fix-typo.patch
  0006-systemctl-fix-resource-leak-CID-1237747.patch
  0007-libudev-monitor-warn-if-we-fail-to-request-SO_PASSCR.patch
  0008-shared-conf-parser-don-t-leak-memory-on-error-in-DEF.patc

OBS-URL: https://build.opensuse.org/request/show/250254
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=207
2014-09-20 13:51:16 +00:00

35 lines
1.5 KiB
Diff

From 543afdc63c02a5af3cf6bd2a264162f23474346a Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 18 Sep 2014 19:22:09 +0200
Subject: [PATCH] udev: node - warn if chmod/chown fails
No functional change, just log the warning.
Fonud by Coverity. Fixes CID #1237544.
---
src/udev/udev-node.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git src/udev/udev-node.c src/udev/udev-node.c
index c164603..8ef7889 100644
--- src/udev/udev-node.c
+++ src/udev/udev-node.c
@@ -281,8 +281,12 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
if ((stats.st_mode & 0777) != (mode & 0777) || stats.st_uid != uid || stats.st_gid != gid) {
log_debug("set permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
- chmod(devnode, mode);
- chown(devnode, uid, gid);
+ err = chmod(devnode, mode);
+ if (err < 0)
+ log_warning("setting mode of %s to %#o failed: %m", devnode, mode);
+ err = chown(devnode, uid, gid);
+ if (err < 0)
+ log_warning("setting owner of %s to uid=%u, gid=%u failed: %m", devnode, uid, gid);
} else {
log_debug("preserve permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
}
--
1.7.9.2