We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24bb6b1 commit 831c7a0Copy full SHA for 831c7a0
modules/post/windows/gather/credentials/winscp.rb
@@ -114,6 +114,14 @@ def run
114
end
115
env = get_envs('APPDATA', prog_files_env, 'USERNAME')
116
117
+ if env['APPDATA'].nil?
118
+ fail_with(Failure::Unknown, 'Target does not hav environment variable APPDATA')
119
+ elsif env[prog_files_env].nil?
120
+ fail_with(Failure::Unknown, "Target does not hav environment variable #{prog_files_env}")
121
+ elsif env['USERNAME'].nil?
122
+ fail_with(Failure::Unknown, 'Target does not hav environment variable USERNAME')
123
+ end
124
+
125
user_dir = "#{env['APPDATA']}\\..\\.."
126
user_dir << "\\.." if user_dir.include?('Users')
127
0 commit comments