pool->def->target.perms.mode,
pool->def->target.perms.uid,
pool->def->target.perms.gid,
- VIR_DIR_CREATE_FORCE_PERMS |
VIR_DIR_CREATE_ALLOW_EXIST |
(pool->def->type == VIR_STORAGE_POOL_NETFS
? VIR_DIR_CREATE_AS_UID : 0))) < 0) {
if ((err = virDirCreate(vol->target.path, vol->target.perms->mode,
vol->target.perms->uid,
vol->target.perms->gid,
- VIR_DIR_CREATE_FORCE_PERMS |
(pool->def->type == VIR_STORAGE_POOL_NETFS
? VIR_DIR_CREATE_AS_UID : 0))) < 0) {
return -1;
path, (unsigned int) uid, (unsigned int) gid);
goto error;
}
- if ((flags & VIR_DIR_CREATE_FORCE_PERMS)
- && (chmod(path, mode) < 0)) {
+ if (chmod(path, mode) < 0) {
ret = -errno;
virReportSystemError(errno,
_("cannot set mode of '%s' to %04o"),
path, (unsigned int) gid);
goto childerror;
}
- if ((flags & VIR_DIR_CREATE_FORCE_PERMS)
- && chmod(path, mode) < 0) {
+ if (chmod(path, mode) < 0) {
virReportSystemError(errno,
_("cannot set mode of '%s' to %04o"),
path, mode);
enum {
VIR_DIR_CREATE_NONE = 0,
VIR_DIR_CREATE_AS_UID = (1 << 0),
- VIR_DIR_CREATE_FORCE_PERMS = (1 << 1),
- VIR_DIR_CREATE_ALLOW_EXIST = (1 << 2),
+ VIR_DIR_CREATE_ALLOW_EXIST = (1 << 1),
};
int virDirCreate(const char *path, mode_t mode, uid_t uid, gid_t gid,
unsigned int flags) ATTRIBUTE_RETURN_CHECK;