From 3812e4d94cbe1ea954722ccb9560c33abaf588f8 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 18 Nov 2008 09:36:12 +0000 Subject: [PATCH] libi2ncommon: (tomj) added comment about broken User and Group "structs" --- src/userfunc.cpp | 6 +++++- src/userfunc.hpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/userfunc.cpp b/src/userfunc.cpp index c11ec20..69ac1f9 100644 --- a/src/userfunc.cpp +++ b/src/userfunc.cpp @@ -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 diff --git a/src/userfunc.hpp b/src/userfunc.hpp index 4ac1008..12e6297 100644 --- a/src/userfunc.hpp +++ b/src/userfunc.hpp @@ -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; -- 1.7.1