]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
str_to_gid(): Allow negative GIDs on OS X.
authorTimo Sirainen <tss@iki.fi>
Wed, 19 May 2010 12:59:11 +0000 (14:59 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 19 May 2010 12:59:11 +0000 (14:59 +0200)
--HG--
branch : HEAD

src/lib/strnum.c

index b9d32d24ad182fa2dbfb54c13ceb157aa54f8165..afa145b8cc4feba7141cc595b8c81734177cde07 100644 (file)
@@ -198,8 +198,11 @@ int str_to_gid(const char *str, gid_t *num_r)
        if (str_to_uintmax(str, &l) < 0)
                return -1;
 
+       /* OS X uses negative GIDs */
+#ifndef __APPLE__
        if (verify_xid(l, sizeof(*num_r)) < 0)
                return -1;
+#endif
        *num_r = (gid_t)l;
        return 0;
 }