[Lsb-messages] /var/www/bzr/lsb/devel/olver-core-tests r100: Bless $ salt notation, EINVAL for crypt() (bug 2215).

Jeff Licquia licquia at linuxfoundation.org
Mon Aug 12 20:37:48 UTC 2013


------------------------------------------------------------
revno: 100
author: Kurban Mallachiev <mallachiev at ispras.ru>
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: olver-core-tests
timestamp: Mon 2013-08-12 16:37:48 -0400
message:
  Bless $ salt notation, EINVAL for crypt() (bug 2215).
modified:
  src/model/util/crypt/crypt_model.sec
  src/model/util/crypt/tests/crypt_scenario.sec
-------------- next part --------------
=== modified file 'src/model/util/crypt/crypt_model.sec'
--- a/src/model/util/crypt/crypt_model.sec	2008-09-05 17:30:58 +0000
+++ b/src/model/util/crypt/crypt_model.sec	2013-08-12 20:37:48 +0000
@@ -125,6 +125,17 @@
             "The salt argument is a string chosen from the set", 
             checkSalt(salt));
 
+
+       /* 
+        * Since LSB 5.0 crypt() specification refers to POSIX-2008, that states:
+        * "The salt argument shall be a string of at least two bytes in length 
+        *  not including the null character."
+        * Meanwhile, glibc implementation never supported salt size < 2.
+        */
+        REQ("", 
+            "salt size must be greater 1",
+            length_CString(salt) > 1 );
+
         return true;
     }
     coverage C

=== modified file 'src/model/util/crypt/tests/crypt_scenario.sec'
--- a/src/model/util/crypt/tests/crypt_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/util/crypt/tests/crypt_scenario.sec	2013-08-12 20:37:48 +0000
@@ -124,7 +124,7 @@
 scenario
 bool crypt_scen()
 {
-    CString* key=create_CString("Key"), *salt=create_CString(""), *res;
+    CString* key=create_CString("Key"), *salt=create_CString("salt"), *res;
 
     res = crypt_spec(context, key, salt, requestErrorCode());
 



More information about the lsb-messages mailing list