From ea1e6f9e7bc845ddf93a1603d7e43050be0e7917 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Thu, 11 Jan 2001 23:21:17 +0000 Subject: Changes from APPLIANCE_HEAD: source/lib/smbpasswd.c - Only call load_interfaces() when doing a network related operation. This means you can add, remove, enable or disable smbpasswd entries without a network. Changing passwords always requires a network. (This used to be commit e2193c3a360562dd66a16c8f23f8cf3eed20b8cf) --- source3/utils/smbpasswd.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source3/utils/smbpasswd.c') diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index d6a0c3dba8..cb86669728 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -327,6 +327,12 @@ static int process_root(int argc, char *argv[]) usage(); } + /* Only load interfaces if we are doing network operations. */ + + if (joining_domain || remote_machine) { + load_interfaces(); + } + if(joining_domain) { if (argc != 0) usage(); @@ -506,11 +512,13 @@ static int process_nonroot(int argc, char *argv[]) * via a remote machine (even if that machine is * localhost). */ + + load_interfaces(); /* Delayed from main() */ + if (remote_machine == NULL) { remote_machine = "127.0.0.1"; } - if (remote_machine != NULL) { old_passwd = get_pass("Old SMB password:",stdin_passwd_get); } @@ -585,7 +593,6 @@ int main(int argc, char **argv) codepage_initialise(lp_client_code_page()); - load_interfaces(); secrets_init(); /* Check the effective uid - make sure we are not setuid */ -- cgit