libi2ncommon: (tomj) added comment about broken User and Group "structs"
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 18 Nov 2008 09:36:12 +0000 (09:36 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 18 Nov 2008 09:36:12 +0000 (09:36 +0000)
src/userfunc.cpp
src/userfunc.hpp

index c11ec20..69ac1f9 100644 (file)
@@ -127,6 +127,7 @@ void User::clear()
 {
    Name.clear();
    Password.clear();
+    // FIXME: Uid and Gid is unsigned
    Uid= -1;
    Gid= -1;
    Gecos.clear();
@@ -144,6 +145,7 @@ void User::clear()
  */
 bool User::is_valid() const
 {
+    // FIXME: Uid and Gid is unsigned, so the first expression is always true!
    return (Uid >= 0) and (Gid >= 0)
           and not Name.empty()
           ;
@@ -156,7 +158,7 @@ bool User::is_valid() const
 
 
 Group::Group()
-: Gid (-1)
+: Gid (-1)  // FIXME: Gid is unsigned
 {
 } // eo Group::Group()
 
@@ -199,6 +201,7 @@ void Group::clear()
 {
    Name.clear();
    Password.clear();
+    // FIXME: Gid is unsigned
    Gid= -1;
    Members.clear();
 } // eo Group::clear()
@@ -213,6 +216,7 @@ void Group::clear()
  */
 bool Group::is_valid() const
 {
+    // FIXME: Gid is unsigned, so the first expression is always true!
    return (Gid >= 0) and not Name.empty();
 } // eo Group::is_valid() const
 
index 4ac1008..12e6297 100644 (file)
@@ -26,6 +26,7 @@ namespace I2n
 /**
  * @brief structure similar to "struct passwd", but more C++ like.
  */
+/// FIXME: Argh, why is this a public struct without accessor functions
 struct User
 {
    std::string Name;
@@ -52,6 +53,7 @@ struct User
 /**
  * @brief structure similar to "struct group", but more C++ like.
  */
+/// FIXME: Argh, why is this a public struct without accessor functions
 struct Group
 {
    std::string Name;