mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Feature #1681: Add command oneuser umask
This commit is contained in:
parent
780d7742f2
commit
24e913fb2c
@ -270,6 +270,39 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
exit 0
|
||||
end
|
||||
|
||||
umask_desc = <<-EOT.unindent
|
||||
Changes the umask used to create the default permissions. In a similar
|
||||
way to the Unix umask command, the expected value is a three-digit
|
||||
base-8 number. Each digit is a mask that disables permissions for the
|
||||
owner, group and other, respectively.
|
||||
|
||||
If mask is not given, or if it is an empty string, the umask will
|
||||
be unset
|
||||
EOT
|
||||
|
||||
command :umask, umask_desc, [:range, :userid_list], [:mask, nil] do
|
||||
helper.perform_actions(args[0],options,
|
||||
"umask changed") do |user|
|
||||
|
||||
rc = user.info
|
||||
|
||||
if OpenNebula.is_error?(rc)
|
||||
puts rc.message
|
||||
exit -1
|
||||
end
|
||||
|
||||
user.delete_element('/USER/TEMPLATE/UMASK')
|
||||
|
||||
tmp_str = user.template_str
|
||||
|
||||
if !args[1].nil? && args[1] != ""
|
||||
tmp_str << "\nUMASK = #{args[1]}"
|
||||
end
|
||||
|
||||
user.update(tmp_str)
|
||||
end
|
||||
end
|
||||
|
||||
login_desc = <<-EOT.unindent
|
||||
Creates the Login token for authentication
|
||||
Examples:
|
||||
|
Loading…
x
Reference in New Issue
Block a user