s3: string_to_sid does thorough syntax checking
authorVolker Lendecke <vl@samba.org>
Sun, 14 Nov 2010 14:15:52 +0000 (15:15 +0100)
committerVolker Lendecke <vlendec@samba.org>
Sun, 14 Nov 2010 14:07:29 +0000 (14:07 +0000)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Nov 14 14:07:29 UTC 2010 on sn-devel-104

source3/utils/smbcacls.c
source3/utils/smbcquotas.c

index bb438bab7844a7043fca0f511c74a3fb2b25765e..9f740f7f34936b8cc1ed7f8f037a8ff4dac68a30 100644 (file)
@@ -200,8 +200,8 @@ static bool StringToSid(struct cli_state *cli, struct dom_sid *sid, const char *
 {
        enum lsa_SidType type;
 
-       if (strncmp(str, "S-", 2) == 0) {
-               return string_to_sid(sid, str);
+       if (string_to_sid(sid, str)) {
+               return true;
        }
 
        return NT_STATUS_IS_OK(cli_lsa_lookup_name(cli, str, &type, sid));
index 6353272d8261d6db34652d85b355ed8b0cd935af..63ea269cb5061bd56efeb539a417428157eb3a2d 100644 (file)
@@ -117,8 +117,8 @@ static bool StringToSid(struct dom_sid *sid, const char *str)
        struct dom_sid *sids = NULL;
        bool result = True;
 
-       if (strncmp(str, "S-", 2) == 0) {
-               return string_to_sid(sid, str);
+       if (string_to_sid(sid, str)) {
+               return true;
        }
 
        if (!cli_open_policy_hnd() ||