summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c10
-rw-r--r--source3/smbd/password.c4
-rw-r--r--source3/smbd/reply.c47
3 files changed, 25 insertions, 36 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 4673c87f58..8147a3adac 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -718,7 +718,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
if( fname[0] == ':') {
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_OBJECT_PATH_NOT_FOUND));
+ return(ERROR(0, NT_STATUS_OBJECT_PATH_NOT_FOUND));
}
return(ERROR(ERRDOS,ERRbadfid));
}
@@ -848,7 +848,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
if (create_options & FILE_NON_DIRECTORY_FILE) {
restore_case_semantics(file_attributes);
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_FILE_IS_A_DIRECTORY));
+ return(ERROR(0, NT_STATUS_FILE_IS_A_DIRECTORY));
}
oplock_request = 0;
@@ -1140,7 +1140,7 @@ static int call_nt_transact_create(connection_struct *conn,
if( fname[0] == ':') {
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_OBJECT_PATH_NOT_FOUND));
+ return(ERROR(0, NT_STATUS_OBJECT_PATH_NOT_FOUND));
}
return(ERROR(ERRDOS,ERRbadfid));
@@ -1250,7 +1250,7 @@ static int call_nt_transact_create(connection_struct *conn,
if (create_options & FILE_NON_DIRECTORY_FILE) {
restore_case_semantics(file_attributes);
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_FILE_IS_A_DIRECTORY));
+ return(ERROR(0, NT_STATUS_FILE_IS_A_DIRECTORY));
}
oplock_request = 0;
@@ -1524,7 +1524,7 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
free_sec_desc(&psd);
- send_nt_replies(inbuf, outbuf, bufsize, 0xC0000000|NT_STATUS_BUFFER_TOO_SMALL,
+ send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_BUFFER_TOO_SMALL,
params, 4, *ppdata, 0);
return -1;
}
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index fffddb4610..f9291b8705 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -520,7 +520,7 @@ BOOL pass_check_smb(char *user, char *domain,
if(smb_pass->acct_ctrl & ACB_DISABLED) {
DEBUG(1,("Account for user '%s' was disabled.\n", user));
return(False);
- }
+ }
/* Ensure the uid's match */
if (smb_pass->smb_userid != pass->pw_uid)
@@ -529,7 +529,7 @@ BOOL pass_check_smb(char *user, char *domain,
return(False);
}
- if (lm_pwd[0] == '\0' && IS_BITS_SET_ALL(smb_pass->acct_ctrl, ACB_PWNOTREQ) && lp_null_passwords())
+ if (lm_pwd[0] == '\0' && (smb_pass->acct_ctrl & ACB_PWNOTREQ) && lp_null_passwords())
{
DEBUG(3,("Account for user '%s' has no password and null passwords are allowed.\n", smb_pass->smb_name));
return(True);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 8aa7f7c9e4..00697c999a 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -428,65 +428,54 @@ static int session_trust_account(connection_struct *conn, char *inbuf, char *out
char *smb_nt_passwd, int smb_nt_passlen)
{
struct smb_passwd *smb_trust_acct = NULL; /* check if trust account exists */
- if (lp_security() == SEC_USER)
- {
+ if (lp_security() == SEC_USER) {
smb_trust_acct = getsmbpwnam(user);
- }
- else
- {
+ } else {
DEBUG(0,("session_trust_account: Trust account %s only supported with security = user\n", user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_LOGON_FAILURE));
+ return(ERROR(0, NT_STATUS_LOGON_FAILURE));
}
- if (smb_trust_acct == NULL)
- {
+ if (smb_trust_acct == NULL) {
/* lkclXXXX: workstation entry doesn't exist */
DEBUG(0,("session_trust_account: Trust account %s user doesn't exist\n",user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_NO_SUCH_USER));
- }
- else
- {
- if ((smb_passlen != 24) || (smb_nt_passlen != 24))
- {
+ return(ERROR(0, NT_STATUS_NO_SUCH_USER));
+ } else {
+ if ((smb_passlen != 24) || (smb_nt_passlen != 24)) {
DEBUG(0,("session_trust_account: Trust account %s - password length wrong.\n", user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_LOGON_FAILURE));
+ return(ERROR(0, NT_STATUS_LOGON_FAILURE));
}
- if (!smb_password_ok(smb_trust_acct, NULL, (unsigned char *)smb_passwd, (unsigned char *)smb_nt_passwd))
- {
+ if (!smb_password_ok(smb_trust_acct, NULL, (unsigned char *)smb_passwd, (unsigned char *)smb_nt_passwd)) {
DEBUG(0,("session_trust_account: Trust Account %s - password failed\n", user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_LOGON_FAILURE));
+ return(ERROR(0, NT_STATUS_LOGON_FAILURE));
}
- if (IS_BITS_SET_ALL(smb_trust_acct->acct_ctrl, ACB_DOMTRUST))
- {
+ if (smb_trust_acct->acct_ctrl & ACB_DOMTRUST) {
DEBUG(0,("session_trust_account: Domain trust account %s denied by server\n",user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT));
+ return(ERROR(0, NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT));
}
- if (IS_BITS_SET_ALL(smb_trust_acct->acct_ctrl, ACB_SVRTRUST))
- {
+ if (smb_trust_acct->acct_ctrl & ACB_SVRTRUST) {
DEBUG(0,("session_trust_account: Server trust account %s denied by server\n",user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT));
+ return(ERROR(0, NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT));
}
- if (IS_BITS_SET_ALL(smb_trust_acct->acct_ctrl, ACB_WSTRUST))
- {
+ if (smb_trust_acct->acct_ctrl & ACB_WSTRUST) {
DEBUG(4,("session_trust_account: Wksta trust account %s denied by server\n", user));
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT));
+ return(ERROR(0, NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT));
}
}
/* don't know what to do: indicate logon failure */
SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0, 0xc0000000|NT_STATUS_LOGON_FAILURE));
+ return(ERROR(0, NT_STATUS_LOGON_FAILURE));
}
/****************************************************************************
@@ -637,7 +626,7 @@ static int bad_password_error(char *inbuf,char *outbuf)
if(((ra_type == RA_WINNT) || (ra_type == RA_WIN2K)) &&
(global_client_caps & (CAP_NT_SMBS | CAP_STATUS32 ))) {
SSVAL(outbuf,smb_flg2,FLAGS2_32_BIT_ERROR_CODES);
- return(ERROR(0,0xc0000000|NT_STATUS_LOGON_FAILURE));
+ return(ERROR(0,NT_STATUS_LOGON_FAILURE));
}
return(ERROR(ERRSRV,ERRbadpw));