iscsi-initiator-utils/iscsi-initiator-utils-only-root-use.patch
Hans de Goede 4cc2dba7fe - Rewrite SysV initscripts, fixes rh 441290, 246960, 282001, 436175, 430791
- Add patch to make iscsiadm complain and exit when run as user instead of
    hang spinning for the database lock
- Add patch to make iscsiadm start iscsid when needed (rh 436175 related)
- Don't start iscsi service when network not yet up (in case of using NM)
    add NM dispatcher script to start iscsi service once network is up
2008-10-13 18:12:29 +00:00

33 lines
1.0 KiB
Diff

diff -up open-iscsi-2.0-870-rc1/usr/idbm.c.error open-iscsi-2.0-870-rc1/usr/idbm.c
--- open-iscsi-2.0-870-rc1/usr/idbm.c.error 2008-09-30 10:09:40.000000000 +0200
+++ open-iscsi-2.0-870-rc1/usr/idbm.c 2008-09-30 10:20:43.000000000 +0200
@@ -850,6 +850,12 @@ int idbm_lock(void)
if (ret == 0)
break;
+ if (errno != EEXIST) {
+ log_error("Could not lock discovery DB: %s: %s",
+ LOCK_WRITE_FILE, strerror(errno));
+ exit(-1);
+ }
+
usleep(10000);
}
diff -up open-iscsi-2.0-870-rc1/usr/iscsiadm.c.error open-iscsi-2.0-870-rc1/usr/iscsiadm.c
--- open-iscsi-2.0-870-rc1/usr/iscsiadm.c.error 2008-09-30 10:20:15.000000000 +0200
+++ open-iscsi-2.0-870-rc1/usr/iscsiadm.c 2008-09-30 10:20:15.000000000 +0200
@@ -2141,6 +2141,12 @@ main(int argc, char **argv)
if (mode < 0)
usage(0);
+ if (getuid()) {
+ log_error("must be run as root");
+ rc = -1;
+ goto free_ifaces;
+ }
+
if (mode == MODE_FW) {
if ((rc = verify_mode_params(argc, argv, "ml", 0))) {
log_error("fw mode: option '-%c' is not "