Accept uid and gid parameters in utils_mkdir()/utils_mkdir_recursive()
[lttng-tools.git] / src / common / runas.c
index 5ab42717a9058b4a5083516aa142a3c1efda226d..a8fe47e8eafe7b2f91fb7ea0a1bb205c02c50117 100644 (file)
@@ -91,6 +91,9 @@ int use_clone(void)
 }
 #endif
 
+LTTNG_HIDDEN
+int _utils_mkdir_recursive_unsafe(const char *path, mode_t mode);
+
 /*
  * Create recursively directory using the FULL path.
  */
@@ -104,7 +107,8 @@ int _mkdir_recursive(void *_data)
        path = data->path;
        mode = data->mode;
 
-       return utils_mkdir_recursive(path, mode);
+       /* Safe to call as we have transitioned to the requested uid/gid. */
+       return _utils_mkdir_recursive_unsafe(path, mode);
 }
 
 static
This page took 0.02503 seconds and 4 git commands to generate.