summaryrefslogtreecommitdiffstats
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-05 00:51:50 -0800
committerJeremy Allison <jra@samba.org>2008-01-05 00:51:50 -0800
commitaf2a75ba61b754f30430df9b271e99d05c2cd1b2 (patch)
treefb50d2d5f8b8ea68d1190a71f3c07c2986484622 /source3/utils
parent1be3fcbf2f897b559bf72b72d54aa40805abd819 (diff)
downloadsamba-af2a75ba61b754f30430df9b271e99d05c2cd1b2.tar.gz
samba-af2a75ba61b754f30430df9b271e99d05c2cd1b2.tar.xz
samba-af2a75ba61b754f30430df9b271e99d05c2cd1b2.zip
Add -e to smbget.
Jeremy. (This used to be commit 0475bdcf44d21bbdefb57f15d403c91c44d8d90a)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbget.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index ac662e6acee..63b7f486267 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -521,9 +521,11 @@ int main(int argc, const char **argv)
int c = 0;
const char *file = NULL;
char *rcfile = NULL;
+ bool smb_encrypt = false;
TALLOC_CTX *frame = talloc_stackframe();
struct poptOption long_options[] = {
{"guest", 'a', POPT_ARG_NONE, NULL, 'a', "Work as user guest" },
+ {"encrypt", 'e', POPT_ARG_NONE, NULL, 'e', "Encrypt SMB transport (UNIX extended servers only)" },
{"resume", 'r', POPT_ARG_NONE, &_resume, 0, "Automatically resume aborted files" },
{"recursive", 'R', POPT_ARG_NONE, &_recursive, 0, "Recursively download files" },
{"username", 'u', POPT_ARG_STRING, &username, 'u', "Username to use" },
@@ -568,6 +570,9 @@ int main(int argc, const char **argv)
case 'a':
username = ""; password = "";
break;
+ case 'e':
+ smb_encrypt = true;
+ break;
}
}
@@ -586,6 +591,13 @@ int main(int argc, const char **argv)
return 1;
}
+ if (smb_encrypt) {
+ SMBCCTX *smb_ctx = smbc_set_context(NULL);
+ smbc_option_set(smb_ctx,
+ CONST_DISCARD(char *, "smb_encrypt_level"),
+ "require");
+ }
+
columns = get_num_cols();
total_start_time = time(NULL);