- Fixes incorrect initiators.allow matching. Reported and tested by Dimitri Puzin...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Wed, 29 Apr 2009 11:29:51 +0000 (11:29 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Wed, 29 Apr 2009 11:29:51 +0000 (11:29 +0000)
 - Fixes handling of tab character during parsing of initiators.allow and initiators.deny files
 - IET part of the version updated
 - TAGS updated
 - Comments in scst_targ.c about long ago gone scst_unregister_session_ex() fixed

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@812 d57e44dd-8a1f-0410-8b47-8ef2f437770f

TAGS
iscsi-scst/include/iscsi_scst_ver.h
iscsi-scst/usr/config.c
iscsi-scst/usr/iscsid.c
scst/src/scst_targ.c

diff --git a/TAGS b/TAGS
index bef0711..bab0dab 100644 (file)
--- a/TAGS
+++ b/TAGS
@@ -1,7 +1,8 @@
-In SVN making tags is too heavyweighted. So, I decided instead keep in
-this file revisions numbers, corresponding to the desired symbolic tags.
+In SVN making tags is too heavyweighted. So, it was decided to keep
+instead in this file revisions numbers, corresponding to the desired
+symbolic tags.
 
 Tag                                    Revision
 1.0.0                                  439
-1.0.0srpt                              450
-
+SRPT 1.0.0                             450
+1.0.1                                  805
index 3c61331..6d22101 100644 (file)
@@ -13,4 +13,4 @@
  *  GNU General Public License for more details.
  */
 
-#define ISCSI_VERSION_STRING   "1.0.2/0.4.17r211"
+#define ISCSI_VERSION_STRING   "1.0.2/0.4.17r212"
index 56cfc20..e7ff36b 100644 (file)
@@ -372,7 +372,7 @@ static int __initiator_match(int fd, char *str)
                return 0;
 
        while ((p = strsep(&str, ","))) {
-               while (isspace(*p))
+               while (isblank(*p))
                        p++;
 
                if (!strcmp(p, "ALL"))
@@ -423,7 +423,7 @@ static int initiator_match(u32 tid, int fd, char *filename)
 
        /*
         * Every time we are called, we read the file. So we don't need to
-        * implement 'reload feature'. It's slow, however, it doesn't matter.
+        * implement the 'reload feature'. It's slow, but that doesn't matter.
         */
        while ((p = fgets(buf, sizeof(buf), fp))) {
                if (!p || *p == '#')
@@ -434,9 +434,14 @@ static int initiator_match(u32 tid, int fd, char *filename)
                        continue;
                *p = '\0';
 
-               if (!(p = strchr(buf, ' ')))
+               p = buf;
+               while (!isblank(*p) && (*p != '\0'))
+                       p++;
+               if (p == '\0')
                        continue;
-               *(p++) = '\0';
+
+               *p = '\0';
+               p++;
 
                if (target_find_id_by_name(buf) != tid && strcmp(buf, "ALL"))
                        continue;
index fec8fb9..0b2a1de 100644 (file)
@@ -507,15 +507,21 @@ static void login_start(struct connection *conn)
                }
 
                target = target_find_by_name(target_name);
-               if ((target == NULL) ||
-                   config_initiator_access(conn->tid, conn->fd) ||
-                   isns_scn_access(conn->tid, conn->fd, name)) {
+               if (target == NULL) {
                        rsp->status_class = ISCSI_STATUS_INITIATOR_ERR;
                        rsp->status_detail = ISCSI_STATUS_TGT_NOT_FOUND;
                        conn->state = STATE_EXIT;
                        return;
                }
+
                conn->tid = target->tid;
+               if (config_initiator_access(conn->tid, conn->fd) ||
+                   isns_scn_access(conn->tid, conn->fd, name)) {
+                       rsp->status_class = ISCSI_STATUS_INITIATOR_ERR;
+                       rsp->status_detail = ISCSI_STATUS_TGT_NOT_FOUND;
+                       conn->state = STATE_EXIT;
+                       return;
+               }
 
                err = kernel_param_get(conn->tid, conn->sid.id64, key_session,
                        conn->session_param);
index b2e5978..6bd888c 100644 (file)
@@ -55,7 +55,7 @@ static inline void scst_schedule_tasklet(struct scst_cmd *cmd)
 }
 
 /*
- * Must not be called in parallel with scst_unregister_session_ex() for the
+ * Must not be called in parallel with scst_unregister_session() for the
  * same sess
  */
 struct scst_cmd *scst_rx_cmd(struct scst_session *sess,
@@ -5110,7 +5110,7 @@ out_unlock:
 }
 
 /*
- * Must not be called in parallel with scst_unregister_session_ex() for the
+ * Must not be called in parallel with scst_unregister_session() for the
  * same sess
  */
 int scst_rx_mgmt_fn(struct scst_session *sess,