Its doing what sudo should be doing. You are asking it to run the command gainroots. Since that command is not in the sudoers file it falls back to asking you for roots password in order to run the command gainroots.