Skip to content

Commit

Permalink
adduser handler checks for root before using sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
delano committed Nov 11, 2010
1 parent 3a0eee3 commit fdbc504
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
@@ -1,5 +1,11 @@
RUDY, CHANGES


#### 0.9.8.017 (2010-11-11) #######################

* FIXED: adduser handler checks for root before using sudo


#### 0.9.8.016 (2010-10-26) #######################

NOTE: If you're using Ubuntu you'll need to update your
Expand Down
10 changes: 8 additions & 2 deletions lib/rudy/routines/handlers/user.rb
Expand Up @@ -32,9 +32,15 @@ def adduser(user, robj)
# adduser can prompt for info which we don't want.
# useradd does not prompt (on Debian/Ubuntu at least).
# We need to specify bash b/c the default is /bin/sh
robj.sudo do
useradd args

if robj.user.to_s == 'root'
robj.useradd args
else
robj.sudo do
useradd args
end
end

end

def authorize(user, robj)
Expand Down

0 comments on commit fdbc504

Please sign in to comment.