libwbclient: added support for WBC_ID_TYPE_BOTH
authorAndrew Tridgell <tridge@samba.org>
Tue, 26 Jul 2011 01:05:38 +0000 (11:05 +1000)
committerMichael Adam <obnox@samba.org>
Thu, 22 Sep 2011 22:16:41 +0000 (00:16 +0200)
the Samba4 winbindd allows for a single SID to map to both a user and
group id. This is used to support files with the owner_sid set to a
group

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
nsswitch/libwbclient/wbc_idmap.c
nsswitch/libwbclient/wbclient.h

index 5325dbe5ce531680afc23e3f1c53be9d6847e1f2..04e7d02995e50e0d0c11bf750b4498cb2f1f64a9 100644 (file)
@@ -370,6 +370,10 @@ wbcErr wbcSidsToUnixIds(const struct wbcDomainSid *sids, uint32_t num_sids,
                        id->type = WBC_ID_TYPE_GID;
                        id->id.gid = strtoul(p+1, &q, 10);
                        break;
+               case 'B':
+                       id->type = WBC_ID_TYPE_BOTH;
+                       id->id.uid = strtoul(p+1, &q, 10);
+                       break;
                default:
                        id->type = WBC_ID_TYPE_NOT_SPECIFIED;
                        q = strchr(p, '\n');
index c5f3b77ed8cc21643f67ef4d0bc9bafb62d9f58b..809e00a0076cdbe0e38248721d2854d53143aaa1 100644 (file)
@@ -796,7 +796,8 @@ wbcErr wbcQueryGidToSid(gid_t gid,
 enum wbcIdType {
        WBC_ID_TYPE_NOT_SPECIFIED,
        WBC_ID_TYPE_UID,
-       WBC_ID_TYPE_GID
+       WBC_ID_TYPE_GID,
+       WBC_ID_TYPE_BOTH
 };
 
 union wbcUnixIdContainer {