summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-08-14 07:33:34 +0000
committerLuke Leighton <lkcl@samba.org>2000-08-14 07:33:34 +0000
commitbecf055e785c5e3d8cebea75dff4caa61b701a62 (patch)
tree78e0c54525171315c34e8888a9e937a2dbbd0967
parenta19339b3ac4f4c850bd51140271f14dafcb23835 (diff)
downloadsamba-becf055e785c5e3d8cebea75dff4caa61b701a62.tar.gz
samba-becf055e785c5e3d8cebea75dff4caa61b701a62.tar.bz2
samba-becf055e785c5e3d8cebea75dff4caa61b701a62.zip
jeremy,
please do not remove IS_BITS_SET_XXX macros just because you happen "not to like them". whilst still working on merging, you are not responsible for this code, therefore do not hinder its development whilst people are attempting to do merges. after the merge from TNG to cvs main is completed, you can do what the hell you like. thank you. jerry, please could you consider adding underlying routines (in this case get_safe_smb_errstr()) instead of reverting to a [less secure] previous coding method. thanks. (This used to be commit b2e044f89de7cb12fd14540d5d7d5070951ce2fb)
-rw-r--r--source3/lib/cmd_interp.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/lib/cmd_interp.c b/source3/lib/cmd_interp.c
index 84fb28049a..458c2cdaeb 100644
--- a/source3/lib/cmd_interp.c
+++ b/source3/lib/cmd_interp.c
@@ -1091,7 +1091,8 @@ static uint32 cmd_set(struct client_info *info, int argc, char *argv[])
}
}
- if (cmd_set_options & CMD_INTER) {
+ if (IS_BITS_SET_ALL(cmd_set_options, CMD_INTER))
+ {
setup_logging(debugf, interactive);
if (!interactive)
reopen_logs();
@@ -1100,7 +1101,8 @@ static uint32 cmd_set(struct client_info *info, int argc, char *argv[])
strupper(global_myname);
fstrcpy(cli_info.myhostname, global_myname);
- if (cmd_set_options & CMD_SVC) {
+ if (IS_BITS_SET_ALL(cmd_set_options, CMD_SVC))
+ {
if (!lp_load(servicesf, True, False, False))
{
fprintf(stderr,
@@ -1110,23 +1112,26 @@ static uint32 cmd_set(struct client_info *info, int argc, char *argv[])
}
- if (cmd_set_options & CMD_INTER) {
+ if (IS_BITS_SET_ALL(cmd_set_options, CMD_INTER))
+ {
load_interfaces();
}
DEBUG(10, ("cmd_set: options: %x\n", cmd_set_options));
- if (cmd_set_options & CMD_HELP) {
+ if (IS_BITS_SET_ALL(cmd_set_options, CMD_HELP))
+ {
return 0;
}
- if (cmd_set_options & CMD_NOPW) {
+ if (IS_BITS_SET_ALL(cmd_set_options, CMD_NOPW))
+ {
set_user_password(&usr.ntc, True, NULL);
}
else
{
set_user_password(&usr.ntc,
- ((cmd_set_options & CMD_PASS) != 0),
+ IS_BITS_SET_ALL(cmd_set_options, CMD_PASS),
password);
}
@@ -1305,11 +1310,11 @@ int command_main(int argc, char *argv[])
status = cmd_set(&cli_info, argc, argv);
- if (cmd_set_options & (CMD_HELP|CMD_STR)) {
+ if (IS_BITS_SET_SOME(cmd_set_options, CMD_HELP|CMD_STR))
+ {
free_connections();
- get_safe_nt_error_msg(status, msg, sizeof(msg));
- report(out_hnd, "Exit Status: %s\n", msg);
+ report(out_hnd, "Exit Status: %s\n", get_nt_error_msg(status));
/* unix only has 8 bit error codes - blergh */
exit(status & 0xFF);
}
@@ -1325,8 +1330,7 @@ int command_main(int argc, char *argv[])
num_commands = 0;
commands = NULL;
- get_safe_nt_error_msg(status, msg, sizeof(msg));
- report(out_hnd, "Exit Status: %s\n", msg);
+ report(out_hnd, "Exit Status: %s\n", get_nt_error_msg(status));
return status;
}