Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MountOwnerDetails Class Reference

Class that represents mount ownership and whether to apply recursively. More...

#include <MountOwnerDetails.h>

Collaboration diagram for MountOwnerDetails:
Collaboration graph
[legend]

Public Member Functions

 MountOwnerDetails (MountOwnerDetails &)=delete
 
 MountOwnerDetails (MountOwnerDetails &&)=delete
 
 MountOwnerDetails (const std::string &rootfsPath, const MountOwnerProperties &mountOwnerProperties, const uid_t &defaultUserId, const gid_t &defaultGroupId, const std::shared_ptr< DobbyRdkPluginUtils > &utils)
 
bool onCreateRuntime () const
 Changes ownership of mount source according to MountOwnerProperties during the createRuntime hook. More...
 

Private Member Functions

bool getOwnerIds (uid_t &userId, gid_t &groupId) const
 Get user and group IDs based on their configured. More...
 
bool processOwners () const
 Process individual mount owner and change ownership either singularly or recursively. More...
 
bool changeOwnerRecursive (const std::string &path, uid_t userId, gid_t groupId) const
 Change ownership recursively from the given path. More...
 
bool changeOwner (const std::string &path, uid_t userId, gid_t groupId) const
 Change ownership of mount according to properties structure. More...
 

Private Attributes

const std::string mRootfsPath
 
MountOwnerProperties mMountOwnerProperties
 
uid_t mDefaultUserId
 
gid_t mDefaultGroupId
 
const std::shared_ptr< DobbyRdkPluginUtilsmUtils
 

Friends

class Storage
 

Detailed Description

Class that represents mount ownership and whether to apply recursively.

This class is only intended to be used internally by Storage plugin do not use from external code.

This class is only intended to be used internally by Storage plugin do not use from external code.

Parameters
[in]rootfsPathRoot FS path to apply ownership
[in]mountPropertiesStructure holding mount ownership configuration
[in]utilsUseful Dobby utilities
See also
Storage
Storage

Member Function Documentation

◆ changeOwner()

bool MountOwnerDetails::changeOwner ( const std::string &  path,
uid_t  userId,
gid_t  groupId 
) const
private

Change ownership of mount according to properties structure.

Parameters
[in]pathPath to change ownership of
[in]userIdUser ID to set
[in]groupIdGroup ID to set
Returns
true on success, false on failure

◆ changeOwnerRecursive()

bool MountOwnerDetails::changeOwnerRecursive ( const std::string &  path,
uid_t  userId,
gid_t  groupId 
) const
private

Change ownership recursively from the given path.

Parameters
[out]pathPath to recurse from
[out]userIdID corresponding to the configured user name
[out]groupIdID corresponding to the configured group name
Returns
true on success, false on failure

◆ getOwnerIds()

bool MountOwnerDetails::getOwnerIds ( uid_t &  userId,
gid_t &  groupId 
) const
private

Get user and group IDs based on their configured.

Parameters
[out]userIdID corresponding to the configured user name
[out]groupIdID corresponding to the configured group name
Returns
true on success, false on failure

◆ onCreateRuntime()

bool MountOwnerDetails::onCreateRuntime ( ) const

Changes ownership of mount source according to MountOwnerProperties during the createRuntime hook.

Returns
true on success, false on failure

◆ processOwners()

bool MountOwnerDetails::processOwners ( ) const
private

Process individual mount owner and change ownership either singularly or recursively.

Returns
true on success, false on failure

The documentation for this class was generated from the following files: