virSecurityManagerPtr virSecurityManagerNewDAC(const char *virtDriver, uid_t user, gid_t group, bool allowDiskFormatProbing, bool defaultConfined, bool requireConfined, bool dynamicOwnership) { virSecurityManagerPtr mgr = virSecurityManagerNewDriver(&virSecurityDriverDAC, virtDriver, allowDiskFormatProbing, defaultConfined, requireConfined); if (!mgr) return NULL; if (virSecurityDACSetUserAndGroup(mgr, user, group) < 0) { virSecurityManagerDispose(mgr); return NULL; } virSecurityDACSetDynamicOwnership(mgr, dynamicOwnership); return mgr; }
virSecurityManagerPtr virSecurityManagerNewDAC(const char *virtDriver, uid_t user, gid_t group, unsigned int flags, virSecurityManagerDACChownCallback chownCallback) { virSecurityManagerPtr mgr; virCheckFlags(VIR_SECURITY_MANAGER_NEW_MASK | VIR_SECURITY_MANAGER_DYNAMIC_OWNERSHIP, NULL); mgr = virSecurityManagerNewDriver(&virSecurityDriverDAC, virtDriver, flags & VIR_SECURITY_MANAGER_NEW_MASK); if (!mgr) return NULL; if (virSecurityDACSetUserAndGroup(mgr, user, group) < 0) { virSecurityManagerDispose(mgr); return NULL; } virSecurityDACSetDynamicOwnership(mgr, flags & VIR_SECURITY_MANAGER_DYNAMIC_OWNERSHIP); virSecurityDACSetChownCallback(mgr, chownCallback); return mgr; }