1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #1681: Conversions from string to mask (binary) are made in User::get_umask

This commit is contained in:
Ruben S. Montero 2013-01-22 15:37:07 +01:00
parent 24e913fb2c
commit c5044cd51b
2 changed files with 4 additions and 21 deletions

View File

@ -356,23 +356,6 @@ public:
return nebula_configuration->to_xml(xml);
};
int get_default_umask() const
{
string umask_st;
int umask;
istringstream iss;
get_configuration_attribute(
"DEFAULT_UMASK", umask_st);
iss.str(umask_st);
iss >> oct >> umask;
return umask;
};
// -----------------------------------------------------------------------
// Default Quotas
// -----------------------------------------------------------------------

View File

@ -197,8 +197,8 @@ int User::from_xml(const string& xml)
rc += obj_template->from_xml_node(content[0]);
ObjectXML::free_nodes(content);
rc += quota.from_xml(this);
rc += quota.from_xml(this);
if (rc != 0)
{
@ -298,14 +298,14 @@ int User::get_umask() const
if(umask_st.empty())
{
return Nebula::instance().get_default_umask();
Nebula::instance().get_configuration_attribute("DEFAULT_UMASK",umask_st);
}
iss.str(umask_st);
iss >> oct >> umask;
return umask;
return (umask & 0777);
}
/* -------------------------------------------------------------------------- */