mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f709a9231860ceb9682db40ff26c9a66)
This commit is contained in:
parent
55cf37488f
commit
19fea3242c
@ -68,15 +68,15 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info,
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
}
|
||||
|
||||
if (nt_status != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
nt_status = check_rhosts_security(user_info, server_info);
|
||||
}
|
||||
|
||||
if ((lp_security() == SEC_DOMAIN) && (nt_status != NT_STATUS_OK)) {
|
||||
if ((lp_security() == SEC_DOMAIN) && !NT_STATUS_IS_OK(nt_status)) {
|
||||
nt_status = check_domain_security(user_info, server_info);
|
||||
}
|
||||
|
||||
if ((lp_security() == SEC_SERVER) && (nt_status != NT_STATUS_OK)) {
|
||||
if ((lp_security() == SEC_SERVER) && !NT_STATUS_IS_OK(nt_status)) {
|
||||
nt_status = check_server_security(user_info, server_info);
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info,
|
||||
smb_user_control(user_info->smb_username.str, nt_status);
|
||||
}
|
||||
|
||||
if (nt_status != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
if ((user_info->plaintext_password.len > 0)
|
||||
&& (!lp_plaintext_to_smbpasswd())) {
|
||||
nt_status = check_unix_security(user_info, server_info);
|
||||
@ -94,14 +94,14 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info,
|
||||
}
|
||||
}
|
||||
|
||||
if ((nt_status == NT_STATUS_OK) && !done_pam) {
|
||||
if (NT_STATUS_IS_OK(nt_status) && !done_pam) {
|
||||
/* We might not be root if we are an RPC call */
|
||||
become_root();
|
||||
nt_status = smb_pam_accountcheck(user_info->smb_username.str);
|
||||
unbecome_root();
|
||||
}
|
||||
|
||||
if (nt_status == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG(5, ("check_password: Password for user %s suceeded\n", user_info->smb_username.str));
|
||||
} else {
|
||||
DEBUG(3, ("check_password: Password for user %s FAILED with error %s\n", user_info->smb_username.str, get_nt_error_msg(nt_status)));
|
||||
@ -233,11 +233,11 @@ BOOL password_ok(char *user, char *password, int pwlen)
|
||||
|
||||
/* The password could be either NTLM or plain LM. Try NTLM first, but fall-through as
|
||||
required. */
|
||||
if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen))) {
|
||||
return True;
|
||||
}
|
||||
|
||||
if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0))) {
|
||||
return True;
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,10 @@ BOOL global_machine_password_needs_changing = False;
|
||||
Check for a valid username and password in security=domain mode.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_domain_security(const auth_usersupplied_info *user_info,
|
||||
auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_domain_security(const auth_usersupplied_info *user_info,
|
||||
auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
char *p, *pserver;
|
||||
unsigned char trust_passwd[16];
|
||||
time_t last_change_time;
|
||||
|
@ -168,10 +168,10 @@ BOOL check_hosts_equiv(char *user)
|
||||
Check for a valid .rhosts/hosts.equiv entry for this user
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_rhosts_security(const auth_usersupplied_info *user_info,
|
||||
NTSTATUS check_rhosts_security(const auth_usersupplied_info *user_info,
|
||||
auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
become_root();
|
||||
if (check_hosts_equiv(user_info->smb_username.str)) {
|
||||
|
@ -109,7 +109,7 @@ static BOOL smb_pwd_check_ntlmv2(const uchar *password, size_t pwd_len,
|
||||
Do a specific test for an smb password being correct, given a smb_password and
|
||||
the lanman and NT responses.
|
||||
****************************************************************************/
|
||||
uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint8 *nt_pw, *lm_pw;
|
||||
uint16 acct_ctrl;
|
||||
@ -202,11 +202,11 @@ SMB hash supplied in the user_info structure
|
||||
return an NT_STATUS constant.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
SAM_ACCOUNT *sampass=NULL;
|
||||
BOOL ret;
|
||||
uint32 nt_status;
|
||||
NTSTATUS nt_status;
|
||||
|
||||
pdb_init_sam(&sampass);
|
||||
|
||||
@ -220,7 +220,7 @@ uint32 check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_se
|
||||
{
|
||||
DEBUG(1,("Couldn't find user '%s' in passdb file.\n", user_info->smb_username.str));
|
||||
pdb_free_sam(sampass);
|
||||
return(NT_STATUS_NO_SUCH_USER);
|
||||
return NT_STATUS_NO_SUCH_USER;
|
||||
}
|
||||
|
||||
nt_status = smb_password_ok(sampass, user_info, server_info);
|
||||
|
@ -113,14 +113,14 @@ struct cli_state *server_cryptkey(void)
|
||||
Validate a password with the password server.
|
||||
****************************************************************************/
|
||||
|
||||
static uint32 server_validate(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
static NTSTATUS server_validate(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
struct cli_state *cli;
|
||||
static unsigned char badpass[24];
|
||||
static fstring baduser;
|
||||
static BOOL tested_password_server = False;
|
||||
static BOOL bad_password_server = False;
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
cli = server_client();
|
||||
|
||||
@ -232,14 +232,13 @@ use this machine as the password server.\n"));
|
||||
Check for a valid username and password in security=server mode.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_server_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_server_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
|
||||
if(lp_security() != SEC_SERVER)
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
return server_validate(user_info, server_info);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,9 +68,9 @@ check if a username/password is OK assuming the password
|
||||
in PLAIN TEXT
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_unix_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_unix_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint32 nt_status;
|
||||
NTSTATUS nt_status;
|
||||
|
||||
become_root();
|
||||
nt_status = (pass_check(user_info->smb_username.str, user_info->plaintext_password.str,
|
||||
|
@ -101,11 +101,11 @@ static int smb_delete_user(char *unix_user)
|
||||
Add and Delete UNIX users on demand, based on NT_STATUS codes.
|
||||
****************************************************************************/
|
||||
|
||||
void smb_user_control(char *unix_user, uint32 nt_status)
|
||||
void smb_user_control(char *unix_user, NTSTATUS nt_status)
|
||||
{
|
||||
struct passwd *pwd=NULL;
|
||||
|
||||
if(nt_status == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(nt_status)) {
|
||||
/*
|
||||
* User validated ok against Domain controller.
|
||||
* If the admin wants us to try and create a UNIX
|
||||
@ -127,7 +127,7 @@ void smb_user_control(char *unix_user, uint32 nt_status)
|
||||
smb_create_user(unix_user, pwd->pw_dir);
|
||||
}
|
||||
|
||||
} else if (nt_status == NT_STATUS_NO_SUCH_USER) {
|
||||
} else if (NT_STATUS_V(nt_status) == NT_STATUS_V(NT_STATUS_NO_SUCH_USER)) {
|
||||
/*
|
||||
* User failed to validate ok against Domain controller.
|
||||
* If the failure was "user doesn't exist" and admin
|
||||
|
@ -83,12 +83,13 @@ static BOOL smb_pam_error_handler(pam_handle_t *pamh, int pam_error, char *msg,
|
||||
*********************************************************************/
|
||||
|
||||
static BOOL smb_pam_nt_status_error_handler(pam_handle_t *pamh, int pam_error,
|
||||
char *msg, int dbglvl, uint32 *nt_status)
|
||||
char *msg, int dbglvl,
|
||||
NTSTATUS *nt_status)
|
||||
{
|
||||
if (smb_pam_error_handler(pamh, pam_error, msg, dbglvl))
|
||||
return True;
|
||||
|
||||
if (*nt_status == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(*nt_status)) {
|
||||
/* Complain LOUDLY */
|
||||
DEBUG(0, ("smb_pam_nt_status_error_handler: PAM: BUG: PAM and NT_STATUS \
|
||||
error MISMATCH, forcing to NT_STATUS_LOGON_FAILURE"));
|
||||
@ -494,10 +495,10 @@ static BOOL smb_pam_start(pam_handle_t **pamh, char *user, char *rhost, struct p
|
||||
/*
|
||||
* PAM Authentication Handler
|
||||
*/
|
||||
static uint32 smb_pam_auth(pam_handle_t *pamh, char *user)
|
||||
static NTSTATUS smb_pam_auth(pam_handle_t *pamh, char *user)
|
||||
{
|
||||
int pam_error;
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
/*
|
||||
* To enable debugging set in /etc/pam.d/samba:
|
||||
@ -548,10 +549,10 @@ static uint32 smb_pam_auth(pam_handle_t *pamh, char *user)
|
||||
/*
|
||||
* PAM Account Handler
|
||||
*/
|
||||
static uint32 smb_pam_account(pam_handle_t *pamh, char * user)
|
||||
static NTSTATUS smb_pam_account(pam_handle_t *pamh, char * user)
|
||||
{
|
||||
int pam_error;
|
||||
uint32 nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
NTSTATUS nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
|
||||
DEBUG(4,("smb_pam_account: PAM: Account Management for User: %s\n", user));
|
||||
pam_error = pam_acct_mgmt(pamh, PAM_SILENT); /* Is user account enabled? */
|
||||
@ -594,10 +595,10 @@ static uint32 smb_pam_account(pam_handle_t *pamh, char * user)
|
||||
* PAM Credential Setting
|
||||
*/
|
||||
|
||||
static uint32 smb_pam_setcred(pam_handle_t *pamh, char * user)
|
||||
static NTSTATUS smb_pam_setcred(pam_handle_t *pamh, char * user)
|
||||
{
|
||||
int pam_error;
|
||||
uint32 nt_status = NT_STATUS_NO_TOKEN;
|
||||
NTSTATUS nt_status = NT_STATUS_NO_TOKEN;
|
||||
|
||||
/*
|
||||
* This will allow samba to aquire a kerberos token. And, when
|
||||
@ -778,9 +779,9 @@ BOOL smb_pam_close_session(char *user, char *tty, char *rhost)
|
||||
* PAM Externally accessible Account handler
|
||||
*/
|
||||
|
||||
uint32 smb_pam_accountcheck(char * user)
|
||||
NTSTATUS smb_pam_accountcheck(char * user)
|
||||
{
|
||||
uint32 nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
NTSTATUS nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
pam_handle_t *pamh = NULL;
|
||||
struct pam_conv *pconv = NULL;
|
||||
|
||||
@ -790,12 +791,12 @@ uint32 smb_pam_accountcheck(char * user)
|
||||
return NT_STATUS_OK;
|
||||
|
||||
if ((pconv = smb_setup_pam_conv(smb_pam_conv, user, NULL, NULL)) == NULL)
|
||||
return False;
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
if (!smb_pam_start(&pamh, user, NULL, pconv))
|
||||
return NT_STATUS_ACCOUNT_DISABLED;
|
||||
|
||||
if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK)
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_account(pamh, user)))
|
||||
DEBUG(0, ("smb_pam_accountcheck: PAM: Account Validation Failed - Rejecting User %s!\n", user));
|
||||
|
||||
smb_pam_end(pamh, pconv);
|
||||
@ -806,10 +807,10 @@ uint32 smb_pam_accountcheck(char * user)
|
||||
* PAM Password Validation Suite
|
||||
*/
|
||||
|
||||
uint32 smb_pam_passcheck(char * user, char * password)
|
||||
NTSTATUS smb_pam_passcheck(char * user, char * password)
|
||||
{
|
||||
pam_handle_t *pamh = NULL;
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
struct pam_conv *pconv = NULL;
|
||||
|
||||
/*
|
||||
@ -824,19 +825,19 @@ uint32 smb_pam_passcheck(char * user, char * password)
|
||||
if (!smb_pam_start(&pamh, user, NULL, pconv))
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
if ((nt_status = smb_pam_auth(pamh, user)) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_auth(pamh, user))) {
|
||||
DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User %s !\n", user));
|
||||
smb_pam_end(pamh, pconv);
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_account(pamh, user))) {
|
||||
DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_account failed - Rejecting User %s !\n", user));
|
||||
smb_pam_end(pamh, pconv);
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
if ((nt_status = smb_pam_setcred(pamh, user)) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_setcred(pamh, user))) {
|
||||
DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_setcred failed - Rejecting User %s !\n", user));
|
||||
smb_pam_end(pamh, pconv);
|
||||
return nt_status;
|
||||
|
@ -599,7 +599,7 @@ static BOOL password_check(char *password)
|
||||
{
|
||||
|
||||
#ifdef WITH_PAM
|
||||
return (smb_pam_passcheck(this_user, password) == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(smb_pam_passcheck(this_user, password));
|
||||
#endif /* WITH_PAM */
|
||||
|
||||
#ifdef WITH_AFS
|
||||
|
@ -48,7 +48,7 @@ static int max_protocol = PROTOCOL_NT1;
|
||||
extern pstring user_socket_options;
|
||||
|
||||
static int process_tok(fstring tok);
|
||||
static void cmd_help(void);
|
||||
static NTSTATUS cmd_help(void);
|
||||
|
||||
/* 30 second timeout on most commands */
|
||||
#define CLIENT_TIMEOUT (30*1000)
|
||||
@ -1787,7 +1787,7 @@ static int process_tok(fstring tok)
|
||||
/****************************************************************************
|
||||
help
|
||||
****************************************************************************/
|
||||
static void cmd_help(void)
|
||||
static NTSTATUS cmd_help(void)
|
||||
{
|
||||
int i=0,j;
|
||||
fstring buf;
|
||||
@ -1804,6 +1804,7 @@ static void cmd_help(void)
|
||||
DEBUG(0,("\n"));
|
||||
}
|
||||
}
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -141,14 +141,21 @@
|
||||
#define WERR_BADFUNC W_ERROR(1)
|
||||
#define WERR_INSUFFICIENT_BUFFER W_ERROR(122)
|
||||
#define WERR_INVALID_PARAM W_ERROR(87)
|
||||
#define WERR_NOT_SUPPORTED W_ERROR(50)
|
||||
#define WERR_BAD_PASSWORD W_ERROR(86)
|
||||
#define WERR_NOMEM W_ERROR(8)
|
||||
#define WERR_INVALID_NAME W_ERROR(123)
|
||||
#define WERR_UNKNOWN_LEVEL W_ERROR(124)
|
||||
#define WERR_NO_MORE_ITEMS W_ERROR(259)
|
||||
#define WERR_MORE_DATA W_ERROR(234)
|
||||
#define WERR_UNKNOWN_PRINTER_DRIVER W_ERROR(1797)
|
||||
#define WERR_INVALID_PRINTER_NAME W_ERROR(1801)
|
||||
#define WERR_INVALID_DATATYPE W_ERROR(1804)
|
||||
#define WERR_INVALID_ENVIRONMENT W_ERROR(1805)
|
||||
#define WERR_BUF_TOO_SMALL W_ERROR(2123)
|
||||
#define WERR_JOB_NOT_FOUND W_ERROR(2151)
|
||||
#define WERR_DEST_NOT_FOUND W_ERROR(2152)
|
||||
#define WERR_PRINTER_DRIVER_IN_USE W_ERROR(3001)
|
||||
#define WERR_STATUS_MORE_ENTRIES W_ERROR(0x0105)
|
||||
|
||||
#endif /* _DOSERR_H */
|
||||
|
@ -231,7 +231,7 @@ typedef struct nt_printer_info_level_2
|
||||
uint32 default_priority;
|
||||
uint32 starttime;
|
||||
uint32 untiltime;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
uint32 cjobs;
|
||||
uint32 averageppm;
|
||||
fstring servername;
|
||||
|
@ -55,7 +55,7 @@ DFS_Q_DFS_EXIST;
|
||||
/* status == 1 if dfs exists. */
|
||||
typedef struct dfs_r_dfs_exist
|
||||
{
|
||||
NTSTATUS status;
|
||||
uint32 status;
|
||||
}
|
||||
DFS_R_DFS_EXIST;
|
||||
|
||||
|
@ -365,7 +365,6 @@ typedef struct lsa_r_lookup_names
|
||||
uint32 mapped_count;
|
||||
|
||||
NTSTATUS status; /* return code */
|
||||
|
||||
} LSA_R_LOOKUP_NAMES;
|
||||
|
||||
/* This is probably a policy handle but at the moment we
|
||||
|
@ -363,11 +363,9 @@ typedef struct net_q_auth2_info
|
||||
/* NET_R_AUTH_2 */
|
||||
typedef struct net_r_auth2_info
|
||||
{
|
||||
DOM_CHAL srv_chal; /* server-calculated credentials */
|
||||
NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
|
||||
|
||||
NTSTATUS status; /* return code */
|
||||
|
||||
DOM_CHAL srv_chal; /* server-calculated credentials */
|
||||
NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
|
||||
NTSTATUS status; /* return code */
|
||||
} NET_R_AUTH_2;
|
||||
|
||||
|
||||
@ -725,7 +723,7 @@ typedef struct net_r_sam_sync_info
|
||||
SAM_DELTA_HDR *hdr_deltas;
|
||||
SAM_DELTA_CTR *deltas;
|
||||
|
||||
uint32 status;
|
||||
NTSTATUS status;
|
||||
} NET_R_SAM_SYNC;
|
||||
|
||||
/* NET_Q_SAM_DELTAS */
|
||||
@ -757,8 +755,7 @@ typedef struct net_r_sam_deltas_info
|
||||
SAM_DELTA_HDR *hdr_deltas;
|
||||
SAM_DELTA_CTR *deltas;
|
||||
|
||||
uint32 status;
|
||||
|
||||
NTSTATUS status;
|
||||
} NET_R_SAM_DELTAS;
|
||||
|
||||
#endif /* _RPC_NETLOGON_H */
|
||||
|
@ -460,8 +460,7 @@ SPOOL_Q_OPEN_PRINTER_EX;
|
||||
typedef struct spool_r_open_printer_ex
|
||||
{
|
||||
POLICY_HND handle; /* handle used along all transactions (20*uint8) */
|
||||
NTSTATUS status;
|
||||
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_OPEN_PRINTER_EX;
|
||||
|
||||
@ -523,7 +522,7 @@ typedef struct spool_r_getprinterdata
|
||||
uint32 size;
|
||||
uint8 *data;
|
||||
uint32 needed;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_GETPRINTERDATA;
|
||||
|
||||
@ -536,7 +535,7 @@ SPOOL_Q_DELETEPRINTERDATA;
|
||||
|
||||
typedef struct spool_r_deleteprinterdata
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_DELETEPRINTERDATA;
|
||||
|
||||
@ -549,7 +548,7 @@ SPOOL_Q_CLOSEPRINTER;
|
||||
typedef struct spool_r_closeprinter
|
||||
{
|
||||
POLICY_HND handle;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_CLOSEPRINTER;
|
||||
|
||||
@ -561,7 +560,7 @@ SPOOL_Q_STARTPAGEPRINTER;
|
||||
|
||||
typedef struct spool_r_startpageprinter
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_STARTPAGEPRINTER;
|
||||
|
||||
@ -573,7 +572,7 @@ SPOOL_Q_ENDPAGEPRINTER;
|
||||
|
||||
typedef struct spool_r_endpageprinter
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENDPAGEPRINTER;
|
||||
|
||||
@ -589,7 +588,7 @@ SPOOL_Q_DELETEPRINTERDRIVER;
|
||||
|
||||
typedef struct spool_r_deleteprinterdriver
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_DELETEPRINTERDRIVER;
|
||||
|
||||
@ -641,7 +640,7 @@ SPOOL_Q_ENDDOCPRINTER;
|
||||
|
||||
typedef struct spool_r_enddocprinter
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENDDOCPRINTER;
|
||||
|
||||
@ -657,7 +656,7 @@ SPOOL_Q_WRITEPRINTER;
|
||||
typedef struct spool_r_writeprinter
|
||||
{
|
||||
uint32 buffer_written;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_WRITEPRINTER;
|
||||
|
||||
@ -718,7 +717,7 @@ SPOOL_Q_RFFPCNEX;
|
||||
|
||||
typedef struct spool_r_rffpcnex
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_RFFPCNEX;
|
||||
|
||||
@ -749,7 +748,7 @@ SPOOL_Q_FCPN;
|
||||
|
||||
typedef struct spool_r_fcpn
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_FCPN;
|
||||
|
||||
@ -1010,7 +1009,7 @@ typedef struct spool_r_addjob
|
||||
{
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ADDJOB;
|
||||
|
||||
@ -1042,7 +1041,7 @@ typedef struct s_job_info_1
|
||||
UNISTR document;
|
||||
UNISTR datatype;
|
||||
UNISTR text_status;
|
||||
NTSTATUS status;
|
||||
uint32 status;
|
||||
uint32 priority;
|
||||
uint32 position;
|
||||
uint32 totalpages;
|
||||
@ -1066,7 +1065,7 @@ typedef struct s_job_info_2
|
||||
DEVICEMODE *devmode;
|
||||
UNISTR text_status;
|
||||
/* SEC_DESC sec_desc;*/
|
||||
NTSTATUS status;
|
||||
uint32 status;
|
||||
uint32 priority;
|
||||
uint32 position;
|
||||
uint32 starttime;
|
||||
@ -1106,7 +1105,7 @@ typedef struct spool_r_enumjobs
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
uint32 returned;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMJOBS;
|
||||
|
||||
@ -1119,7 +1118,7 @@ SPOOL_Q_SCHEDULEJOB;
|
||||
|
||||
typedef struct spool_r_schedulejob
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_SCHEDULEJOB;
|
||||
|
||||
@ -1166,7 +1165,7 @@ typedef struct spool_r_enumports
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed; /* bytes needed */
|
||||
uint32 returned; /* number of printers */
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMPORTS;
|
||||
|
||||
@ -1201,7 +1200,7 @@ SPOOL_Q_SETJOB;
|
||||
|
||||
typedef struct spool_r_setjob
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
|
||||
}
|
||||
SPOOL_R_SETJOB;
|
||||
@ -1223,7 +1222,7 @@ typedef struct spool_r_enumprinterdrivers
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
uint32 returned;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMPRINTERDRIVERS;
|
||||
|
||||
@ -1254,7 +1253,7 @@ typedef struct spool_r_enumforms
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
uint32 numofforms;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMFORMS;
|
||||
|
||||
@ -1272,7 +1271,7 @@ typedef struct spool_r_getform
|
||||
{
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_GETFORM;
|
||||
|
||||
@ -1307,7 +1306,7 @@ typedef struct spool_printer_info_level_2
|
||||
uint32 default_priority;
|
||||
uint32 starttime;
|
||||
uint32 untiltime;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
uint32 cjobs;
|
||||
uint32 averageppm;
|
||||
UNISTR2 servername;
|
||||
@ -1454,7 +1453,7 @@ SPOOL_Q_SETPRINTER;
|
||||
|
||||
typedef struct spool_r_setprinter
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_SETPRINTER;
|
||||
|
||||
@ -1474,7 +1473,7 @@ SPOOL_Q_ADDPRINTER;
|
||||
|
||||
typedef struct spool_r_addprinter
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ADDPRINTER;
|
||||
|
||||
@ -1487,7 +1486,7 @@ SPOOL_Q_DELETEPRINTER;
|
||||
typedef struct spool_r_deleteprinter
|
||||
{
|
||||
POLICY_HND handle;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_DELETEPRINTER;
|
||||
|
||||
@ -1499,7 +1498,7 @@ SPOOL_Q_ABORTPRINTER;
|
||||
|
||||
typedef struct spool_r_abortprinter
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ABORTPRINTER;
|
||||
|
||||
@ -1522,7 +1521,7 @@ SPOOL_Q_ADDPRINTEREX;
|
||||
typedef struct spool_r_addprinterex
|
||||
{
|
||||
POLICY_HND handle;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ADDPRINTEREX;
|
||||
|
||||
@ -1538,7 +1537,7 @@ SPOOL_Q_ADDPRINTERDRIVER;
|
||||
|
||||
typedef struct spool_r_addprinterdriver
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ADDPRINTERDRIVER;
|
||||
|
||||
@ -1571,7 +1570,7 @@ typedef struct spool_r_getprinterdriverdirectory
|
||||
{
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_GETPRINTERDRIVERDIR;
|
||||
|
||||
@ -1587,7 +1586,7 @@ SPOOL_Q_ADDPRINTPROCESSOR;
|
||||
|
||||
typedef struct spool_r_addprintprocessor
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ADDPRINTPROCESSOR;
|
||||
|
||||
@ -1615,7 +1614,7 @@ typedef struct spool_r_enumprintprocessors
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
uint32 returned;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMPRINTPROCESSORS;
|
||||
|
||||
@ -1642,7 +1641,7 @@ typedef struct spool_r_enumprintprocdatatypes
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
uint32 returned;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMPRINTPROCDATATYPES;
|
||||
|
||||
@ -1675,7 +1674,7 @@ typedef struct spool_r_enumprintmonitors
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
uint32 returned;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMPRINTMONITORS;
|
||||
|
||||
@ -1698,7 +1697,7 @@ typedef struct spool_r_enumprinterdata
|
||||
uint32 datasize;
|
||||
uint8 *data;
|
||||
uint32 realdatasize;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ENUMPRINTERDATA;
|
||||
|
||||
@ -1716,7 +1715,7 @@ SPOOL_Q_SETPRINTERDATA;
|
||||
|
||||
typedef struct spool_r_setprinterdata
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_SETPRINTERDATA;
|
||||
|
||||
@ -1745,7 +1744,7 @@ SPOOL_Q_ADDFORM;
|
||||
|
||||
typedef struct spool_r_addform
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_ADDFORM;
|
||||
|
||||
@ -1761,7 +1760,7 @@ SPOOL_Q_SETFORM;
|
||||
|
||||
typedef struct spool_r_setform
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_SETFORM;
|
||||
|
||||
@ -1774,7 +1773,7 @@ SPOOL_Q_DELETEFORM;
|
||||
|
||||
typedef struct spool_r_deleteform
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_DELETEFORM;
|
||||
|
||||
@ -1805,7 +1804,7 @@ typedef struct spool_r_getjob
|
||||
{
|
||||
NEW_BUFFER *buffer;
|
||||
uint32 needed;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_GETJOB;
|
||||
|
||||
@ -1822,7 +1821,7 @@ SPOOL_Q_REPLYOPENPRINTER;
|
||||
typedef struct spool_r_replyopenprinter
|
||||
{
|
||||
POLICY_HND handle;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_REPLYOPENPRINTER;
|
||||
|
||||
@ -1835,7 +1834,7 @@ SPOOL_Q_REPLYCLOSEPRINTER;
|
||||
typedef struct spool_r_replycloseprinter
|
||||
{
|
||||
POLICY_HND handle;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_REPLYCLOSEPRINTER;
|
||||
|
||||
@ -1854,7 +1853,7 @@ SPOOL_Q_REPLY_RRPCN;
|
||||
typedef struct spool_r_rrpcn
|
||||
{
|
||||
uint32 unknown0;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
}
|
||||
SPOOL_R_REPLY_RRPCN;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
struct cmd_set {
|
||||
char *name;
|
||||
uint32 (*fn)(struct cli_state*, int argc, char **argv);
|
||||
NTSTATUS (*fn)(struct cli_state*, int argc, char **argv);
|
||||
char *description;
|
||||
char *usage;
|
||||
};
|
||||
|
@ -26,7 +26,7 @@
|
||||
struct {
|
||||
int unix_error;
|
||||
int dos_error;
|
||||
uint32 nt_error;
|
||||
NTSTATUS nt_error;
|
||||
} unix_dos_nt_errmap[] = {
|
||||
{ EPERM, ERRnoaccess, NT_STATUS_ACCESS_DENIED },
|
||||
{ EACCES, ERRnoaccess, NT_STATUS_ACCESS_DENIED },
|
||||
@ -50,7 +50,7 @@ struct {
|
||||
#endif
|
||||
{ EROFS, ERRnowrite, NT_STATUS_ACCESS_DENIED },
|
||||
|
||||
{ 0, 0, 0 }
|
||||
{ 0, 0, NT_STATUS_OK }
|
||||
};
|
||||
|
||||
/* Map an NT error code from a Unix error code */
|
||||
|
@ -78,7 +78,7 @@ NTSTATUS cli_lsa_open_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*pol = r.pol;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ NTSTATUS cli_lsa_open_policy2(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*pol = r.pol;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ NTSTATUS cli_lsa_close(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*pol = r.pol;
|
||||
}
|
||||
|
||||
@ -242,8 +242,9 @@ NTSTATUS cli_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
result = r.status;
|
||||
|
||||
if (result != NT_STATUS_OK && result != 0x00000107 &&
|
||||
result != (0xC0000000 | NT_STATUS_NONE_MAPPED)) {
|
||||
if (!NT_STATUS_IS_OK(result) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(NT_STATUS_FILES_OPEN) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(NT_STATUS_NONE_MAPPED)) {
|
||||
|
||||
/* An actual error occured */
|
||||
|
||||
@ -347,8 +348,8 @@ NTSTATUS cli_lsa_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
result = r.status;
|
||||
|
||||
if (result != NT_STATUS_OK &&
|
||||
result != (0xC0000000 | NT_STATUS_NONE_MAPPED)) {
|
||||
if (!NT_STATUS_IS_OK(result) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(NT_STATUS_NONE_MAPPED)) {
|
||||
|
||||
/* An actual error occured */
|
||||
|
||||
@ -441,7 +442,7 @@ NTSTATUS cli_lsa_query_info_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -536,8 +537,8 @@ NTSTATUS cli_lsa_enum_trust_dom(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
0x8000001a (NT_STATUS_UNABLE_TO_FREE_VM) so we ignore it and
|
||||
pretend everything is OK. */
|
||||
|
||||
if (result != NT_STATUS_OK &&
|
||||
result != NT_STATUS_UNABLE_TO_FREE_VM) {
|
||||
if (!NT_STATUS_IS_OK(result) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(NT_STATUS_UNABLE_TO_FREE_VM)) {
|
||||
|
||||
/* An actual error ocured */
|
||||
|
||||
|
@ -47,7 +47,7 @@ NTSTATUS cli_reg_shutdown(struct cli_state * cli, TALLOC_CTX *mem_ctx,
|
||||
REG_R_SHUTDOWN r_s;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
|
||||
if (msg == NULL) return False;
|
||||
if (msg == NULL) return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
ZERO_STRUCT (q_s);
|
||||
ZERO_STRUCT (r_s);
|
||||
|
@ -68,7 +68,7 @@ NTSTATUS cli_samr_connect(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*connect_pol = r.connect_pol;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ NTSTATUS cli_samr_close(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*connect_pol = r.pol;
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ NTSTATUS cli_samr_open_domain(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*domain_pol = r.domain_pol;
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ NTSTATUS cli_samr_open_user(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*user_pol = r.user_pol;
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ NTSTATUS cli_samr_open_group(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*group_pol = r.pol;
|
||||
}
|
||||
|
||||
@ -395,7 +395,7 @@ NTSTATUS cli_samr_query_usergroups(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*num_groups = r.num_entries;
|
||||
*gid = r.gid;
|
||||
}
|
||||
@ -443,7 +443,7 @@ NTSTATUS cli_samr_query_groupmem(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*num_mem = r.num_entries;
|
||||
*rid = r.rid;
|
||||
*attr = r.attr;
|
||||
@ -466,7 +466,8 @@ NTSTATUS cli_samr_enum_dom_groups(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
prs_struct qbuf, rbuf;
|
||||
SAMR_Q_ENUM_DOM_GROUPS q;
|
||||
SAMR_R_ENUM_DOM_GROUPS r;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL, name_idx, i;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
uint32 name_idx, i;
|
||||
|
||||
ZERO_STRUCT(q);
|
||||
ZERO_STRUCT(r);
|
||||
@ -495,8 +496,8 @@ NTSTATUS cli_samr_enum_dom_groups(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
result = r.status;
|
||||
|
||||
if (result != NT_STATUS_OK &&
|
||||
result != STATUS_MORE_ENTRIES) {
|
||||
if (!NT_STATUS_IS_OK(result) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -542,7 +543,8 @@ NTSTATUS cli_samr_query_aliasmem(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
prs_struct qbuf, rbuf;
|
||||
SAMR_Q_QUERY_ALIASMEM q;
|
||||
SAMR_R_QUERY_ALIASMEM r;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL, i;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
uint32 i;
|
||||
|
||||
ZERO_STRUCT(q);
|
||||
ZERO_STRUCT(r);
|
||||
@ -569,7 +571,7 @@ NTSTATUS cli_samr_query_aliasmem(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -629,7 +631,7 @@ NTSTATUS cli_samr_open_alias(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result = r.status)) {
|
||||
*alias_pol = r.pol;
|
||||
}
|
||||
|
||||
@ -678,7 +680,7 @@ NTSTATUS cli_samr_query_dom_info(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -731,8 +733,8 @@ NTSTATUS cli_samr_query_dispinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
result = r.status;
|
||||
|
||||
if (result != NT_STATUS_OK &&
|
||||
result != STATUS_MORE_ENTRIES) {
|
||||
if (!NT_STATUS_IS_OK(result) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -758,7 +760,8 @@ NTSTATUS cli_samr_lookup_rids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
prs_struct qbuf, rbuf;
|
||||
SAMR_Q_LOOKUP_RIDS q;
|
||||
SAMR_R_LOOKUP_RIDS r;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL, i;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
uint32 i;
|
||||
|
||||
if (num_rids > 1000) {
|
||||
DEBUG(2, ("cli_samr_lookup_rids: warning: NT4 can crash if "
|
||||
@ -791,7 +794,7 @@ NTSTATUS cli_samr_lookup_rids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -831,7 +834,8 @@ NTSTATUS cli_samr_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
prs_struct qbuf, rbuf;
|
||||
SAMR_Q_LOOKUP_NAMES q;
|
||||
SAMR_R_LOOKUP_NAMES r;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL, i;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
uint32 i;
|
||||
|
||||
ZERO_STRUCT(q);
|
||||
ZERO_STRUCT(r);
|
||||
@ -859,7 +863,7 @@ NTSTATUS cli_samr_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -921,7 +925,7 @@ NTSTATUS cli_samr_create_dom_user(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -977,7 +981,7 @@ NTSTATUS cli_samr_set_userinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -1024,7 +1028,7 @@ NTSTATUS cli_samr_set_userinfo2(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result = r.status)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -84,8 +84,11 @@ NTSTATUS cli_spoolss_open_printer_ex(
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (W_ERROR_IS_OK(r.status)) {
|
||||
result = NT_STATUS_OK;
|
||||
*pol = r.handle;
|
||||
} else {
|
||||
result = werror_to_ntstatus(r.status);
|
||||
}
|
||||
|
||||
done:
|
||||
@ -137,8 +140,11 @@ NTSTATUS cli_spoolss_close_printer(
|
||||
|
||||
/* Return output parameters */
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
if (W_ERROR_IS_OK(r.status)) {
|
||||
*pol = r.handle;
|
||||
result = NT_STATUS_OK;
|
||||
} else {
|
||||
result = werror_to_ntstatus(r.status);
|
||||
}
|
||||
|
||||
done:
|
||||
@ -428,10 +434,12 @@ NTSTATUS cli_spoolss_enum_printers(
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
if (!W_ERROR_IS_OK(r.status)) {
|
||||
result = werror_to_ntstatus(r.status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (((result=r.status) == NT_STATUS_OK) && (*returned = r.returned))
|
||||
{
|
||||
|
||||
if ((*returned = r.returned)) {
|
||||
switch (level) {
|
||||
case 1:
|
||||
decode_printer_info_1(mem_ctx, r.buffer, r.returned,
|
||||
@ -452,7 +460,7 @@ NTSTATUS cli_spoolss_enum_printers(
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
} while (result == ERROR_INSUFFICIENT_BUFFER);
|
||||
} while (NT_STATUS_V(result) == NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -504,8 +512,9 @@ NTSTATUS cli_spoolss_enum_ports(
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
result = werror_to_ntstatus(r.status);
|
||||
|
||||
if ((result = r.status) == NT_STATUS_OK &&
|
||||
if (NT_STATUS_IS_OK(result) &&
|
||||
r.returned > 0) {
|
||||
|
||||
*returned = r.returned;
|
||||
@ -526,7 +535,7 @@ NTSTATUS cli_spoolss_enum_ports(
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
} while (result == ERROR_INSUFFICIENT_BUFFER);
|
||||
} while (NT_STATUS_V(result) == NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -574,8 +583,8 @@ NTSTATUS cli_spoolss_getprinter(
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
if ((result = r.status) == NT_STATUS_OK) {
|
||||
|
||||
result = werror_to_ntstatus(r.status);
|
||||
if (NT_STATUS_IS_OK(result)) {
|
||||
switch (level) {
|
||||
case 0:
|
||||
decode_printer_info_0(mem_ctx, r.buffer, 1, &ctr->printers_0);
|
||||
@ -596,7 +605,7 @@ NTSTATUS cli_spoolss_getprinter(
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
} while (result == ERROR_INSUFFICIENT_BUFFER);
|
||||
} while (NT_STATUS_V(result) == NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -616,7 +625,7 @@ NTSTATUS cli_spoolss_setprinter(
|
||||
prs_struct qbuf, rbuf;
|
||||
SPOOL_Q_SETPRINTER q;
|
||||
SPOOL_R_SETPRINTER r;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_ACCESS_DENIED;
|
||||
|
||||
ZERO_STRUCT(q);
|
||||
ZERO_STRUCT(r);
|
||||
@ -631,7 +640,7 @@ NTSTATUS cli_spoolss_setprinter(
|
||||
if (!spoolss_io_q_setprinter("", &q, &qbuf, 0) ||
|
||||
!rpc_api_pipe_req(cli, SPOOLSS_SETPRINTER, &qbuf, &rbuf))
|
||||
{
|
||||
result = NT_STATUS_UNSUCCESSFUL;
|
||||
result = NT_STATUS_ACCESS_DENIED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -641,7 +650,7 @@ NTSTATUS cli_spoolss_setprinter(
|
||||
goto done;
|
||||
}
|
||||
|
||||
result = r.status;
|
||||
result = werror_to_ntstatus(r.status);
|
||||
|
||||
done:
|
||||
prs_mem_free(&qbuf);
|
||||
@ -705,9 +714,9 @@ NTSTATUS cli_spoolss_getprinterdriver (
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
if ((result = r.status) == NT_STATUS_OK)
|
||||
result = werror_to_ntstatus(r.status);
|
||||
if (NT_STATUS_IS_OK(result))
|
||||
{
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case 1:
|
||||
@ -726,7 +735,7 @@ NTSTATUS cli_spoolss_getprinterdriver (
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
} while (result == ERROR_INSUFFICIENT_BUFFER);
|
||||
} while (NT_STATUS_V(result) == NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -784,7 +793,8 @@ NTSTATUS cli_spoolss_enumprinterdrivers (
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
if (((result=r.status) == NT_STATUS_OK) &&
|
||||
result = werror_to_ntstatus(r.status);
|
||||
if (NT_STATUS_IS_OK(result) &&
|
||||
(r.returned != 0))
|
||||
{
|
||||
*returned = r.returned;
|
||||
@ -807,7 +817,7 @@ NTSTATUS cli_spoolss_enumprinterdrivers (
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
} while (result == ERROR_INSUFFICIENT_BUFFER);
|
||||
} while (NT_STATUS_V(result) == NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -865,7 +875,8 @@ NTSTATUS cli_spoolss_getprinterdriverdir (
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
if ((result=r.status) == NT_STATUS_OK)
|
||||
result = werror_to_ntstatus(r.status);
|
||||
if (NT_STATUS_IS_OK(result))
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
@ -879,7 +890,7 @@ NTSTATUS cli_spoolss_getprinterdriverdir (
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
} while (result == ERROR_INSUFFICIENT_BUFFER);
|
||||
} while (NT_STATUS_V(result) == NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -931,7 +942,7 @@ NTSTATUS cli_spoolss_addprinterdriver (
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
result = r.status;
|
||||
result = werror_to_ntstatus(r.status);
|
||||
|
||||
done:
|
||||
prs_mem_free(&qbuf);
|
||||
@ -993,7 +1004,7 @@ NTSTATUS cli_spoolss_addprinterex (
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
result = r.status;
|
||||
result = werror_to_ntstatus(r.status);
|
||||
|
||||
done:
|
||||
prs_mem_free(&qbuf);
|
||||
@ -1050,7 +1061,7 @@ NTSTATUS cli_spoolss_deleteprinterdriver (
|
||||
}
|
||||
|
||||
/* Return output parameters */
|
||||
result = r.status;
|
||||
result = werror_to_ntstatus(r.status);
|
||||
|
||||
done:
|
||||
prs_mem_free(&qbuf);
|
||||
|
@ -323,16 +323,14 @@ NTSTATUS domain_client_validate(const auth_usersupplied_info *user_info,
|
||||
|
||||
ZERO_STRUCT(info3);
|
||||
|
||||
if ((status = cli_nt_login_network(&cli, user_info, smb_uid_low,
|
||||
&ctr, &info3))
|
||||
!= NT_STATUS_OK) {
|
||||
status = cli_nt_login_network(&cli, user_info, smb_uid_low,
|
||||
&ctr, &info3);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("domain_client_validate: unable to validate password "
|
||||
"for user %s in domain %s to Domain controller %s. "
|
||||
"Error was %s.\n", user_info->smb_username.str,
|
||||
user_info->domain.str, remote_machine,
|
||||
get_nt_error_msg(status)));
|
||||
} else {
|
||||
status = NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -105,7 +105,7 @@ NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid,
|
||||
BOOL ok = False;
|
||||
|
||||
if (!lp_locking(SNUM(conn)))
|
||||
return NT_STATUS(0);
|
||||
return NT_STATUS_OK;
|
||||
|
||||
/* NOTE! 0 byte long ranges ARE allowed and should be stored */
|
||||
|
||||
@ -156,10 +156,10 @@ NTSTATUS do_unlock(files_struct *fsp,connection_struct *conn, uint16 lock_pid,
|
||||
BOOL ok = False;
|
||||
|
||||
if (!lp_locking(SNUM(conn)))
|
||||
return NT_STATUS(0);
|
||||
return NT_STATUS_OK;
|
||||
|
||||
if (!OPEN_FSP(fsp) || !fsp->can_lock || (fsp->conn != conn)) {
|
||||
return NT_STATUS(NT_STATUS_INVALID_HANDLE);
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
DEBUG(10,("do_unlock: unlock start=%.0f len=%.0f requested for file %s\n",
|
||||
@ -176,15 +176,15 @@ NTSTATUS do_unlock(files_struct *fsp,connection_struct *conn, uint16 lock_pid,
|
||||
|
||||
if (!ok) {
|
||||
DEBUG(10,("do_unlock: returning ERRlock.\n" ));
|
||||
return NT_STATUS(NT_STATUS_LOCK_NOT_GRANTED);
|
||||
return NT_STATUS_LOCK_NOT_GRANTED;
|
||||
}
|
||||
|
||||
if (!lp_posix_locking(SNUM(conn)))
|
||||
return NT_STATUS(0);
|
||||
return NT_STATUS_OK;
|
||||
|
||||
(void)release_posix_lock(fsp, offset, count);
|
||||
|
||||
return NT_STATUS(0);
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -34,7 +34,7 @@ BOOL wb_lsa_open_policy(char *server, BOOL sec_qos, uint32 des_access,
|
||||
struct ntuser_creds creds;
|
||||
struct in_addr dest_ip;
|
||||
fstring dest_host;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
extern pstring global_myname;
|
||||
|
||||
ZERO_STRUCTP(pol);
|
||||
@ -79,13 +79,13 @@ BOOL wb_lsa_open_policy(char *server, BOOL sec_qos, uint32 des_access,
|
||||
des_access, &pol->handle);
|
||||
|
||||
done:
|
||||
if (result != NT_STATUS_OK && pol->cli) {
|
||||
if (!NT_STATUS_IS_OK(result) && pol->cli) {
|
||||
if (pol->cli->initialised)
|
||||
cli_shutdown(pol->cli);
|
||||
free(pol->cli);
|
||||
}
|
||||
|
||||
return (result == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(result);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -94,12 +94,12 @@ do a LSA Enumerate Trusted Domain
|
||||
BOOL wb_lsa_enum_trust_dom(CLI_POLICY_HND *hnd, uint32 *enum_ctx,
|
||||
uint32 * num_doms, char ***names, DOM_SID **sids)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_lsa_enum_trust_dom(hnd->cli, hnd->mem_ctx, &hnd->handle,
|
||||
enum_ctx, num_doms, names, sids);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -108,12 +108,12 @@ do a LSA Query Info Policy
|
||||
BOOL wb_lsa_query_info_pol(CLI_POLICY_HND *hnd, uint16 info_class,
|
||||
fstring domain_name, DOM_SID *domain_sid)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_lsa_query_info_policy(hnd->cli, hnd->mem_ctx, &hnd->handle,
|
||||
info_class, domain_name, domain_sid);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -122,12 +122,12 @@ do a LSA Lookup Names
|
||||
BOOL wb_lsa_lookup_names(CLI_POLICY_HND *hnd, int num_names, char **names,
|
||||
DOM_SID **sids, uint32 **types, int *num_sids)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_lsa_lookup_names(hnd->cli, hnd->mem_ctx, &hnd->handle,
|
||||
num_names, names, sids, types, num_sids);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -136,12 +136,12 @@ do a LSA Lookup SIDS
|
||||
BOOL wb_lsa_lookup_sids(CLI_POLICY_HND *hnd, int num_sids, DOM_SID *sids,
|
||||
char ***names, uint32 **types, int *num_names)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_lsa_lookup_sids(hnd->cli, hnd->mem_ctx, &hnd->handle,
|
||||
num_sids, sids, names, types, num_names);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -149,11 +149,11 @@ lsa_close glue
|
||||
****************************************************************************/
|
||||
BOOL wb_lsa_close(CLI_POLICY_HND *hnd)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_lsa_close(hnd->cli, hnd->mem_ctx, &hnd->handle);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
|
||||
@ -162,11 +162,11 @@ samr_close glue
|
||||
****************************************************************************/
|
||||
BOOL wb_samr_close(CLI_POLICY_HND *hnd)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_samr_close(hnd->cli, hnd->mem_ctx, &hnd->handle);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ BOOL wb_samr_connect(char *server, uint32 access_mask, CLI_POLICY_HND *pol)
|
||||
struct ntuser_creds creds;
|
||||
struct in_addr dest_ip;
|
||||
fstring dest_host;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
extern pstring global_myname;
|
||||
|
||||
ZERO_STRUCTP(pol);
|
||||
@ -225,13 +225,13 @@ BOOL wb_samr_connect(char *server, uint32 access_mask, CLI_POLICY_HND *pol)
|
||||
access_mask, &pol->handle);
|
||||
|
||||
done:
|
||||
if (result != NT_STATUS_OK && pol->cli) {
|
||||
if (!NT_STATUS_IS_OK(result) && pol->cli) {
|
||||
if (pol->cli->initialised)
|
||||
cli_shutdown(pol->cli);
|
||||
free(pol->cli);
|
||||
}
|
||||
|
||||
return (result == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(result);
|
||||
}
|
||||
|
||||
|
||||
@ -241,7 +241,7 @@ samr_open_domain glue
|
||||
BOOL wb_samr_open_domain(CLI_POLICY_HND *connect_pol, uint32 ace_perms,
|
||||
DOM_SID *sid, CLI_POLICY_HND *domain_pol)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_samr_open_domain(connect_pol->cli,
|
||||
connect_pol->mem_ctx,
|
||||
@ -250,7 +250,7 @@ BOOL wb_samr_open_domain(CLI_POLICY_HND *connect_pol, uint32 ace_perms,
|
||||
sid,
|
||||
&domain_pol->handle);
|
||||
|
||||
if (ret == NT_STATUS_OK) {
|
||||
if NT_STATUS_IS_OK(ret) {
|
||||
domain_pol->cli = connect_pol->cli;
|
||||
domain_pol->mem_ctx = connect_pol->mem_ctx;
|
||||
return True;
|
||||
@ -262,16 +262,12 @@ BOOL wb_samr_open_domain(CLI_POLICY_HND *connect_pol, uint32 ace_perms,
|
||||
/****************************************************************************
|
||||
do a SAMR enumerate groups
|
||||
****************************************************************************/
|
||||
uint32 wb_samr_enum_dom_groups(CLI_POLICY_HND *pol, uint32 *start_idx,
|
||||
NTSTATUS wb_samr_enum_dom_groups(CLI_POLICY_HND *pol, uint32 *start_idx,
|
||||
uint32 size, struct acct_info **sam,
|
||||
uint32 *num_sam_groups)
|
||||
{
|
||||
uint32 ret;
|
||||
|
||||
ret = cli_samr_enum_dom_groups(pol->cli, pol->mem_ctx, &pol->handle,
|
||||
start_idx, size, sam, num_sam_groups);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return cli_samr_enum_dom_groups(pol->cli, pol->mem_ctx, &pol->handle,
|
||||
start_idx, size, sam, num_sam_groups);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -282,25 +278,25 @@ BOOL wb_get_samr_query_userinfo(CLI_POLICY_HND *pol, uint32 info_level,
|
||||
{
|
||||
POLICY_HND user_pol;
|
||||
BOOL got_user_pol = False;
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
|
||||
if ((result = cli_samr_open_user(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, MAXIMUM_ALLOWED_ACCESS,
|
||||
user_rid, &user_pol))
|
||||
!= NT_STATUS_OK)
|
||||
result = cli_samr_open_user(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, MAXIMUM_ALLOWED_ACCESS,
|
||||
user_rid, &user_pol);
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
got_user_pol = True;
|
||||
|
||||
if ((result = cli_samr_query_userinfo(pol->cli, pol->mem_ctx,
|
||||
&user_pol, info_level, ctr))
|
||||
!= NT_STATUS_OK)
|
||||
result = cli_samr_query_userinfo(pol->cli, pol->mem_ctx,
|
||||
&user_pol, info_level, ctr);
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
done:
|
||||
if (got_user_pol) cli_samr_close(pol->cli, pol->mem_ctx, &user_pol);
|
||||
|
||||
return (result == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(result);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -309,23 +305,23 @@ do a SAMR enumerate groups
|
||||
BOOL wb_samr_open_user(CLI_POLICY_HND *pol, uint32 access_mask, uint32 rid,
|
||||
POLICY_HND *user_pol)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_samr_open_user(pol->cli, pol->mem_ctx, &pol->handle,
|
||||
access_mask, rid, user_pol);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
BOOL wb_samr_query_usergroups(CLI_POLICY_HND *pol, uint32 *num_groups,
|
||||
DOM_GID **gid)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_samr_query_usergroups(pol->cli, pol->mem_ctx, &pol->handle,
|
||||
num_groups, gid);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
BOOL wb_get_samr_query_groupinfo(CLI_POLICY_HND *pol, uint32 info_level,
|
||||
@ -333,25 +329,23 @@ BOOL wb_get_samr_query_groupinfo(CLI_POLICY_HND *pol, uint32 info_level,
|
||||
{
|
||||
POLICY_HND group_pol;
|
||||
BOOL got_group_pol = False;
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
|
||||
if ((result = cli_samr_open_group(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, MAXIMUM_ALLOWED_ACCESS,
|
||||
group_rid, &group_pol))
|
||||
!= NT_STATUS_OK)
|
||||
result = cli_samr_open_group(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, MAXIMUM_ALLOWED_ACCESS,
|
||||
group_rid, &group_pol);
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
got_group_pol = True;
|
||||
|
||||
if ((result = cli_samr_query_groupinfo(pol->cli, pol->mem_ctx,
|
||||
&group_pol, info_level,
|
||||
ctr)) != NT_STATUS_OK)
|
||||
goto done;
|
||||
|
||||
result = cli_samr_query_groupinfo(pol->cli, pol->mem_ctx,
|
||||
&group_pol, info_level,
|
||||
ctr);
|
||||
done:
|
||||
if (got_group_pol) cli_samr_close(pol->cli, pol->mem_ctx, &group_pol);
|
||||
|
||||
return (result == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(result);
|
||||
}
|
||||
|
||||
BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid,
|
||||
@ -360,20 +354,21 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid,
|
||||
{
|
||||
BOOL got_group_pol = False;
|
||||
POLICY_HND group_pol;
|
||||
uint32 result, i, total_names = 0;
|
||||
NTSTATUS result;
|
||||
uint32 i, total_names = 0;
|
||||
|
||||
if ((result = cli_samr_open_group(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, MAXIMUM_ALLOWED_ACCESS,
|
||||
group_rid, &group_pol))
|
||||
!= NT_STATUS_OK)
|
||||
result = cli_samr_open_group(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, MAXIMUM_ALLOWED_ACCESS,
|
||||
group_rid, &group_pol);
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
got_group_pol = True;
|
||||
|
||||
if ((result = cli_samr_query_groupmem(pol->cli, pol->mem_ctx,
|
||||
&group_pol, num_names, rid_mem,
|
||||
name_types))
|
||||
!= NT_STATUS_OK)
|
||||
result = cli_samr_query_groupmem(pol->cli, pol->mem_ctx,
|
||||
&group_pol, num_names, rid_mem,
|
||||
name_types);
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
/* Call cli_samr_lookup_rids() in bunches of ~1000 rids to avoid
|
||||
@ -398,8 +393,7 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid,
|
||||
&(*rid_mem)[i],
|
||||
&tmp_num_names,
|
||||
&tmp_names, &tmp_types);
|
||||
|
||||
if (result != NT_STATUS_OK)
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
/* Copy result into array. The talloc system will take
|
||||
@ -420,26 +414,26 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid,
|
||||
if (got_group_pol)
|
||||
cli_samr_close(pol->cli, pol->mem_ctx, &group_pol);
|
||||
|
||||
return (result == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(result);
|
||||
}
|
||||
|
||||
BOOL wb_samr_query_dom_info(CLI_POLICY_HND *pol, uint16 switch_value,
|
||||
SAM_UNK_CTR *ctr)
|
||||
{
|
||||
uint32 ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = cli_samr_query_dom_info(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, switch_value, ctr);
|
||||
|
||||
return (ret == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(ret);
|
||||
}
|
||||
|
||||
/* Unlike all the others, the status code of this function is actually used
|
||||
by winbindd. */
|
||||
|
||||
uint32 wb_samr_query_dispinfo(CLI_POLICY_HND *pol, uint32 *start_ndx,
|
||||
uint16 info_level, uint32 *num_entries,
|
||||
SAM_DISPINFO_CTR *ctr)
|
||||
NTSTATUS wb_samr_query_dispinfo(CLI_POLICY_HND *pol, uint32 *start_ndx,
|
||||
uint16 info_level, uint32 *num_entries,
|
||||
SAM_DISPINFO_CTR *ctr)
|
||||
{
|
||||
return cli_samr_query_dispinfo(pol->cli, pol->mem_ctx,
|
||||
&pol->handle, start_ndx,
|
||||
|
@ -465,7 +465,8 @@ enum winbindd_result winbindd_endgrent(struct winbindd_cli_state *state)
|
||||
|
||||
static BOOL get_sam_group_entries(struct getent_state *ent)
|
||||
{
|
||||
uint32 status, num_entries;
|
||||
NTSTATUS status;
|
||||
uint32 num_entries;
|
||||
struct acct_info *name_list = NULL;
|
||||
|
||||
if (ent->got_all_sam_entries) {
|
||||
@ -526,7 +527,7 @@ static BOOL get_sam_group_entries(struct getent_state *ent)
|
||||
|
||||
ent->num_sam_entries += num_entries;
|
||||
|
||||
if (status != STATUS_MORE_ENTRIES)
|
||||
if (NT_STATUS_V(status) != NT_STATUS_V(STATUS_MORE_ENTRIES))
|
||||
break;
|
||||
|
||||
} while (ent->num_sam_entries < MAX_FETCH_SAM_ENTRIES);
|
||||
@ -542,7 +543,7 @@ static BOOL get_sam_group_entries(struct getent_state *ent)
|
||||
|
||||
ent->sam_entries = name_list;
|
||||
ent->sam_entry_index = 0;
|
||||
ent->got_all_sam_entries = (status != STATUS_MORE_ENTRIES);
|
||||
ent->got_all_sam_entries = (NT_STATUS_V(status) != NT_STATUS_V(STATUS_MORE_ENTRIES));
|
||||
|
||||
return ent->num_sam_entries > 0;
|
||||
}
|
||||
|
@ -61,10 +61,9 @@ BOOL _get_trust_account_password(char *domain, unsigned char *ret_pwd,
|
||||
|
||||
/* Check the machine account password is valid */
|
||||
|
||||
enum winbindd_result winbindd_check_machine_acct(
|
||||
struct winbindd_cli_state *state)
|
||||
enum winbindd_result winbindd_check_machine_acct(struct winbindd_cli_state *state)
|
||||
{
|
||||
int result = WINBINDD_ERROR;
|
||||
NTSTATUS status;
|
||||
uchar trust_passwd[16];
|
||||
struct in_addr *ip_list = NULL;
|
||||
int count;
|
||||
@ -79,7 +78,7 @@ enum winbindd_result winbindd_check_machine_acct(
|
||||
again:
|
||||
if (!_get_trust_account_password(lp_workgroup(), trust_passwd,
|
||||
NULL)) {
|
||||
result = NT_STATUS_INTERNAL_ERROR;
|
||||
status = NT_STATUS_INTERNAL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -90,7 +89,7 @@ enum winbindd_result winbindd_check_machine_acct(
|
||||
controller)) {
|
||||
DEBUG(0, ("could not find domain controller for "
|
||||
"domain %s\n", lp_workgroup()));
|
||||
result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
|
||||
status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -102,7 +101,7 @@ enum winbindd_result winbindd_check_machine_acct(
|
||||
global_myname);
|
||||
|
||||
#if 0 /* XXX */
|
||||
result = cli_nt_setup_creds(controller, lp_workgroup(), global_myname,
|
||||
status = cli_nt_setup_creds(controller, lp_workgroup(), global_myname,
|
||||
trust_account, trust_passwd,
|
||||
SEC_CHAN_WKSTA, &validation_level);
|
||||
#endif
|
||||
@ -115,7 +114,7 @@ enum winbindd_result winbindd_check_machine_acct(
|
||||
#define MAX_RETRIES 8
|
||||
|
||||
if ((num_retries < MAX_RETRIES) &&
|
||||
result == NT_STATUS_ACCESS_DENIED) {
|
||||
NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_ACCESS_DENIED)) {
|
||||
num_retries++;
|
||||
goto again;
|
||||
}
|
||||
@ -123,11 +122,10 @@ enum winbindd_result winbindd_check_machine_acct(
|
||||
/* Pass back result code - zero for success, other values for
|
||||
specific failures. */
|
||||
|
||||
DEBUG(3, ("secret is %s\n", (result == NT_STATUS_OK) ?
|
||||
"good" : "bad"));
|
||||
DEBUG(3, ("secret is %s\n", NT_STATUS_IS_OK(status) ? "good" : "bad"));
|
||||
|
||||
done:
|
||||
state->response.data.num_entries = result;
|
||||
state->response.data.num_entries = NT_STATUS_V(status);
|
||||
return WINBINDD_OK;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ static void parse_domain_user(char *domuser, fstring domain, fstring user)
|
||||
|
||||
enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state)
|
||||
{
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
fstring name_domain, name_user;
|
||||
int passlen;
|
||||
unsigned char trust_passwd[16];
|
||||
@ -135,14 +135,14 @@ enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state)
|
||||
server_state.controller, trust_passwd,
|
||||
last_change_time);
|
||||
|
||||
return (result == NT_STATUS_OK) ? WINBINDD_OK : WINBINDD_ERROR;
|
||||
return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR;
|
||||
}
|
||||
|
||||
/* Challenge Response Authentication Protocol */
|
||||
|
||||
enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
|
||||
{
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
fstring name_domain, name_user;
|
||||
unsigned char trust_passwd[16];
|
||||
time_t last_change_time;
|
||||
@ -206,7 +206,7 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
|
||||
server_state.controller, trust_passwd,
|
||||
last_change_time);
|
||||
|
||||
return (result == NT_STATUS_OK) ? WINBINDD_OK : WINBINDD_ERROR;
|
||||
return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR;
|
||||
}
|
||||
|
||||
/* Change a user password */
|
||||
|
@ -138,7 +138,7 @@ void free_getent_state(struct getent_state *state);
|
||||
BOOL winbindd_param_init(void);
|
||||
char *winbindd_cmd_to_string(enum winbindd_cmd cmd);
|
||||
uint32 domain_sequence_number(char *domain_name);
|
||||
uint32 winbindd_query_dispinfo(struct winbindd_domain *domain,
|
||||
NTSTATUS winbindd_query_dispinfo(struct winbindd_domain *domain,
|
||||
uint32 *start_ndx, uint16 info_level,
|
||||
uint32 *num_entries, SAM_DISPINFO_CTR *ctr);
|
||||
BOOL check_domain_env(char *domain_env, char *domain);
|
||||
|
@ -356,7 +356,8 @@ enum winbindd_result winbindd_endpwent(struct winbindd_cli_state *state)
|
||||
|
||||
static BOOL get_sam_user_entries(struct getent_state *ent)
|
||||
{
|
||||
NTSTATUS status, num_entries;
|
||||
NTSTATUS status;
|
||||
uint32 num_entries;
|
||||
SAM_DISPINFO_1 info1;
|
||||
SAM_DISPINFO_CTR ctr;
|
||||
struct getpwent_user *name_list = NULL;
|
||||
@ -455,7 +456,7 @@ static BOOL get_sam_user_entries(struct getent_state *ent)
|
||||
|
||||
ent->num_sam_entries += num_entries;
|
||||
|
||||
if (status != STATUS_MORE_ENTRIES) {
|
||||
if (NT_STATUS_V(status) != NT_STATUS_V(STATUS_MORE_ENTRIES)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@ -472,7 +473,7 @@ static BOOL get_sam_user_entries(struct getent_state *ent)
|
||||
|
||||
ent->sam_entries = name_list;
|
||||
ent->sam_entry_index = 0;
|
||||
ent->got_all_sam_entries = (status != STATUS_MORE_ENTRIES);
|
||||
ent->got_all_sam_entries = (NT_STATUS_V(status) != NT_STATUS_V(STATUS_MORE_ENTRIES));
|
||||
|
||||
return ent->num_sam_entries > 0;
|
||||
}
|
||||
@ -614,7 +615,8 @@ enum winbindd_result winbindd_list_users(struct winbindd_cli_state *state)
|
||||
ctr.sam.info1 = &info1;
|
||||
|
||||
for (domain = domain_list; domain; domain = domain->next) {
|
||||
NTSTATUS status, start_ndx = 0;
|
||||
NTSTATUS status;
|
||||
uint32 start_ndx = 0;
|
||||
|
||||
/* Skip domains other than WINBINDD_DOMAIN environment
|
||||
variable */
|
||||
@ -680,7 +682,7 @@ enum winbindd_result winbindd_list_users(struct winbindd_cli_state *state)
|
||||
|
||||
extra_data[extra_data_len++] = ',';
|
||||
}
|
||||
} while (status == STATUS_MORE_ENTRIES);
|
||||
} while (NT_STATUS_V(status) == NT_STATUS_V(STATUS_MORE_ENTRIES));
|
||||
}
|
||||
|
||||
/* Assign extra_data fields in response structure */
|
||||
|
@ -591,10 +591,9 @@ BOOL winbindd_lookup_usergroups(struct winbindd_domain *domain,
|
||||
return False;
|
||||
}
|
||||
|
||||
if (cli_samr_query_usergroups(domain->sam_dom_handle.cli,
|
||||
domain->sam_dom_handle.mem_ctx,
|
||||
&user_pol, num_groups, user_groups)
|
||||
!= NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(cli_samr_query_usergroups(domain->sam_dom_handle.cli,
|
||||
domain->sam_dom_handle.mem_ctx,
|
||||
&user_pol, num_groups, user_groups))) {
|
||||
result = False;
|
||||
goto done;
|
||||
}
|
||||
@ -867,16 +866,12 @@ uint32 domain_sequence_number(char *domain_name)
|
||||
bit extra to give an overview of domain users for the User Manager
|
||||
application. */
|
||||
|
||||
uint32 winbindd_query_dispinfo(struct winbindd_domain *domain,
|
||||
uint32 *start_ndx, uint16 info_level,
|
||||
uint32 *num_entries, SAM_DISPINFO_CTR *ctr)
|
||||
NTSTATUS winbindd_query_dispinfo(struct winbindd_domain *domain,
|
||||
uint32 *start_ndx, uint16 info_level,
|
||||
uint32 *num_entries, SAM_DISPINFO_CTR *ctr)
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = wb_samr_query_dispinfo(&domain->sam_dom_handle, start_ndx,
|
||||
info_level, num_entries, ctr);
|
||||
|
||||
return status;
|
||||
return wb_samr_query_dispinfo(&domain->sam_dom_handle, start_ndx,
|
||||
info_level, num_entries, ctr);
|
||||
}
|
||||
|
||||
/* Check if a domain is present in a comma-separated list of domains */
|
||||
|
@ -83,12 +83,13 @@ static BOOL smb_pam_error_handler(pam_handle_t *pamh, int pam_error, char *msg,
|
||||
*********************************************************************/
|
||||
|
||||
static BOOL smb_pam_nt_status_error_handler(pam_handle_t *pamh, int pam_error,
|
||||
char *msg, int dbglvl, uint32 *nt_status)
|
||||
char *msg, int dbglvl,
|
||||
NTSTATUS *nt_status)
|
||||
{
|
||||
if (smb_pam_error_handler(pamh, pam_error, msg, dbglvl))
|
||||
return True;
|
||||
|
||||
if (*nt_status == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(*nt_status)) {
|
||||
/* Complain LOUDLY */
|
||||
DEBUG(0, ("smb_pam_nt_status_error_handler: PAM: BUG: PAM and NT_STATUS \
|
||||
error MISMATCH, forcing to NT_STATUS_LOGON_FAILURE"));
|
||||
@ -494,10 +495,10 @@ static BOOL smb_pam_start(pam_handle_t **pamh, char *user, char *rhost, struct p
|
||||
/*
|
||||
* PAM Authentication Handler
|
||||
*/
|
||||
static uint32 smb_pam_auth(pam_handle_t *pamh, char *user)
|
||||
static NTSTATUS smb_pam_auth(pam_handle_t *pamh, char *user)
|
||||
{
|
||||
int pam_error;
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
/*
|
||||
* To enable debugging set in /etc/pam.d/samba:
|
||||
@ -548,10 +549,10 @@ static uint32 smb_pam_auth(pam_handle_t *pamh, char *user)
|
||||
/*
|
||||
* PAM Account Handler
|
||||
*/
|
||||
static uint32 smb_pam_account(pam_handle_t *pamh, char * user)
|
||||
static NTSTATUS smb_pam_account(pam_handle_t *pamh, char * user)
|
||||
{
|
||||
int pam_error;
|
||||
uint32 nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
NTSTATUS nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
|
||||
DEBUG(4,("smb_pam_account: PAM: Account Management for User: %s\n", user));
|
||||
pam_error = pam_acct_mgmt(pamh, PAM_SILENT); /* Is user account enabled? */
|
||||
@ -594,10 +595,10 @@ static uint32 smb_pam_account(pam_handle_t *pamh, char * user)
|
||||
* PAM Credential Setting
|
||||
*/
|
||||
|
||||
static uint32 smb_pam_setcred(pam_handle_t *pamh, char * user)
|
||||
static NTSTATUS smb_pam_setcred(pam_handle_t *pamh, char * user)
|
||||
{
|
||||
int pam_error;
|
||||
uint32 nt_status = NT_STATUS_NO_TOKEN;
|
||||
NTSTATUS nt_status = NT_STATUS_NO_TOKEN;
|
||||
|
||||
/*
|
||||
* This will allow samba to aquire a kerberos token. And, when
|
||||
@ -778,9 +779,9 @@ BOOL smb_pam_close_session(char *user, char *tty, char *rhost)
|
||||
* PAM Externally accessible Account handler
|
||||
*/
|
||||
|
||||
uint32 smb_pam_accountcheck(char * user)
|
||||
NTSTATUS smb_pam_accountcheck(char * user)
|
||||
{
|
||||
uint32 nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
NTSTATUS nt_status = NT_STATUS_ACCOUNT_DISABLED;
|
||||
pam_handle_t *pamh = NULL;
|
||||
struct pam_conv *pconv = NULL;
|
||||
|
||||
@ -790,12 +791,12 @@ uint32 smb_pam_accountcheck(char * user)
|
||||
return NT_STATUS_OK;
|
||||
|
||||
if ((pconv = smb_setup_pam_conv(smb_pam_conv, user, NULL, NULL)) == NULL)
|
||||
return False;
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
if (!smb_pam_start(&pamh, user, NULL, pconv))
|
||||
return NT_STATUS_ACCOUNT_DISABLED;
|
||||
|
||||
if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK)
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_account(pamh, user)))
|
||||
DEBUG(0, ("smb_pam_accountcheck: PAM: Account Validation Failed - Rejecting User %s!\n", user));
|
||||
|
||||
smb_pam_end(pamh, pconv);
|
||||
@ -806,10 +807,10 @@ uint32 smb_pam_accountcheck(char * user)
|
||||
* PAM Password Validation Suite
|
||||
*/
|
||||
|
||||
uint32 smb_pam_passcheck(char * user, char * password)
|
||||
NTSTATUS smb_pam_passcheck(char * user, char * password)
|
||||
{
|
||||
pam_handle_t *pamh = NULL;
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
struct pam_conv *pconv = NULL;
|
||||
|
||||
/*
|
||||
@ -824,19 +825,19 @@ uint32 smb_pam_passcheck(char * user, char * password)
|
||||
if (!smb_pam_start(&pamh, user, NULL, pconv))
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
if ((nt_status = smb_pam_auth(pamh, user)) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_auth(pamh, user))) {
|
||||
DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User %s !\n", user));
|
||||
smb_pam_end(pamh, pconv);
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_account(pamh, user))) {
|
||||
DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_account failed - Rejecting User %s !\n", user));
|
||||
smb_pam_end(pamh, pconv);
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
if ((nt_status = smb_pam_setcred(pamh, user)) != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status = smb_pam_setcred(pamh, user))) {
|
||||
DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_setcred failed - Rejecting User %s !\n", user));
|
||||
smb_pam_end(pamh, pconv);
|
||||
return nt_status;
|
||||
|
@ -599,7 +599,7 @@ static BOOL password_check(char *password)
|
||||
{
|
||||
|
||||
#ifdef WITH_PAM
|
||||
return (smb_pam_passcheck(this_user, password) == NT_STATUS_OK);
|
||||
return NT_STATUS_IS_OK(smb_pam_passcheck(this_user, password));
|
||||
#endif /* WITH_PAM */
|
||||
|
||||
#ifdef WITH_AFS
|
||||
|
@ -430,14 +430,14 @@ BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count)
|
||||
/****************************************************************************
|
||||
delete a named form struct
|
||||
****************************************************************************/
|
||||
BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, uint32 *ret)
|
||||
BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR *ret)
|
||||
{
|
||||
pstring key;
|
||||
TDB_DATA kbuf;
|
||||
int n=0;
|
||||
fstring form_name;
|
||||
|
||||
*ret = 0;
|
||||
*ret = WERR_OK;
|
||||
|
||||
unistr2_to_ascii(form_name, del_name, sizeof(form_name)-1);
|
||||
|
||||
@ -450,7 +450,7 @@ BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, uint32
|
||||
|
||||
if (n == *count) {
|
||||
DEBUG(10,("delete_a_form, [%s] not found\n", form_name));
|
||||
*ret = ERRinvalidparam;
|
||||
*ret = WERR_INVALID_PARAM;
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, uint32
|
||||
kbuf.dsize = strlen(key)+1;
|
||||
kbuf.dptr = key;
|
||||
if (tdb_delete(tdb_forms, kbuf) != 0) {
|
||||
*ret = ERRnomem;
|
||||
*ret = WERR_NOMEM;
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -921,12 +921,12 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file,
|
||||
Determine the correct cVersion associated with an architecture and driver
|
||||
****************************************************************************/
|
||||
static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
struct current_user *user, uint32 *perr)
|
||||
struct current_user *user, WERROR *perr)
|
||||
{
|
||||
int cversion;
|
||||
int access_mode;
|
||||
int action;
|
||||
int ecode;
|
||||
NTSTATUS ecode;
|
||||
pstring driverpath;
|
||||
fstring user_name;
|
||||
fstring null_pw;
|
||||
@ -950,7 +950,7 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
DEBUG(0,("get_correct_cversion: Unable to get passwd entry for uid %u\n",
|
||||
(unsigned int)user->uid ));
|
||||
unbecome_root();
|
||||
*perr = ERRnoaccess;
|
||||
*perr = WERR_ACCESS_DENIED;
|
||||
return -1;
|
||||
}
|
||||
unbecome_root();
|
||||
@ -966,7 +966,7 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
|
||||
if (conn == NULL) {
|
||||
DEBUG(0,("get_correct_cversion: Unable to connect\n"));
|
||||
*perr = (uint32)ecode;
|
||||
*perr = ntstatus_to_werror(ecode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -975,7 +975,7 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
|
||||
if (!become_user(conn, conn->vuid)) {
|
||||
DEBUG(0,("get_correct_cversion: Can't become user %s\n", user_name ));
|
||||
*perr = ERRnoaccess;
|
||||
*perr = WERR_ACCESS_DENIED;
|
||||
pop_sec_ctx();
|
||||
return -1;
|
||||
}
|
||||
@ -993,7 +993,7 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
if (!fsp) {
|
||||
DEBUG(3,("get_correct_cversion: Can't open file [%s], errno = %d\n",
|
||||
driverpath, errno));
|
||||
*perr = ERRnoaccess;
|
||||
*perr = WERR_ACCESS_DENIED;
|
||||
goto error_exit;
|
||||
}
|
||||
else {
|
||||
@ -1030,8 +1030,8 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
driverpath, major, minor));
|
||||
}
|
||||
|
||||
DEBUG(10,("get_correct_cversion: Driver file [%s] cversion = %d\n",
|
||||
driverpath, cversion));
|
||||
DEBUG(10,("get_correct_cversion: Driver file [%s] cversion = %d\n",
|
||||
driverpath, cversion));
|
||||
|
||||
close_file(fsp, True);
|
||||
close_cnum(conn, user->vuid);
|
||||
@ -1040,24 +1040,24 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in,
|
||||
|
||||
|
||||
error_exit:
|
||||
if(fsp)
|
||||
close_file(fsp, True);
|
||||
|
||||
close_cnum(conn, user->vuid);
|
||||
pop_sec_ctx();
|
||||
return -1;
|
||||
if(fsp)
|
||||
close_file(fsp, True);
|
||||
|
||||
close_cnum(conn, user->vuid);
|
||||
pop_sec_ctx();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
static uint32 clean_up_driver_struct_level_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver,
|
||||
struct current_user *user)
|
||||
static WERROR clean_up_driver_struct_level_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver,
|
||||
struct current_user *user)
|
||||
{
|
||||
fstring architecture;
|
||||
fstring new_name;
|
||||
char *p;
|
||||
int i;
|
||||
uint32 err;
|
||||
WERROR err;
|
||||
|
||||
/* clean up the driver name.
|
||||
* we can get .\driver.dll
|
||||
@ -1107,22 +1107,22 @@ static uint32 clean_up_driver_struct_level_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *dri
|
||||
* NT2K: cversion=3
|
||||
*/
|
||||
if ((driver->cversion = get_correct_cversion( architecture,
|
||||
driver->driverpath, user, &err)) == -1)
|
||||
driver->driverpath, user, &err)) == -1)
|
||||
return err;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
static uint32 clean_up_driver_struct_level_6(NT_PRINTER_DRIVER_INFO_LEVEL_6 *driver,
|
||||
struct current_user *user)
|
||||
static WERROR clean_up_driver_struct_level_6(NT_PRINTER_DRIVER_INFO_LEVEL_6 *driver,
|
||||
struct current_user *user)
|
||||
{
|
||||
fstring architecture;
|
||||
fstring new_name;
|
||||
char *p;
|
||||
int i;
|
||||
uint32 err;
|
||||
WERROR err;
|
||||
|
||||
/* clean up the driver name.
|
||||
* we can get .\driver.dll
|
||||
@ -1172,15 +1172,15 @@ static uint32 clean_up_driver_struct_level_6(NT_PRINTER_DRIVER_INFO_LEVEL_6 *dri
|
||||
* NT2K: cversion=3
|
||||
*/
|
||||
if ((driver->version = get_correct_cversion(architecture,
|
||||
driver->driverpath, user, &err)) == -1)
|
||||
driver->driverpath, user, &err)) == -1)
|
||||
return err;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
uint32 clean_up_driver_struct(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
WERROR clean_up_driver_struct(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
uint32 level, struct current_user *user)
|
||||
{
|
||||
switch (level) {
|
||||
@ -1197,7 +1197,7 @@ uint32 clean_up_driver_struct(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
return clean_up_driver_struct_level_6(driver, user);
|
||||
}
|
||||
default:
|
||||
return ERRinvalidparam;
|
||||
return WERR_INVALID_PARAM;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1240,7 +1240,8 @@ static char* ffmt(unsigned char *c){
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, uint32 level, struct current_user *user, uint32 *perr)
|
||||
BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, uint32 level,
|
||||
struct current_user *user, WERROR *perr)
|
||||
{
|
||||
NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver;
|
||||
NT_PRINTER_DRIVER_INFO_LEVEL_3 converted_driver;
|
||||
@ -1251,16 +1252,12 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
fstring user_name;
|
||||
fstring null_pw;
|
||||
connection_struct *conn;
|
||||
pstring inbuf;
|
||||
pstring outbuf;
|
||||
struct passwd *pass;
|
||||
int ecode;
|
||||
NTSTATUS ecode;
|
||||
int ver = 0;
|
||||
int i;
|
||||
|
||||
*perr = 0;
|
||||
memset(inbuf, '\0', sizeof(inbuf));
|
||||
memset(outbuf, '\0', sizeof(outbuf));
|
||||
*perr = WERR_OK;
|
||||
|
||||
if (level==3)
|
||||
driver=driver_abstract.info_3;
|
||||
@ -1294,7 +1291,7 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
|
||||
if (conn == NULL) {
|
||||
DEBUG(0,("move_driver_to_download_area: Unable to connect\n"));
|
||||
*perr = (uint32)ecode;
|
||||
*perr = ntstatus_to_werror(ecode);
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -1316,7 +1313,7 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
*/
|
||||
DEBUG(5,("Creating first directory\n"));
|
||||
slprintf(new_dir, sizeof(new_dir)-1, "%s/%d", architecture, driver->cversion);
|
||||
mkdir_internal(conn, inbuf, outbuf, new_dir);
|
||||
mkdir_internal(conn, new_dir);
|
||||
|
||||
/* For each driver file, archi\filexxx.yyy, if there is a duplicate file
|
||||
* listed for this driver which has already been moved, skip it (note:
|
||||
@ -1341,16 +1338,18 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
slprintf(new_name, sizeof(new_name)-1, "%s/%s", architecture, driver->driverpath);
|
||||
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->driverpath);
|
||||
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
|
||||
if (rename_internals(conn, inbuf, outbuf, new_name, old_name, True) != 0) {
|
||||
NTSTATUS status;
|
||||
status = rename_internals(conn, new_name, old_name, True);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
|
||||
new_name, old_name));
|
||||
*perr = (uint32)SVAL(outbuf,smb_err);
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
*perr = ntstatus_to_werror(status);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
ver = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
}
|
||||
|
||||
if (driver->datafile && strlen(driver->datafile)) {
|
||||
@ -1358,16 +1357,18 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
slprintf(new_name, sizeof(new_name)-1, "%s/%s", architecture, driver->datafile);
|
||||
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->datafile);
|
||||
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
|
||||
if (rename_internals(conn, inbuf, outbuf, new_name, old_name, True) != 0) {
|
||||
NTSTATUS status;
|
||||
status = rename_internals(conn, new_name, old_name, True);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
|
||||
new_name, old_name));
|
||||
*perr = (uint32)SVAL(outbuf,smb_err);
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
*perr = ntstatus_to_werror(status);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
ver = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1377,16 +1378,18 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
slprintf(new_name, sizeof(new_name)-1, "%s/%s", architecture, driver->configfile);
|
||||
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->configfile);
|
||||
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
|
||||
if (rename_internals(conn, inbuf, outbuf, new_name, old_name, True) != 0) {
|
||||
NTSTATUS status;
|
||||
status = rename_internals(conn, new_name, old_name, True);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
|
||||
new_name, old_name));
|
||||
*perr = (uint32)SVAL(outbuf,smb_err);
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
*perr = ntstatus_to_werror(status);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
ver = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1397,16 +1400,18 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
slprintf(new_name, sizeof(new_name)-1, "%s/%s", architecture, driver->helpfile);
|
||||
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->helpfile);
|
||||
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
|
||||
if (rename_internals(conn, inbuf, outbuf, new_name, old_name, True) != 0) {
|
||||
NTSTATUS status;
|
||||
status = rename_internals(conn, new_name, old_name, True);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
|
||||
new_name, old_name));
|
||||
*perr = (uint32)SVAL(outbuf,smb_err);
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
*perr = ntstatus_to_werror(status);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
ver = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1426,16 +1431,18 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
|
||||
slprintf(new_name, sizeof(new_name)-1, "%s/%s", architecture, driver->dependentfiles[i]);
|
||||
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->dependentfiles[i]);
|
||||
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
|
||||
if (rename_internals(conn, inbuf, outbuf, new_name, old_name, True) != 0) {
|
||||
NTSTATUS status;
|
||||
status = rename_internals(conn, new_name, old_name, True);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
|
||||
new_name, old_name));
|
||||
*perr = (uint32)SVAL(outbuf,smb_err);
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
*perr = ntstatus_to_werror(status);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
ver = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
unlink_internals(conn, inbuf, outbuf, 0, new_name);
|
||||
unlink_internals(conn, 0, new_name);
|
||||
}
|
||||
NextDriver: ;
|
||||
}
|
||||
@ -1583,7 +1590,7 @@ static uint32 add_a_printer_driver_6(NT_PRINTER_DRIVER_INFO_LEVEL_6 *driver)
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
static uint32 get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr, fstring in_prt, fstring in_arch)
|
||||
static WERROR get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr, fstring in_prt, fstring in_arch)
|
||||
{
|
||||
NT_PRINTER_DRIVER_INFO_LEVEL_3 info;
|
||||
|
||||
@ -1598,14 +1605,14 @@ static uint32 get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **in
|
||||
fstrcpy(info.helpfile, "");
|
||||
|
||||
if ((info.dependentfiles=(fstring *)malloc(2*sizeof(fstring))) == NULL)
|
||||
return ERRnomem;
|
||||
return WERR_NOMEM;
|
||||
|
||||
memset(info.dependentfiles, '\0', 2*sizeof(fstring));
|
||||
fstrcpy(info.dependentfiles[0], "");
|
||||
|
||||
*info_ptr = memdup(&info, sizeof(info));
|
||||
|
||||
return 0;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -1634,7 +1641,7 @@ static WERROR get_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr,
|
||||
#if 0
|
||||
if (!dbuf.dptr) return get_a_printer_driver_3_default(info_ptr, in_prt, in_arch);
|
||||
#else
|
||||
if (!dbuf.dptr) return 5;
|
||||
if (!dbuf.dptr) return WERR_ACCESS_DENIED;
|
||||
#endif
|
||||
len += tdb_unpack(dbuf.dptr, dbuf.dsize, "dffffffff",
|
||||
&driver.cversion,
|
||||
@ -1890,15 +1897,16 @@ uint32 del_a_printer(char *sharename)
|
||||
}
|
||||
|
||||
/* FIXME!!! Reorder so this forward declaration is not necessary --jerry */
|
||||
static uint32 get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **, fstring);
|
||||
static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **, fstring);
|
||||
static void free_nt_printer_info_level_2(NT_PRINTER_INFO_LEVEL_2 **);
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
static uint32 update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info)
|
||||
static WERROR update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info)
|
||||
{
|
||||
pstring key;
|
||||
char *buf;
|
||||
int buflen, len, ret;
|
||||
int buflen, len;
|
||||
WERROR ret;
|
||||
TDB_DATA kbuf, dbuf;
|
||||
|
||||
/*
|
||||
@ -1965,7 +1973,7 @@ static uint32 update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info)
|
||||
tb = (char *)Realloc(buf, len);
|
||||
if (!tb) {
|
||||
DEBUG(0,("update_a_printer_2: failed to enlarge buffer!\n"));
|
||||
ret = -1;
|
||||
ret = WERR_NOMEM;
|
||||
goto done;
|
||||
}
|
||||
else buf = tb;
|
||||
@ -1981,10 +1989,10 @@ static uint32 update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info)
|
||||
dbuf.dptr = buf;
|
||||
dbuf.dsize = len;
|
||||
|
||||
ret = tdb_store(tdb_printers, kbuf, dbuf, TDB_REPLACE);
|
||||
ret = (tdb_store(tdb_printers, kbuf, dbuf, TDB_REPLACE) == 0? WERR_OK : WERR_NOMEM);
|
||||
|
||||
done:
|
||||
if (ret == -1)
|
||||
if (!W_ERROR_IS_OK(ret))
|
||||
DEBUG(8, ("error updating printer to tdb on disk\n"));
|
||||
|
||||
safe_free(buf);
|
||||
@ -2407,7 +2415,7 @@ static void map_to_os2_driver(fstring drivername)
|
||||
/****************************************************************************
|
||||
get a default printer info 2 struct
|
||||
****************************************************************************/
|
||||
static uint32 get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharename)
|
||||
static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharename)
|
||||
{
|
||||
extern pstring global_myname;
|
||||
int snum;
|
||||
@ -2479,13 +2487,13 @@ static uint32 get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return (0);
|
||||
return WERR_OK;
|
||||
|
||||
fail:
|
||||
|
||||
if (info.devmode)
|
||||
free_nt_devicemode(&info.devmode);
|
||||
return 2;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -2589,7 +2597,7 @@ static uint32 dump_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
DEBUGADD(106,("default_priority:[%d]\n", info2->default_priority));
|
||||
DEBUGADD(106,("starttime:[%d]\n", info2->starttime));
|
||||
DEBUGADD(106,("untiltime:[%d]\n", info2->untiltime));
|
||||
DEBUGADD(106,("status:[%d]\n", info2->status));
|
||||
DEBUGADD(106,("status:[%s]\n", werror_str(info2->status)));
|
||||
DEBUGADD(106,("cjobs:[%d]\n", info2->cjobs));
|
||||
DEBUGADD(106,("averageppm:[%d]\n", info2->averageppm));
|
||||
DEBUGADD(106,("changeid:[%d]\n", info2->changeid));
|
||||
@ -2627,10 +2635,10 @@ static uint32 dump_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
void get_printer_subst_params(int snum, fstring *printername, fstring *sharename, fstring *portname)
|
||||
{
|
||||
NT_PRINTER_INFO_LEVEL *printer = NULL;
|
||||
|
||||
|
||||
**printername = **sharename = **portname = '\0';
|
||||
|
||||
if (get_a_printer(&printer, 2, lp_servicename(snum))!=0)
|
||||
if (!W_ERROR_IS_OK(get_a_printer(&printer, 2, lp_servicename(snum))))
|
||||
return;
|
||||
|
||||
fstrcpy(*printername, printer->info_2->printername);
|
||||
@ -2650,9 +2658,9 @@ void get_printer_subst_params(int snum, fstring *printername, fstring *sharename
|
||||
Modify a printer. This is called from SETPRINTERDATA/DELETEPRINTERDATA.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
{
|
||||
uint32 result;
|
||||
WERROR result;
|
||||
|
||||
dump_a_printer(printer, level);
|
||||
|
||||
@ -2665,7 +2673,7 @@ uint32 mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
result=1;
|
||||
result=WERR_UNKNOWN_LEVEL;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2677,9 +2685,9 @@ uint32 mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
We split this out from mod_a_printer as it updates the id's and timestamps.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
WERROR add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
{
|
||||
uint32 result;
|
||||
WERROR result;
|
||||
|
||||
dump_a_printer(printer, level);
|
||||
|
||||
@ -2705,7 +2713,7 @@ uint32 add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
result=1;
|
||||
result=WERR_UNKNOWN_LEVEL;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2932,9 +2940,9 @@ static BOOL convert_driver_init(NT_PRINTER_PARAM *param, TALLOC_CTX *ctx, NT_DEV
|
||||
about it and you will realize why. JRR 010720
|
||||
****************************************************************************/
|
||||
|
||||
static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARAM *param)
|
||||
static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARAM *param)
|
||||
{
|
||||
uint32 status = ERRsuccess;
|
||||
WERROR status = WERR_OK;
|
||||
TALLOC_CTX *ctx = NULL;
|
||||
NT_DEVICEMODE *nt_devmode = NULL;
|
||||
NT_DEVICEMODE *tmp_devmode = printer->info_2->devmode;
|
||||
@ -2944,10 +2952,10 @@ static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
|
||||
* saved to tdb.
|
||||
*/
|
||||
if ((ctx = talloc_init()) == NULL)
|
||||
return ERRnomem;
|
||||
return WERR_NOMEM;
|
||||
|
||||
if ((nt_devmode = (NT_DEVICEMODE*)malloc(sizeof(NT_DEVICEMODE))) == NULL) {
|
||||
status = ERRnomem;
|
||||
status = WERR_NOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -2959,7 +2967,7 @@ static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
|
||||
*/
|
||||
if (!convert_driver_init(param, ctx, nt_devmode)) {
|
||||
DEBUG(10,("save_driver_init_2: error converting DEVMODE\n"));
|
||||
status = ERRinvalidparam;
|
||||
status = WERR_INVALID_PARAM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -2971,7 +2979,7 @@ static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
|
||||
printer->info_2->devmode = nt_devmode;
|
||||
if (update_driver_init(*printer, 2)!=0) {
|
||||
DEBUG(10,("save_driver_init_2: error updating DEVMODE\n"));
|
||||
status = ERRnomem;
|
||||
status = WERR_NOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -2980,10 +2988,10 @@ static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
|
||||
* printer to match it. This allows initialization of the current printer
|
||||
* as well as the driver.
|
||||
*/
|
||||
if (mod_a_printer(*printer, 2)!=0) {
|
||||
status = mod_a_printer(*printer, 2);
|
||||
if (!W_ERROR_IS_OK(status)) {
|
||||
DEBUG(10,("save_driver_init_2: error setting DEVMODE on printer [%s]\n",
|
||||
printer->info_2->printername));
|
||||
status = ERRinvalidparam;
|
||||
}
|
||||
|
||||
done:
|
||||
@ -3000,9 +3008,9 @@ static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
|
||||
Update the driver init info (DEVMODE and specifics) for a printer
|
||||
****************************************************************************/
|
||||
|
||||
uint32 save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, NT_PRINTER_PARAM *param)
|
||||
WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, NT_PRINTER_PARAM *param)
|
||||
{
|
||||
NTSTATUS status = ERRsuccess;
|
||||
WERROR status = WERR_OK;
|
||||
|
||||
switch (level)
|
||||
{
|
||||
@ -3012,7 +3020,7 @@ uint32 save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, NT_PRINTER
|
||||
break;
|
||||
}
|
||||
default:
|
||||
status=ERRunknownlevel;
|
||||
status=WERR_UNKNOWN_LEVEL;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3038,11 +3046,11 @@ WERROR get_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level, fstring s
|
||||
{
|
||||
if ((printer = (NT_PRINTER_INFO_LEVEL *)malloc(sizeof(NT_PRINTER_INFO_LEVEL))) == NULL) {
|
||||
DEBUG(0,("get_a_printer: malloc fail.\n"));
|
||||
return 1;
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
ZERO_STRUCTP(printer);
|
||||
result=get_a_printer_2(&printer->info_2, sharename);
|
||||
if (result == 0) {
|
||||
if (W_ERROR_IS_OK(result)) {
|
||||
dump_a_printer(*printer, level);
|
||||
*pp_printer = printer;
|
||||
} else {
|
||||
@ -3051,7 +3059,7 @@ WERROR get_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level, fstring s
|
||||
break;
|
||||
}
|
||||
default:
|
||||
result=W_ERROR(1);
|
||||
result=WERR_UNKNOWN_LEVEL;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3146,7 +3154,7 @@ WERROR get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level,
|
||||
break;
|
||||
}
|
||||
|
||||
if (result == 0)
|
||||
if (W_ERROR_IS_OK(result))
|
||||
dump_a_printer_driver(*driver, level);
|
||||
return result;
|
||||
}
|
||||
@ -3284,7 +3292,7 @@ BOOL printer_driver_in_use (char *arch, char *driver)
|
||||
Remove a printer driver from the TDB. This assumes that the the driver was
|
||||
previously looked up.
|
||||
***************************************************************************/
|
||||
NTSTATUS delete_printer_driver (NT_PRINTER_DRIVER_INFO_LEVEL_3 *i)
|
||||
WERROR delete_printer_driver (NT_PRINTER_DRIVER_INFO_LEVEL_3 *i)
|
||||
{
|
||||
pstring key;
|
||||
fstring arch;
|
||||
@ -3301,13 +3309,13 @@ NTSTATUS delete_printer_driver (NT_PRINTER_DRIVER_INFO_LEVEL_3 *i)
|
||||
|
||||
if (tdb_delete(tdb_drivers, kbuf) == -1) {
|
||||
DEBUG (0,("delete_printer_driver: fail to delete %s!\n", key));
|
||||
return NT_STATUS_ACCESS_VIOLATION;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
DEBUG(5,("delete_printer_driver: [%s] driver delete successful.\n",
|
||||
i->name));
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
@ -3461,7 +3469,7 @@ WERROR nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr)
|
||||
slprintf(key, sizeof(key)-1, "SECDESC/%s", printername);
|
||||
|
||||
if (tdb_prs_store(tdb_printers, key, &ps)==0) {
|
||||
status = 0;
|
||||
status = WERR_OK;
|
||||
} else {
|
||||
DEBUG(1,("Failed to store secdesc for %s\n", printername));
|
||||
status = WERR_BADFUNC;
|
||||
@ -3715,7 +3723,8 @@ void map_printer_permissions(SEC_DESC *sd)
|
||||
BOOL print_access_check(struct current_user *user, int snum, int access_type)
|
||||
{
|
||||
SEC_DESC_BUF *secdesc = NULL;
|
||||
uint32 access_granted, status;
|
||||
uint32 access_granted;
|
||||
NTSTATUS status;
|
||||
BOOL result;
|
||||
char *pname;
|
||||
TALLOC_CTX *mem_ctx = NULL;
|
||||
@ -3797,7 +3806,7 @@ BOOL print_time_access_check(int snum)
|
||||
struct tm *t;
|
||||
uint32 mins;
|
||||
|
||||
if (get_a_printer(&printer, 2, lp_servicename(snum))!=0)
|
||||
if (!W_ERROR_IS_OK(get_a_printer(&printer, 2, lp_servicename(snum))))
|
||||
return False;
|
||||
|
||||
if (printer->info_2->starttime == 0 && printer->info_2->untiltime == 0)
|
||||
@ -3821,21 +3830,20 @@ BOOL print_time_access_check(int snum)
|
||||
Attempt to write a default device.
|
||||
*****************************************************************************/
|
||||
|
||||
uint32 printer_write_default_dev(int snum, const PRINTER_DEFAULT *printer_default)
|
||||
WERROR printer_write_default_dev(int snum, const PRINTER_DEFAULT *printer_default)
|
||||
{
|
||||
NT_PRINTER_INFO_LEVEL *printer = NULL;
|
||||
|
||||
uint32 result = 0;
|
||||
WERROR result;
|
||||
|
||||
/*
|
||||
* Don't bother if no default devicemode was sent.
|
||||
*/
|
||||
|
||||
if (printer_default->devmode_cont.devmode == NULL)
|
||||
return 0;
|
||||
return WERR_OK;
|
||||
|
||||
if (get_a_printer(&printer, 2, lp_servicename(snum))!=0)
|
||||
return ERRnoaccess;
|
||||
result = get_a_printer(&printer, 2, lp_servicename(snum));
|
||||
if (!W_ERROR_IS_OK(result)) return result;
|
||||
|
||||
/*
|
||||
* Just ignore it if we already have a devmode.
|
||||
@ -3853,14 +3861,14 @@ uint32 printer_write_default_dev(int snum, const PRINTER_DEFAULT *printer_defaul
|
||||
if ( (printer_default->access_required & PRINTER_ACCESS_ADMINISTER) !=
|
||||
PRINTER_ACCESS_ADMINISTER) {
|
||||
DEBUG(5,("printer_write_default_dev: invalid request access to update: %x\n", printer_default->access_required));
|
||||
result = ERRnoaccess;
|
||||
result = WERR_ACCESS_DENIED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) {
|
||||
DEBUG(5,("printer_write_default_dev: Access denied for printer %s\n",
|
||||
lp_servicename(snum) ));
|
||||
result = ERRnoaccess;
|
||||
result = WERR_ACCESS_DENIED;
|
||||
/*result = NT_STATUS_NO_PROBLEMO;*/
|
||||
goto done;
|
||||
}
|
||||
@ -3874,7 +3882,7 @@ uint32 printer_write_default_dev(int snum, const PRINTER_DEFAULT *printer_defaul
|
||||
if (!convert_devicemode(printer->info_2->printername,
|
||||
printer_default->devmode_cont.devmode,
|
||||
&printer->info_2->devmode)) {
|
||||
result = ERRnomem;
|
||||
result = WERR_NOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -3882,10 +3890,7 @@ uint32 printer_write_default_dev(int snum, const PRINTER_DEFAULT *printer_defaul
|
||||
* Finally write back to the tdb.
|
||||
*/
|
||||
|
||||
if (add_a_printer(*printer, 2)!=0) {
|
||||
result = ERRnoaccess;
|
||||
goto done;
|
||||
}
|
||||
result = add_a_printer(*printer, 2);
|
||||
|
||||
done:
|
||||
|
||||
|
@ -656,7 +656,7 @@ BOOL print_job_pause(struct current_user *user, int jobid, WERROR *errcode)
|
||||
if (!is_owner(user, jobid) &&
|
||||
!print_access_check(user, snum, JOB_ACCESS_ADMINISTER)) {
|
||||
DEBUG(3, ("pause denied by security descriptor\n"));
|
||||
*errcode = ERRnoaccess;
|
||||
*errcode = WERR_ACCESS_DENIED;
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -664,7 +664,7 @@ BOOL print_job_pause(struct current_user *user, int jobid, WERROR *errcode)
|
||||
ret = (*(current_printif->job_pause))(snum, pjob);
|
||||
|
||||
if (ret != 0) {
|
||||
*errcode = ERRinvalidparam;
|
||||
*errcode = WERR_INVALID_PARAM;
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -700,14 +700,14 @@ BOOL print_job_resume(struct current_user *user, int jobid, WERROR *errcode)
|
||||
if (!is_owner(user, jobid) &&
|
||||
!print_access_check(user, snum, JOB_ACCESS_ADMINISTER)) {
|
||||
DEBUG(3, ("resume denied by security descriptor\n"));
|
||||
*errcode = ERRnoaccess;
|
||||
*errcode = WERR_ACCESS_DENIED;
|
||||
return False;
|
||||
}
|
||||
|
||||
ret = (*(current_printif->job_resume))(snum, pjob);
|
||||
|
||||
if (ret != 0) {
|
||||
*errcode = ERRinvalidparam;
|
||||
*errcode = WERR_INVALID_PARAM;
|
||||
return False;
|
||||
}
|
||||
|
||||
|
@ -103,13 +103,13 @@ NT login - interactive.
|
||||
password equivalents, protected by the session key) is inherently insecure
|
||||
given the current design of the NT Domain system. JRA.
|
||||
****************************************************************************/
|
||||
BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username,
|
||||
NTSTATUS cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username,
|
||||
uint32 smb_userid_low, char *password,
|
||||
NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3)
|
||||
{
|
||||
uchar lm_owf_user_pwd[16];
|
||||
uchar nt_owf_user_pwd[16];
|
||||
BOOL ret;
|
||||
NTSTATUS ret;
|
||||
|
||||
DEBUG(5,("cli_nt_login_interactive: %d\n", __LINE__));
|
||||
|
||||
@ -156,7 +156,7 @@ NT login - network.
|
||||
password equivalents over the network. JRA.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 cli_nt_login_network(struct cli_state *cli,
|
||||
NTSTATUS cli_nt_login_network(struct cli_state *cli,
|
||||
const auth_usersupplied_info *user_info,
|
||||
uint32 smb_userid_low, NET_ID_INFO_CTR *ctr,
|
||||
NET_USER_INFO_3 *user_info3)
|
||||
|
@ -80,7 +80,7 @@ BOOL do_lsa_open_policy(struct cli_state *cli,
|
||||
return False;
|
||||
}
|
||||
|
||||
if (r_o.status != 0) {
|
||||
if (!NT_STATUS_IS_OK(r_o.status)) {
|
||||
/* report error code */
|
||||
DEBUG(0,("LSA_OPENPOLICY: %s\n", get_nt_error_msg(r_o.status)));
|
||||
prs_mem_free(&rbuf);
|
||||
@ -145,7 +145,7 @@ BOOL do_lsa_query_info_pol(struct cli_state *cli,
|
||||
return False;
|
||||
}
|
||||
|
||||
if (r_q.status != 0) {
|
||||
if (!NT_STATUS_IS_OK(r_q.status)) {
|
||||
/* report error code */
|
||||
DEBUG(0,("LSA_QUERYINFOPOLICY: %s\n", get_nt_error_msg(r_q.status)));
|
||||
prs_mem_free(&rbuf);
|
||||
@ -238,7 +238,7 @@ BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (r_c.status != 0) {
|
||||
if (!NT_STATUS_IS_OK(r_c.status)) {
|
||||
/* report error code */
|
||||
DEBUG(0,("LSA_CLOSE: %s\n", get_nt_error_msg(r_c.status)));
|
||||
prs_mem_free(&rbuf);
|
||||
@ -285,7 +285,7 @@ BOOL cli_lsa_get_domain_sid(struct cli_state *cli, char *server)
|
||||
/****************************************************************************
|
||||
do a LSA Open Policy
|
||||
****************************************************************************/
|
||||
uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
|
||||
NTSTATUS lsa_open_policy(const char *system_name, POLICY_HND *hnd,
|
||||
BOOL sec_qos, uint32 des_access)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
@ -293,7 +293,7 @@ uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
|
||||
LSA_Q_OPEN_POL q_o;
|
||||
LSA_SEC_QOS qos;
|
||||
struct cli_connection *con = NULL;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
|
||||
if (!cli_connection_init(system_name, PIPE_LSARPC, &con)) {
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
@ -327,7 +327,7 @@ uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
|
||||
|
||||
result = r_o.status;
|
||||
|
||||
if (p && r_o.status != 0) {
|
||||
if (p && !NT_STATUS_IS_OK(r_o.status)) {
|
||||
/* report error code */
|
||||
DEBUG(0,
|
||||
("LSA_OPENPOLICY: %s\n",
|
||||
@ -356,14 +356,14 @@ uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
|
||||
/****************************************************************************
|
||||
do a LSA Close
|
||||
****************************************************************************/
|
||||
uint32 lsa_close(POLICY_HND *hnd)
|
||||
NTSTATUS lsa_close(POLICY_HND *hnd)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
prs_struct buf;
|
||||
LSA_Q_CLOSE q_c;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
if (hnd == NULL) return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* Create and send a MSRPC command with api LSA_OPENPOLICY */
|
||||
|
||||
@ -387,7 +387,7 @@ uint32 lsa_close(POLICY_HND *hnd)
|
||||
p = rbuf.data_offset != 0;
|
||||
result = r_c.status;
|
||||
|
||||
if (p && r_c.status != 0) {
|
||||
if (p && !NT_STATUS_IS_OK(r_c.status)) {
|
||||
|
||||
/* Report error code */
|
||||
|
||||
@ -408,18 +408,19 @@ uint32 lsa_close(POLICY_HND *hnd)
|
||||
/****************************************************************************
|
||||
do a LSA Lookup SIDs
|
||||
****************************************************************************/
|
||||
uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
|
||||
NTSTATUS lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
|
||||
char ***names, uint32 **types, int *num_names)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
prs_struct buf;
|
||||
LSA_Q_LOOKUP_SIDS q_l;
|
||||
TALLOC_CTX *ctx = talloc_init();
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
|
||||
ZERO_STRUCT(q_l);
|
||||
|
||||
if (hnd == NULL || num_sids == 0 || sids == NULL) return False;
|
||||
if (hnd == NULL || num_sids == 0 || sids == NULL)
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (num_names != NULL) {
|
||||
*num_names = 0;
|
||||
@ -459,10 +460,9 @@ uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
|
||||
p = rbuf.data_offset != 0;
|
||||
result = r_l.status;
|
||||
|
||||
if (p && r_l.status != 0 &&
|
||||
r_l.status != 0x107 &&
|
||||
r_l.status != (0xC0000000 | NT_STATUS_NONE_MAPPED)) {
|
||||
|
||||
if (p && !NT_STATUS_IS_OK(r_l.status) &&
|
||||
NT_STATUS_V(r_l.status) != 0x107 &&
|
||||
NT_STATUS_V(r_l.status) != NT_STATUS_V(NT_STATUS_NONE_MAPPED)) {
|
||||
/* Report error code */
|
||||
|
||||
DEBUG(1, ("LSA_LOOKUP_SIDS: %s\n",
|
||||
@ -564,17 +564,18 @@ uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
|
||||
/****************************************************************************
|
||||
do a LSA Lookup Names
|
||||
****************************************************************************/
|
||||
uint32 lsa_lookup_names(POLICY_HND *hnd, int num_names, char **names,
|
||||
DOM_SID **sids, uint32 **types, int *num_sids)
|
||||
NTSTATUS lsa_lookup_names(POLICY_HND *hnd, int num_names, char **names,
|
||||
DOM_SID **sids, uint32 **types, int *num_sids)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
prs_struct buf;
|
||||
LSA_Q_LOOKUP_NAMES q_l;
|
||||
BOOL valid_response = False;
|
||||
TALLOC_CTX *ctx = talloc_init();
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
|
||||
if (hnd == NULL || num_sids == 0 || sids == NULL) return False;
|
||||
if (hnd == NULL || num_sids == 0 || sids == NULL)
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
prs_init(&buf, MAX_PDU_FRAG_LEN, ctx, MARSHALL);
|
||||
prs_init(&rbuf, 0, ctx, UNMARSHALL);
|
||||
@ -603,7 +604,7 @@ uint32 lsa_lookup_names(POLICY_HND *hnd, int num_names, char **names,
|
||||
lsa_io_r_lookup_names("", &r_l, &rbuf, 0);
|
||||
p = rbuf.data_offset != 0;
|
||||
|
||||
if (p && r_l.status != 0) {
|
||||
if (p && !NT_STATUS_IS_OK(r_l.status)) {
|
||||
/* report error code */
|
||||
DEBUG(1,
|
||||
("LSA_LOOKUP_NAMES: %s\n",
|
||||
|
@ -154,7 +154,7 @@ BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan,
|
||||
|
||||
ok = net_io_r_auth_2("", &r_a, &rbuf, 0);
|
||||
|
||||
if (ok && r_a.status != 0)
|
||||
if (ok && !NT_STATUS_IS_OK(r_a.status))
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("cli_net_auth2: Error %s\n", get_nt_error_msg(r_a.status)));
|
||||
@ -243,7 +243,7 @@ BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_
|
||||
|
||||
ok = net_io_r_req_chal("", &r_c, &rbuf, 0);
|
||||
|
||||
if (ok && r_c.status != 0)
|
||||
if (ok && !NT_STATUS_IS_OK(r_c.status))
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("cli_net_req_chal: Error %s\n", get_nt_error_msg(r_c.status)));
|
||||
@ -308,7 +308,7 @@ BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16])
|
||||
|
||||
ok = net_io_r_srv_pwset("", &r_s, &rbuf, 0);
|
||||
|
||||
if (ok && r_s.status != 0)
|
||||
if (ok && !NT_STATUS_IS_OK(r_s.status))
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("cli_net_srv_pwset: %s\n", get_nt_error_msg(r_s.status)));
|
||||
@ -338,8 +338,9 @@ password ?).\n", cli->desthost ));
|
||||
returns level 3.
|
||||
****************************************************************************/
|
||||
|
||||
static uint32 cli_net_sam_logon_internal(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
|
||||
NET_USER_INFO_3 *user_info3, uint16 validation_level)
|
||||
static NTSTATUS cli_net_sam_logon_internal(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
|
||||
NET_USER_INFO_3 *user_info3,
|
||||
uint16 validation_level)
|
||||
{
|
||||
DOM_CRED new_clnt_cred;
|
||||
DOM_CRED dummy_rtn_creds;
|
||||
@ -347,7 +348,7 @@ static uint32 cli_net_sam_logon_internal(struct cli_state *cli, NET_ID_INFO_CTR
|
||||
prs_struct buf;
|
||||
NET_Q_SAM_LOGON q_s;
|
||||
NET_R_SAM_LOGON r_s;
|
||||
uint32 retval = 0;
|
||||
NTSTATUS retval = NT_STATUS_OK;
|
||||
|
||||
gen_next_creds( cli, &new_clnt_cred);
|
||||
|
||||
@ -398,38 +399,38 @@ static uint32 cli_net_sam_logon_internal(struct cli_state *cli, NET_ID_INFO_CTR
|
||||
* the call.
|
||||
*/
|
||||
|
||||
if (retval == NT_STATUS_INVALID_INFO_CLASS) {
|
||||
if (NT_STATUS_V(retval) == NT_STATUS_V(NT_STATUS_INVALID_INFO_CLASS)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (retval != 0) {
|
||||
if (!NT_STATUS_IS_OK(retval)) {
|
||||
/* report error code */
|
||||
DEBUG(0,("cli_net_sam_logon_internal: %s\n", get_nt_error_msg(r_s.status)));
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the credentials. */
|
||||
if (!clnt_deal_with_creds(cli->sess_key, &cli->clnt_cred, &r_s.srv_creds)) {
|
||||
/* Update the credentials. */
|
||||
if (!clnt_deal_with_creds(cli->sess_key, &cli->clnt_cred, &r_s.srv_creds)) {
|
||||
/*
|
||||
* Server replied with bad credential. Fail.
|
||||
*/
|
||||
DEBUG(0,("cli_net_sam_logon_internal: server %s replied with bad credential (bad machine \
|
||||
password ?).\n", cli->desthost ));
|
||||
retval = NT_STATUS_WRONG_PASSWORD;
|
||||
}
|
||||
|
||||
if (r_s.switch_value != validation_level) {
|
||||
}
|
||||
|
||||
if (r_s.switch_value != validation_level) {
|
||||
/* report different switch_value */
|
||||
DEBUG(0,("cli_net_sam_logon: switch_value of %x expected %x\n", (unsigned int)validation_level,
|
||||
(unsigned int)r_s.switch_value));
|
||||
(unsigned int)r_s.switch_value));
|
||||
retval = NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
|
||||
prs_mem_free(&buf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -437,18 +438,18 @@ password ?).\n", cli->desthost ));
|
||||
LSA SAM Logon - interactive or network.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
|
||||
NTSTATUS cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
|
||||
NET_USER_INFO_3 *user_info3)
|
||||
{
|
||||
uint16 validation_level=3;
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
|
||||
result = cli_net_sam_logon_internal(cli, ctr, user_info3,
|
||||
validation_level);
|
||||
|
||||
if(result == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(result)) {
|
||||
DEBUG(10,("cli_net_sam_logon: Success \n"));
|
||||
} else if (result == NT_STATUS_INVALID_INFO_CLASS) {
|
||||
} else if (NT_STATUS_V(result) == NT_STATUS_V(NT_STATUS_INVALID_INFO_CLASS)) {
|
||||
DEBUG(10,("cli_net_sam_logon: STATUS INVALID INFO CLASS \n"));
|
||||
|
||||
validation_level=2;
|
||||
@ -518,7 +519,7 @@ BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
|
||||
|
||||
ok = net_io_r_sam_logoff("", &r_s, &rbuf, 0);
|
||||
|
||||
if (ok && r_s.status != 0)
|
||||
if (ok && !NT_STATUS_IS_OK(r_s.status))
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("cli_net_sam_logoff: %s\n", get_nt_error_msg(r_s.status)));
|
||||
|
@ -132,7 +132,7 @@ BOOL spoolss_connect_to_client( struct cli_state *cli, char *remote_machine)
|
||||
do a reply open printer
|
||||
****************************************************************************/
|
||||
|
||||
BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, NTSTATUS *status, POLICY_HND *handle)
|
||||
BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, WERROR *status, POLICY_HND *handle)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
prs_struct buf;
|
||||
@ -188,7 +188,7 @@ BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32
|
||||
****************************************************************************/
|
||||
|
||||
BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle,
|
||||
uint32 change_low, uint32 change_high, NTSTATUS *status)
|
||||
uint32 change_low, uint32 change_high, WERROR *status)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
prs_struct buf;
|
||||
@ -242,7 +242,8 @@ BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle,
|
||||
do a reply open printer
|
||||
****************************************************************************/
|
||||
|
||||
BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, NTSTATUS *status)
|
||||
BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle,
|
||||
WERROR *status)
|
||||
{
|
||||
prs_struct rbuf;
|
||||
prs_struct buf;
|
||||
|
@ -66,7 +66,7 @@ BOOL dfs_io_r_dfs_exist(char *desc, DFS_R_DFS_EXIST *q_d, prs_struct *ps, int de
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("exist flag", ps, 0, &q_d->status))
|
||||
if(!prs_ntstatus("exist flag", ps, 0, &q_d->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -139,7 +139,7 @@ BOOL dfs_io_r_dfs_remove(char *desc, DFS_R_DFS_REMOVE *r_d, prs_struct *ps, int
|
||||
prs_debug(ps, depth, desc, "dfs_io_r_dfs_remove");
|
||||
depth++;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_d->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_d->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -225,7 +225,7 @@ BOOL dfs_io_r_dfs_add(char *desc, DFS_R_DFS_ADD *r_d, prs_struct *ps, int depth)
|
||||
prs_debug(ps, depth, desc, "dfs_io_r_dfs_add");
|
||||
depth++;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_d->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_d->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -300,7 +300,7 @@ BOOL dfs_io_r_dfs_get_info(char* desc, DFS_R_DFS_GET_INFO* r_i, prs_struct* ps,
|
||||
|
||||
if(!dfs_io_dfs_info_ctr("", &r_i->ctr, 1, r_i->level, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_i->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_i->status))
|
||||
return False;
|
||||
return True;
|
||||
}
|
||||
@ -501,7 +501,7 @@ BOOL dfs_io_r_dfs_enum(char *desc, DFS_R_DFS_ENUM *q_d, prs_struct *ps, int dept
|
||||
|
||||
if(!smb_io_enum_hnd("resume_hnd", &q_d->reshnd, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &q_d->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &q_d->status))
|
||||
return False;
|
||||
return True;
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ BOOL lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps,
|
||||
if(!smb_io_pol_hnd("", &r_p->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_p->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_p->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -391,7 +391,7 @@ BOOL lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps,
|
||||
if(!smb_io_pol_hnd("", &r_p->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_p->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_p->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -452,7 +452,7 @@ BOOL lsa_io_r_query_sec_obj(char *desc, LSA_R_QUERY_SEC_OBJ *r_u,
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -538,7 +538,7 @@ void init_r_enum_trust_dom(TALLOC_CTX *ctx, LSA_R_ENUM_TRUST_DOM *r_e, uint32 en
|
||||
|
||||
r_e->enum_context = enum_context;
|
||||
|
||||
if (status == 0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
int len_domain_name = strlen(domain_name) + 1;
|
||||
|
||||
r_e->num_domains = 1;
|
||||
@ -619,7 +619,7 @@ BOOL lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e,
|
||||
}
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_e->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_e->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -789,7 +789,7 @@ BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1031,7 +1031,7 @@ BOOL lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s,
|
||||
if(!prs_uint32("mapped_count", ps, depth, &r_s->mapped_count))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_s->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_s->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1192,7 +1192,7 @@ BOOL lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r,
|
||||
if(!prs_uint32("mapped_count", ps, depth, &r_r->mapped_count))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1237,7 +1237,7 @@ BOOL lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth)
|
||||
if(!smb_io_pol_hnd("", &r_c->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1276,7 +1276,7 @@ BOOL lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_c, prs_struct *ps, in
|
||||
return False;
|
||||
if(!prs_uint32("dummy4", ps, depth, &r_c->dummy4))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1391,7 +1391,7 @@ BOOL lsa_io_r_enum_privs(char *desc, LSA_R_ENUM_PRIVS *r_q, prs_struct *ps, int
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1461,7 +1461,7 @@ BOOL lsa_io_r_priv_get_dispname(char *desc, LSA_R_PRIV_GET_DISPNAME *r_q, prs_st
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1532,7 +1532,7 @@ BOOL lsa_io_r_enum_accounts(char *desc, LSA_R_ENUM_ACCOUNTS *r_q, prs_struct *ps
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1603,7 +1603,7 @@ BOOL lsa_io_r_unk_get_connuser(char *desc, LSA_R_UNK_GET_CONNUSER *r_c, prs_stru
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1648,7 +1648,7 @@ BOOL lsa_io_r_open_account(char *desc, LSA_R_OPENACCOUNT *r_c, prs_struct *ps,
|
||||
if(!smb_io_pol_hnd("pol", &r_c->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1776,7 +1776,7 @@ BOOL lsa_io_r_enum_privsaccount(char *desc, LSA_R_ENUMPRIVSACCOUNT *r_c, prs_str
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1817,7 +1817,7 @@ BOOL lsa_io_r_getsystemaccount(char *desc, LSA_R_GETSYSTEMACCOUNT *r_c, prs_str
|
||||
if(!prs_uint32("access", ps, depth, &r_c->access))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -249,18 +249,18 @@ void init_net_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level,
|
||||
case 1:
|
||||
r_l->ptr = 1; /* undocumented pointer */
|
||||
init_netinfo_1(&r_l->logon.info1, flags, pdc_status);
|
||||
r_l->status = 0;
|
||||
r_l->status = NT_STATUS_OK;
|
||||
break;
|
||||
case 2:
|
||||
r_l->ptr = 1; /* undocumented pointer */
|
||||
init_netinfo_2(&r_l->logon.info2, flags, pdc_status,
|
||||
tc_status, trusted_domain_name);
|
||||
r_l->status = 0;
|
||||
r_l->status = NT_STATUS_OK;
|
||||
break;
|
||||
case 3:
|
||||
r_l->ptr = 1; /* undocumented pointer */
|
||||
init_netinfo_3(&(r_l->logon.info3), flags, logon_attempts);
|
||||
r_l->status = 0;
|
||||
r_l->status = NT_STATUS_OK;
|
||||
break;
|
||||
default:
|
||||
DEBUG(2,("init_r_logon_ctrl2: unsupported switch value %d\n",
|
||||
@ -311,7 +311,7 @@ BOOL net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, in
|
||||
}
|
||||
}
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_l->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_l->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -377,7 +377,7 @@ void init_net_r_logon_ctrl(NET_R_LOGON_CTRL *r_l, uint32 query_level,
|
||||
case 1:
|
||||
r_l->ptr = 1; /* undocumented pointer */
|
||||
init_netinfo_1(&r_l->logon.info1, flags, pdc_status);
|
||||
r_l->status = 0;
|
||||
r_l->status = NT_STATUS_OK;
|
||||
break;
|
||||
default:
|
||||
DEBUG(2,("init_r_logon_ctrl: unsupported switch value %d\n",
|
||||
@ -418,7 +418,7 @@ BOOL net_io_r_logon_ctrl(char *desc, NET_R_LOGON_CTRL *r_l, prs_struct *ps,
|
||||
}
|
||||
}
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_l->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_l->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -451,7 +451,7 @@ void init_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t,
|
||||
r_t->uni_trust_dom_name[i].undoc = 0x1;
|
||||
}
|
||||
|
||||
r_t->status = 0;
|
||||
r_t->status = NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@ -499,7 +499,7 @@ BOOL net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, i
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_t->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_t->status))
|
||||
return False;
|
||||
#endif
|
||||
return True;
|
||||
@ -602,7 +602,7 @@ BOOL net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int dept
|
||||
if(!smb_io_chal("", &r_c->srv_chal, ps, depth)) /* server challenge */
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_c->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_c->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -658,7 +658,7 @@ BOOL net_io_r_auth(char *desc, NET_R_AUTH *r_a, prs_struct *ps, int depth)
|
||||
if(!smb_io_chal("", &r_a->srv_chal, ps, depth)) /* server challenge */
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_a->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_a->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -734,7 +734,7 @@ BOOL net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth)
|
||||
if(!net_io_neg_flags("", &r_a->srv_flgs, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_a->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_a->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -796,7 +796,7 @@ BOOL net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int de
|
||||
if(!smb_io_cred("", &r_s->srv_cred, ps, depth)) /* server challenge */
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_s->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_s->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1534,7 +1534,7 @@ BOOL net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int de
|
||||
if(!prs_uint32("auth_resp ", ps, depth, &r_l->auth_resp)) /* 1 - Authoritative response; 0 - Non-Auth? */
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_l->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_l->status))
|
||||
return False;
|
||||
|
||||
if(!prs_align(ps))
|
||||
@ -1584,7 +1584,7 @@ BOOL net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int
|
||||
if(!smb_io_cred("", &r_l->srv_creds, ps, depth)) /* server credentials. server time stamp appears to be ignored. */
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_l->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_l->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -551,6 +551,67 @@ BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32)
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Stream a NTSTATUS
|
||||
********************************************************************/
|
||||
|
||||
BOOL prs_ntstatus(char *name, prs_struct *ps, int depth, NTSTATUS *status)
|
||||
{
|
||||
char *q = prs_mem_get(ps, sizeof(uint32));
|
||||
if (q == NULL)
|
||||
return False;
|
||||
|
||||
if (UNMARSHALLING(ps)) {
|
||||
if (ps->bigendian_data)
|
||||
*status = NT_STATUS(RIVAL(q,0));
|
||||
else
|
||||
*status = NT_STATUS(IVAL(q,0));
|
||||
} else {
|
||||
if (ps->bigendian_data)
|
||||
RSIVAL(q,0,NT_STATUS_V(*status));
|
||||
else
|
||||
SIVAL(q,0,NT_STATUS_V(*status));
|
||||
}
|
||||
|
||||
DEBUG(5,("%s%04x %s: %s\n", tab_depth(depth), ps->data_offset, name,
|
||||
get_nt_error_msg(*status)));
|
||||
|
||||
ps->data_offset += sizeof(uint32);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Stream a WERROR
|
||||
********************************************************************/
|
||||
|
||||
BOOL prs_werror(char *name, prs_struct *ps, int depth, WERROR *status)
|
||||
{
|
||||
char *q = prs_mem_get(ps, sizeof(uint32));
|
||||
if (q == NULL)
|
||||
return False;
|
||||
|
||||
if (UNMARSHALLING(ps)) {
|
||||
if (ps->bigendian_data)
|
||||
*status = W_ERROR(RIVAL(q,0));
|
||||
else
|
||||
*status = W_ERROR(IVAL(q,0));
|
||||
} else {
|
||||
if (ps->bigendian_data)
|
||||
RSIVAL(q,0,W_ERROR_V(*status));
|
||||
else
|
||||
SIVAL(q,0,W_ERROR_V(*status));
|
||||
}
|
||||
|
||||
DEBUG(5,("%s%04x %s: %s\n", tab_depth(depth), ps->data_offset, name,
|
||||
werror_str(*status)));
|
||||
|
||||
ps->data_offset += sizeof(uint32);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
Stream an array of uint8s. Length is number of uint8s.
|
||||
********************************************************************/
|
||||
|
@ -91,7 +91,7 @@ BOOL reg_io_r_open_hkcr(char *desc, REG_R_OPEN_HKCR *r_r, prs_struct *ps, int d
|
||||
if(!smb_io_pol_hnd("", &r_r->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -160,7 +160,7 @@ BOOL reg_io_r_open_hklm(char *desc, REG_R_OPEN_HKLM * r_r, prs_struct *ps,
|
||||
if (!smb_io_pol_hnd("", &(r_r->pol), ps, depth))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &(r_r->status)))
|
||||
if (!prs_ntstatus("status", ps, depth, &(r_r->status)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -212,7 +212,7 @@ BOOL reg_io_r_flush_key(char *desc, REG_R_FLUSH_KEY *r_r, prs_struct *ps, int d
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -365,7 +365,7 @@ BOOL reg_io_r_create_key(char *desc, REG_R_CREATE_KEY *r_r, prs_struct *ps, int
|
||||
if(!prs_uint32("unknown", ps, depth, &r_r->unknown))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -432,7 +432,7 @@ BOOL reg_io_r_delete_val(char *desc, REG_R_DELETE_VALUE *r_r, prs_struct *ps, i
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -497,7 +497,7 @@ BOOL reg_io_r_delete_key(char *desc, REG_R_DELETE_KEY *r_r, prs_struct *ps, int
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -586,7 +586,7 @@ BOOL reg_io_r_query_key(char *desc, REG_R_QUERY_KEY *r_r, prs_struct *ps, int d
|
||||
if(!smb_io_time("mod_time ", &r_r->mod_time, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -639,7 +639,7 @@ BOOL reg_io_r_unk_1a(char *desc, REG_R_UNK_1A *r_r, prs_struct *ps, int depth)
|
||||
|
||||
if(!prs_uint32("unknown", ps, depth, &r_r->unknown))
|
||||
return False;
|
||||
if(!prs_uint32("status" , ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status" , ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -705,7 +705,7 @@ BOOL reg_io_r_open_hku(char *desc, REG_R_OPEN_HKU *r_r, prs_struct *ps, int dep
|
||||
if(!smb_io_pol_hnd("", &r_r->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -765,7 +765,7 @@ BOOL reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth)
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -830,7 +830,7 @@ BOOL reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, in
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -928,7 +928,7 @@ BOOL reg_io_r_get_key_sec(char *desc, REG_R_GET_KEY_SEC *r_q, prs_struct *ps, i
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1103,7 +1103,7 @@ BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth)
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1247,7 +1247,7 @@ BOOL reg_io_r_enum_val(char *desc, REG_R_ENUM_VALUE *r_q, prs_struct *ps, int d
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1324,7 +1324,7 @@ BOOL reg_io_r_create_val(char *desc, REG_R_CREATE_VALUE *r_q, prs_struct *ps, i
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1457,7 +1457,7 @@ BOOL reg_io_r_enum_key(char *desc, REG_R_ENUM_KEY *r_q, prs_struct *ps, int dep
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_q->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_q->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1543,7 +1543,7 @@ BOOL reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int
|
||||
if(!smb_io_pol_hnd("", &r_r->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_r->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_r->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1622,7 +1622,7 @@ BOOL reg_io_r_shutdown(char *desc, REG_R_SHUTDOWN * r_s, prs_struct *ps,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &(r_s->status)))
|
||||
if(!prs_ntstatus("status", ps, depth, &(r_s->status)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1677,7 +1677,7 @@ BOOL reg_io_r_abort_shutdown(char *desc, REG_R_ABORT_SHUTDOWN * r_s,
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &(r_s->status)))
|
||||
if (!prs_ntstatus("status", ps, depth, &(r_s->status)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -520,7 +520,7 @@ BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT *rpc, prs_struct *ps, int de
|
||||
prs_debug(ps, depth, desc, "smb_io_rpc_hdr_fault");
|
||||
depth++;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &rpc->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &rpc->status))
|
||||
return False;
|
||||
if(!prs_uint32("reserved", ps, depth, &rpc->reserved))
|
||||
return False;
|
||||
|
@ -78,7 +78,7 @@ BOOL samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND * r_u,
|
||||
if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -139,7 +139,7 @@ void init_samr_r_lookup_domain(SAMR_R_LOOKUP_DOMAIN * r_u,
|
||||
|
||||
r_u->status = status;
|
||||
r_u->ptr_sid = 0;
|
||||
if (status == 0x0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->ptr_sid = 1;
|
||||
init_dom_sid2(&r_u->dom_sid, dom_sid);
|
||||
}
|
||||
@ -171,7 +171,7 @@ BOOL samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN * r_u,
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -233,7 +233,7 @@ BOOL samr_io_r_unknown_2d(char *desc, SAMR_R_UNKNOWN_2D * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -301,7 +301,7 @@ BOOL samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN * r_u,
|
||||
if(!smb_io_pol_hnd("domain_pol", &r_u->domain_pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -375,7 +375,7 @@ BOOL samr_io_r_get_usrdom_pwinfo(char *desc, SAMR_R_GET_USRDOM_PWINFO * r_u,
|
||||
return False;
|
||||
if(!prs_uint32("unknown_2", ps, depth, &r_u->unknown_2))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -770,7 +770,7 @@ void init_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO * r_u,
|
||||
r_u->switch_value = 0;
|
||||
r_u->status = status; /* return status */
|
||||
|
||||
if (status == 0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->switch_value = switch_value;
|
||||
r_u->ptr_0 = 1;
|
||||
r_u->ctr = ctr;
|
||||
@ -842,7 +842,7 @@ BOOL samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -871,7 +871,7 @@ BOOL samr_io_r_query_sec_obj(char *desc, SAMR_R_QUERY_SEC_OBJ * r_u,
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1361,7 +1361,7 @@ BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS * r_u,
|
||||
|
||||
if(!prs_uint32("num_entries4", ps, depth, &r_u->num_entries4))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2006,7 +2006,7 @@ BOOL samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO * r_u,
|
||||
if (r_u->ptr_entries==0) {
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2050,7 +2050,7 @@ BOOL samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2117,7 +2117,7 @@ BOOL samr_io_r_open_group(char *desc, SAMR_R_OPEN_GROUP * r_u,
|
||||
if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2338,7 +2338,7 @@ BOOL samr_io_r_create_dom_group(char *desc, SAMR_R_CREATE_DOM_GROUP * r_u,
|
||||
|
||||
if(!prs_uint32("rid ", ps, depth, &r_u->rid))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2394,7 +2394,7 @@ BOOL samr_io_r_delete_dom_group(char *desc, SAMR_R_DELETE_DOM_GROUP * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2466,7 +2466,7 @@ BOOL samr_io_r_del_groupmem(char *desc, SAMR_R_DEL_GROUPMEM * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2541,7 +2541,7 @@ BOOL samr_io_r_add_groupmem(char *desc, SAMR_R_ADD_GROUPMEM * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2612,7 +2612,7 @@ BOOL samr_io_r_set_groupinfo(char *desc, SAMR_R_SET_GROUPINFO * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2666,7 +2666,7 @@ void init_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_query_groupinfo\n"));
|
||||
|
||||
r_u->ptr = (status == 0x0 && ctr != NULL) ? 1 : 0;
|
||||
r_u->ptr = (NT_STATUS_IS_OK(status) && ctr != NULL) ? 1 : 0;
|
||||
r_u->ctr = ctr;
|
||||
r_u->status = status;
|
||||
}
|
||||
@ -2697,7 +2697,7 @@ BOOL samr_io_r_query_groupinfo(char *desc, SAMR_R_QUERY_GROUPINFO * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2746,7 +2746,7 @@ void init_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_query_groupmem\n"));
|
||||
|
||||
if (status == 0x0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->ptr = 1;
|
||||
r_u->num_entries = num_entries;
|
||||
|
||||
@ -2830,7 +2830,7 @@ BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM * r_u,
|
||||
}
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2880,7 +2880,7 @@ void init_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_query_usergroups\n"));
|
||||
|
||||
if (status == 0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->ptr_0 = 1;
|
||||
r_u->num_entries = num_gids;
|
||||
r_u->ptr_1 = (num_gids != 0) ? 1 : 0;
|
||||
@ -2968,7 +2968,7 @@ BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3107,7 +3107,7 @@ BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS * r_u,
|
||||
return False;
|
||||
if(!prs_uint32("num_entries4", ps, depth, &r_u->num_entries4))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3241,7 +3241,7 @@ BOOL samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS * r_u,
|
||||
return False;
|
||||
if(!prs_uint32("num_entries4", ps, depth, &r_u->num_entries4))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3376,7 +3376,7 @@ BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES * r_u,
|
||||
return False;
|
||||
if(!prs_uint32("num_entries4", ps, depth, &r_u->num_entries4))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3499,7 +3499,7 @@ void init_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_query_aliasinfo\n"));
|
||||
|
||||
r_u->ptr = (status == 0x0 && ctr != NULL) ? 1 : 0;
|
||||
r_u->ptr = (NT_STATUS_IS_OK(status) && ctr != NULL) ? 1 : 0;
|
||||
r_u->ctr = *ctr;
|
||||
r_u->status = status;
|
||||
}
|
||||
@ -3530,7 +3530,7 @@ BOOL samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3588,7 +3588,7 @@ BOOL samr_io_r_set_aliasinfo(char *desc, SAMR_R_SET_ALIASINFO * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3685,7 +3685,7 @@ void init_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_query_useraliases\n"));
|
||||
|
||||
if (status == 0x0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->num_entries = num_rids;
|
||||
r_u->ptr = 1;
|
||||
r_u->num_entries2 = num_rids;
|
||||
@ -3767,7 +3767,7 @@ BOOL samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3833,7 +3833,7 @@ BOOL samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS * r_u,
|
||||
if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4027,7 +4027,7 @@ BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS * r_u,
|
||||
}
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4084,7 +4084,7 @@ BOOL samr_io_r_delete_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
|
||||
|
||||
if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4164,7 +4164,7 @@ BOOL samr_io_r_create_dom_alias(char *desc, SAMR_R_CREATE_DOM_ALIAS * r_u,
|
||||
if(!prs_uint32("rid", ps, depth, &r_u->rid))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4223,7 +4223,7 @@ BOOL samr_io_r_add_aliasmem(char *desc, SAMR_R_ADD_ALIASMEM * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4282,7 +4282,7 @@ BOOL samr_io_r_del_aliasmem(char *desc, SAMR_R_DEL_ALIASMEM * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4350,7 +4350,7 @@ BOOL samr_io_r_delete_dom_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4400,7 +4400,7 @@ void init_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_query_aliasmem\n"));
|
||||
|
||||
if (status == 0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->num_sids = num_sids;
|
||||
r_u->ptr = (num_sids != 0) ? 1 : 0;
|
||||
r_u->num_sids1 = num_sids;
|
||||
@ -4462,7 +4462,7 @@ BOOL samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4568,7 +4568,7 @@ NTSTATUS init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u,
|
||||
{
|
||||
DEBUG(5, ("init_samr_r_lookup_names\n"));
|
||||
|
||||
if ((status == 0) && (num_rids != 0)) {
|
||||
if (NT_STATUS_IS_OK(status) && (num_rids != 0)) {
|
||||
uint32 i;
|
||||
|
||||
r_u->num_types1 = num_rids;
|
||||
@ -4691,7 +4691,7 @@ BOOL samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES * r_u,
|
||||
}
|
||||
}
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4747,7 +4747,7 @@ BOOL samr_io_r_delete_dom_user(char *desc, SAMR_R_DELETE_DOM_USER * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4814,7 +4814,7 @@ BOOL samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER * r_u,
|
||||
if(!smb_io_pol_hnd("user_pol", &r_u->user_pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4901,7 +4901,7 @@ BOOL samr_io_r_create_user(char *desc, SAMR_R_CREATE_USER * r_u,
|
||||
return False;
|
||||
if(!prs_uint32("user_rid ", ps, depth, &r_u->user_rid))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6237,7 +6237,7 @@ void init_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO * r_u,
|
||||
r_u->ptr = 0;
|
||||
r_u->ctr = NULL;
|
||||
|
||||
if (status == 0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
r_u->ptr = 1;
|
||||
r_u->ctr = ctr;
|
||||
}
|
||||
@ -6271,7 +6271,7 @@ BOOL samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO * r_u,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6345,7 +6345,7 @@ BOOL samr_io_r_set_userinfo(char *desc, SAMR_R_SET_USERINFO * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6433,7 +6433,7 @@ BOOL samr_io_r_set_userinfo2(char *desc, SAMR_R_SET_USERINFO2 * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6506,7 +6506,7 @@ BOOL samr_io_r_connect(char *desc, SAMR_R_CONNECT * r_u,
|
||||
if(!smb_io_pol_hnd("connect_pol", &r_u->connect_pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6573,7 +6573,7 @@ BOOL samr_io_r_connect_anon(char *desc, SAMR_R_CONNECT_ANON * r_u,
|
||||
if(!smb_io_pol_hnd("connect_pol", &r_u->connect_pol, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6652,7 +6652,7 @@ BOOL samr_io_r_get_dom_pwinfo(char *desc, SAMR_R_GET_DOM_PWINFO * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6848,7 +6848,7 @@ BOOL samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER * r_u,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -952,7 +952,7 @@ BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_
|
||||
if (!smb_io_pol_hnd("printer handle",&(r_u->handle),ps,depth))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status code", ps, depth, &(r_u->status)))
|
||||
if (!prs_werror("status code", ps, depth, &(r_u->status)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1040,7 +1040,7 @@ BOOL spoolss_io_r_deleteprinterdata(char *desc, SPOOL_R_DELETEPRINTERDATA *r_u,
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdata");
|
||||
depth++;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1074,7 +1074,7 @@ BOOL spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_st
|
||||
|
||||
if (!prs_uint32("needed", ps, depth, &r_u->needed))
|
||||
return False;
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1126,7 +1126,7 @@ BOOL spoolss_io_r_abortprinter(char *desc, SPOOL_R_ABORTPRINTER *r_u, prs_struct
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_abortprinter");
|
||||
depth++;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1170,7 +1170,7 @@ BOOL spoolss_io_r_deleteprinter(char *desc, SPOOL_R_DELETEPRINTER *r_u, prs_stru
|
||||
|
||||
if (!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
|
||||
return False;
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1220,7 +1220,7 @@ BOOL spoolss_io_r_deleteprinterdriver(char *desc, SPOOL_R_DELETEPRINTERDRIVER *r
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1266,7 +1266,7 @@ BOOL spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct
|
||||
|
||||
if (!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
|
||||
return False;
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1307,7 +1307,7 @@ BOOL spoolss_io_r_startdocprinter(char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_
|
||||
depth++;
|
||||
if(!prs_uint32("jobid", ps, depth, &r_u->jobid))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1343,7 +1343,7 @@ BOOL spoolss_io_r_enddocprinter(char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_stru
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_enddocprinter");
|
||||
depth++;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1379,7 +1379,7 @@ BOOL spoolss_io_r_startpageprinter(char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, pr
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_startpageprinter");
|
||||
depth++;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1415,7 +1415,7 @@ BOOL spoolss_io_r_endpageprinter(char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_st
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_endpageprinter");
|
||||
depth++;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1469,7 +1469,7 @@ BOOL spoolss_io_r_writeprinter(char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct
|
||||
depth++;
|
||||
if(!prs_uint32("buffer_written", ps, depth, &r_u->buffer_written))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1531,7 +1531,7 @@ BOOL spoolss_io_r_rffpcnex(char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, in
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_rffpcnex");
|
||||
depth++;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1593,7 +1593,7 @@ BOOL spoolss_io_r_rfnpcnex(char *desc, SPOOL_R_RFNPCNEX *r_u, prs_struct *ps, in
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3329,7 +3329,7 @@ BOOL spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u,
|
||||
return False;
|
||||
if (!prs_uint32("serverminorversion", ps, depth, &r_u->serverminorversion))
|
||||
return False;
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3439,7 +3439,7 @@ BOOL spoolss_io_r_enumprinters(char *desc, SPOOL_R_ENUMPRINTERS *r_u, prs_struct
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3468,7 +3468,7 @@ BOOL spoolss_io_r_getprinter(char *desc, SPOOL_R_GETPRINTER *r_u, prs_struct *ps
|
||||
if (!prs_uint32("needed", ps, depth, &r_u->needed))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3608,7 +3608,7 @@ BOOL spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3685,7 +3685,7 @@ BOOL spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth)
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3730,7 +3730,7 @@ BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int de
|
||||
if(!prs_uint32("needed", ps, depth, &r_u->needed))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3787,7 +3787,7 @@ BOOL spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, in
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3857,7 +3857,7 @@ BOOL spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct *
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3893,7 +3893,7 @@ BOOL spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int de
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -3950,7 +3950,7 @@ BOOL spoolss_io_r_enumprinterdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4068,7 +4068,7 @@ BOOL spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps,
|
||||
if (!prs_uint32("numofforms", ps, depth, &r_u->numofforms))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4127,7 +4127,7 @@ BOOL spoolss_io_r_getform(char *desc, SPOOL_R_GETFORM *r_u, prs_struct *ps, int
|
||||
if (!prs_uint32("size of buffer needed", ps, depth, &r_u->needed))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4157,7 +4157,7 @@ BOOL spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps,
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4294,7 +4294,7 @@ BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 *il, p
|
||||
return False;
|
||||
if(!prs_uint32("untiltime", ps, depth, &il->untiltime))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &il->status))
|
||||
if(!prs_werror("status", ps, depth, &il->status))
|
||||
return False;
|
||||
if(!prs_uint32("cjobs", ps, depth, &il->cjobs))
|
||||
return False;
|
||||
@ -4461,7 +4461,7 @@ BOOL spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u,
|
||||
if(!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -4953,7 +4953,7 @@ BOOL spoolss_io_r_addprinterdriver(char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, pr
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_addprinterdriver");
|
||||
depth++;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &q_u->status))
|
||||
if(!prs_werror("status", ps, depth, &q_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5190,7 +5190,7 @@ BOOL spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r
|
||||
if (!prs_uint32("needed", ps, depth, &r_u->needed))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5219,7 +5219,7 @@ BOOL spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5312,7 +5312,7 @@ BOOL spoolss_io_r_addprintprocessor(char *desc, SPOOL_R_ADDPRINTPROCESSOR *r_u,
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5341,7 +5341,7 @@ BOOL spoolss_io_r_enumprintprocdatatypes(char *desc, SPOOL_R_ENUMPRINTPROCDATATY
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5447,7 +5447,7 @@ BOOL spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u,
|
||||
if (!prs_uint32("returned", ps, depth, &r_u->returned))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5487,7 +5487,7 @@ BOOL spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_
|
||||
|
||||
if(!prs_uint32("realdatasize", ps, depth, &r_u->realdatasize))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5589,7 +5589,7 @@ BOOL spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_st
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5696,7 +5696,7 @@ BOOL spoolss_io_r_deleteform(char *desc, SPOOL_R_DELETEFORM *r_u, prs_struct *ps
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5741,7 +5741,7 @@ BOOL spoolss_io_r_addform(char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5792,7 +5792,7 @@ BOOL spoolss_io_r_setform(char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if(!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5819,7 +5819,7 @@ BOOL spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int de
|
||||
if (!prs_uint32("needed", ps, depth, &r_u->needed))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -5958,7 +5958,7 @@ BOOL spoolss_io_r_replyopenprinter(char *desc, SPOOL_R_REPLYOPENPRINTER *r_u, pr
|
||||
if(!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6011,7 +6011,7 @@ BOOL spoolss_io_r_replycloseprinter(char *desc, SPOOL_R_REPLYCLOSEPRINTER *r_u,
|
||||
if(!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -6096,7 +6096,7 @@ BOOL spoolss_io_r_reply_rrpcn(char *desc, SPOOL_R_REPLY_RRPCN *r_u, prs_struct *
|
||||
if (!prs_uint32("unknown0", ps, depth, &r_u->unknown0))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
if (!prs_werror("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -617,7 +617,7 @@ BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *
|
||||
return False;
|
||||
if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -742,7 +742,7 @@ BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -803,7 +803,7 @@ BOOL srv_io_r_net_share_set_info(char *desc, SRV_R_NET_SHARE_SET_INFO *q_n, prs_
|
||||
|
||||
if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &q_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &q_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -861,7 +861,7 @@ BOOL srv_io_r_net_share_add(char *desc, SRV_R_NET_SHARE_ADD *q_n, prs_struct *ps
|
||||
|
||||
if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &q_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &q_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -908,7 +908,7 @@ BOOL srv_io_r_net_share_del(char *desc, SRV_R_NET_SHARE_DEL *q_n, prs_struct *ps
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &q_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &q_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1311,7 +1311,7 @@ BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps
|
||||
return False;
|
||||
if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1676,7 +1676,7 @@ BOOL srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *p
|
||||
return False;
|
||||
if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -1954,7 +1954,7 @@ BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps
|
||||
return False;
|
||||
if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
|
||||
return False;
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2246,7 +2246,7 @@ void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv,
|
||||
|
||||
srv->ctr = ctr;
|
||||
|
||||
if (status == 0x0) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
srv->ctr->switch_value = switch_value;
|
||||
srv->ctr->ptr_srv_ctr = 1;
|
||||
} else {
|
||||
@ -2326,7 +2326,7 @@ BOOL srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_stru
|
||||
if(!srv_io_info_ctr("ctr", r_n->ctr, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2348,7 +2348,7 @@ BOOL srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n,
|
||||
if(!prs_uint32("switch_value ", ps, depth, &r_n->switch_value))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2467,7 +2467,7 @@ BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *
|
||||
if(!srv_io_time_of_day_info("tod", r_n->tod, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2566,7 +2566,7 @@ BOOL srv_io_r_net_disk_enum(char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps
|
||||
if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2626,7 +2626,7 @@ BOOL srv_io_r_net_name_validate(char *desc, SRV_R_NET_NAME_VALIDATE *r_n, prs_st
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2713,7 +2713,7 @@ BOOL srv_io_r_net_file_query_secdesc(char *desc, SRV_R_NET_FILE_QUERY_SECDESC *r
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -2791,7 +2791,7 @@ BOOL srv_io_r_net_file_set_secdesc(char *desc, SRV_R_NET_FILE_SET_SECDESC *r_n,
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status", ps, depth, &r_n->status))
|
||||
if(!prs_ntstatus("status", ps, depth, &r_n->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -173,7 +173,7 @@ BOOL wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int
|
||||
if(!wks_io_wks_info_100("inf", r_u->wks100, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32("status ", ps, depth, &r_u->status))
|
||||
if(!prs_ntstatus("status ", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -1110,7 +1110,7 @@ static BOOL api_spoolss_addprintprocessor(pipes_struct *p)
|
||||
automatically set the winprint processor for printer
|
||||
entries later. Used to debug the LexMark Optra S 1855 PCL
|
||||
driver --jerry */
|
||||
r_u.status = NT_STATUS_OK;
|
||||
r_u.status = WERR_OK;
|
||||
|
||||
if(!spoolss_io_r_addprintprocessor("", &r_u, rdata, 0)) {
|
||||
DEBUG(0,("spoolss_io_r_addprintprocessor: unable to marshall SPOOL_R_ADDPRINTPROCESSOR.\n"));
|
||||
|
@ -160,7 +160,7 @@ static void free_spool_notify_option(SPOOL_NOTIFY_OPTION **pp)
|
||||
|
||||
static void srv_spoolss_replycloseprinter(POLICY_HND *handle)
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
|
||||
/* weird if the test succeds !!! */
|
||||
if (smb_connections==0) {
|
||||
@ -270,18 +270,18 @@ static BOOL close_printer_handle(pipes_struct *p, POLICY_HND *hnd)
|
||||
/****************************************************************************
|
||||
delete a printer given a handle
|
||||
****************************************************************************/
|
||||
static NTSTATUS delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
|
||||
static WERROR delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
|
||||
{
|
||||
Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);
|
||||
|
||||
if (!Printer) {
|
||||
DEBUG(0,("delete_printer_handle: Invalid handle (%s)\n", OUR_HANDLE(hnd)));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
if (del_a_printer(Printer->dev.handlename) != 0) {
|
||||
DEBUG(3,("Error deleting printer %s\n", Printer->dev.handlename));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
/* Check calling user has permission to delete printer. Note that
|
||||
@ -291,7 +291,7 @@ static NTSTATUS delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
|
||||
|
||||
if (!print_access_check(NULL, -1, PRINTER_ACCESS_ADMINISTER)) {
|
||||
DEBUG(3, ("printer delete denied by security descriptor\n"));
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (*lp_deleteprinter_cmd()) {
|
||||
@ -308,7 +308,7 @@ static NTSTATUS delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
|
||||
DEBUG(10,("Running [%s]\n", command));
|
||||
ret = smbrun(command, NULL);
|
||||
if (ret != 0) {
|
||||
return NT_STATUS_INVALID_HANDLE; /* What to return here? */
|
||||
return WERR_BADFID; /* What to return here? */
|
||||
}
|
||||
DEBUGADD(10,("returned [%d]\n", ret));
|
||||
|
||||
@ -317,12 +317,12 @@ static NTSTATUS delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
|
||||
|
||||
if ( ( i = lp_servicenumber( Printer->dev.handlename ) ) >= 0 ) {
|
||||
lp_killservice( i );
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
} else
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -618,7 +618,7 @@ static BOOL alloc_buffer_size(NEW_BUFFER *buffer, uint32 buffer_size)
|
||||
static void srv_spoolss_receive_message(int msg_type, pid_t src, void *buf, size_t len)
|
||||
{
|
||||
fstring printer;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
struct pipes_struct *p;
|
||||
struct policy *pol;
|
||||
struct handle_list *hl;
|
||||
@ -706,10 +706,10 @@ static BOOL srv_spoolss_sendnotify(pipes_struct *p, POLICY_HND *handle)
|
||||
* called from the spoolss dispatcher
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, SPOOL_R_OPEN_PRINTER_EX *r_u)
|
||||
WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, SPOOL_R_OPEN_PRINTER_EX *r_u)
|
||||
{
|
||||
#if 0
|
||||
uint32 result = NT_STATUS_OK;
|
||||
WERROR result = WERR_OK;
|
||||
#endif
|
||||
|
||||
UNISTR2 *printername = NULL;
|
||||
@ -726,7 +726,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
printername = &q_u->printername;
|
||||
|
||||
if (printername == NULL)
|
||||
return NT_STATUS_OBJECT_NAME_INVALID;
|
||||
return WERR_INVALID_PRINTER_NAME;
|
||||
|
||||
/* some sanity check because you can open a printer or a print server */
|
||||
/* aka: \\server\printer or \\server */
|
||||
@ -735,7 +735,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
DEBUGADD(3,("checking name: %s\n",name));
|
||||
|
||||
if (!open_printer_hnd(p, handle, name))
|
||||
return NT_STATUS_OBJECT_NAME_INVALID;
|
||||
return WERR_INVALID_PRINTER_NAME;
|
||||
|
||||
/*
|
||||
if (printer_default->datatype_ptr != NULL)
|
||||
@ -749,7 +749,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
|
||||
if (!set_printer_hnd_accesstype(p, handle, printer_default->access_required)) {
|
||||
close_printer_handle(p, handle);
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -779,7 +779,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
|
||||
if (handle_is_printserver(p, handle)) {
|
||||
if (printer_default->access_required == 0) {
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
else if ((printer_default->access_required & SERVER_ACCESS_ADMINISTER ) == SERVER_ACCESS_ADMINISTER) {
|
||||
|
||||
@ -788,14 +788,14 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
|
||||
if (!lp_ms_add_printer_wizard()) {
|
||||
close_printer_handle(p, handle);
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
else if (user.uid == 0 || user_in_list(uidtoname(user.uid), lp_printer_admin(snum))) {
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
else {
|
||||
close_printer_handle(p, handle);
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -805,7 +805,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
doesn't have print permission. */
|
||||
|
||||
if (!get_printer_snum(p, handle, &snum))
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
|
||||
/* map an empty access mask to the minimum access mask */
|
||||
if (printer_default->access_required == 0x0)
|
||||
@ -826,7 +826,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
if (!print_access_check(&user, snum, printer_default->access_required)) {
|
||||
DEBUG(3, ("access DENIED for printer open\n"));
|
||||
close_printer_handle(p, handle);
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -905,7 +905,7 @@ NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u
|
||||
#endif
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -1021,27 +1021,27 @@ BOOL convert_devicemode(char *printername, const DEVICEMODE *devmode,
|
||||
* _spoolss_enddocprinter_internal.
|
||||
********************************************************************/
|
||||
|
||||
static NTSTATUS _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handle)
|
||||
static WERROR _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handle)
|
||||
{
|
||||
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
|
||||
|
||||
if (!Printer) {
|
||||
DEBUG(0,("_spoolss_enddocprinter_internal: Invalid handle (%s)\n", OUR_HANDLE(handle)));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
Printer->document_started=False;
|
||||
print_job_end(Printer->jobid,True);
|
||||
/* error codes unhandled so far ... */
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
* api_spoolss_closeprinter
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u)
|
||||
WERROR _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
|
||||
@ -1053,9 +1053,9 @@ NTSTATUS _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL
|
||||
memcpy(&r_u->handle, &q_u->handle, sizeof(r_u->handle));
|
||||
|
||||
if (!close_printer_handle(p, handle))
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -1063,11 +1063,11 @@ NTSTATUS _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL
|
||||
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u)
|
||||
WERROR _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
|
||||
NTSTATUS result;
|
||||
WERROR result;
|
||||
|
||||
if (Printer && Printer->document_started)
|
||||
_spoolss_enddocprinter_internal(p, handle); /* print job was not closed */
|
||||
@ -1076,7 +1076,7 @@ NTSTATUS _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPO
|
||||
|
||||
result = delete_printer_handle(p, handle);
|
||||
|
||||
if (NT_STATUS_IS_OK(result)) {
|
||||
if (W_ERROR_IS_OK(result)) {
|
||||
srv_spoolss_sendnotify(p, handle);
|
||||
}
|
||||
|
||||
@ -1124,7 +1124,7 @@ static int get_version_id (char * arch)
|
||||
* --jerry
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER *q_u,
|
||||
WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER *q_u,
|
||||
SPOOL_R_DELETEPRINTERDRIVER *r_u)
|
||||
{
|
||||
fstring driver;
|
||||
@ -1137,18 +1137,18 @@ NTSTATUS _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIV
|
||||
|
||||
/* check that we have a valid driver name first */
|
||||
if ((version=get_version_id(arch)) == -1) {
|
||||
return NT_STATUS_REVISION_MISMATCH;
|
||||
return WERR_INVALID_ENVIRONMENT;
|
||||
}
|
||||
|
||||
ZERO_STRUCT(info);
|
||||
if (!W_ERROR_IS_OK(get_a_printer_driver(&info, 3, driver, arch, version))) {
|
||||
return NT_STATUS_DRIVER_ORDINAL_NOT_FOUND;
|
||||
return WERR_UNKNOWN_PRINTER_DRIVER;
|
||||
}
|
||||
|
||||
|
||||
if (printer_driver_in_use(arch, driver))
|
||||
{
|
||||
return NT_STATUS_NETWORK_BUSY;
|
||||
return WERR_PRINTER_DRIVER_IN_USE;
|
||||
}
|
||||
|
||||
return delete_printer_driver(info.info_3);
|
||||
@ -1293,7 +1293,7 @@ static BOOL getprinterdata_printer(pipes_struct *p, TALLOC_CTX *ctx, POLICY_HND
|
||||
* spoolss_getprinterdata
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u)
|
||||
WERROR _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
UNISTR2 *valuename = &q_u->valuename;
|
||||
@ -1324,9 +1324,9 @@ NTSTATUS _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, S
|
||||
|
||||
if (!Printer) {
|
||||
if((*data=(uint8 *)malloc(4*sizeof(uint8))) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
return WERR_NOMEM;
|
||||
DEBUG(0,("_spoolss_getprinterdata: Invalid handle (%s).\n", OUR_HANDLE(handle)));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
unistr2_to_ascii(value, valuename, sizeof(value)-1);
|
||||
@ -1341,18 +1341,18 @@ NTSTATUS _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, S
|
||||
/* reply this param doesn't exist */
|
||||
if (*out_size) {
|
||||
if((*data=(uint8 *)talloc_zero(p->mem_ctx, *out_size*sizeof(uint8))) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
return WERR_NOMEM;
|
||||
} else {
|
||||
*data = NULL;
|
||||
}
|
||||
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
return WERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (*needed > *out_size)
|
||||
return STATUS_MORE_ENTRIES;
|
||||
return WERR_STATUS_MORE_ENTRIES;
|
||||
else {
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1361,7 +1361,7 @@ NTSTATUS _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, S
|
||||
****************************************************************************/
|
||||
static BOOL srv_spoolss_replyopenprinter(char *printer, uint32 localprinter, uint32 type, POLICY_HND *handle)
|
||||
{
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
|
||||
/*
|
||||
* If it's the first connection, contact the client
|
||||
@ -1398,7 +1398,7 @@ static BOOL srv_spoolss_replyopenprinter(char *printer, uint32 localprinter, uin
|
||||
* called from api_spoolss_rffpcnex
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u)
|
||||
WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
uint32 flags = q_u->flags;
|
||||
@ -1413,7 +1413,7 @@ NTSTATUS _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPC
|
||||
|
||||
if (!Printer) {
|
||||
DEBUG(0,("_spoolss_rffpcnex: Invalid handle (%s).\n", OUR_HANDLE(handle)));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
Printer->notify.flags=flags;
|
||||
@ -1433,7 +1433,7 @@ NTSTATUS _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPC
|
||||
&Printer->notify.client_hnd))
|
||||
Printer->notify.client_connected=True;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@ -3906,7 +3906,7 @@ WERROR _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u)
|
||||
WERROR _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
|
||||
@ -3914,17 +3914,17 @@ NTSTATUS _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_
|
||||
|
||||
if (Printer) {
|
||||
Printer->page_started=True;
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
DEBUG(3,("Error in startpageprinter printer handle\n"));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u)
|
||||
WERROR _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
|
||||
@ -3932,12 +3932,12 @@ NTSTATUS _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, S
|
||||
|
||||
if (!Printer) {
|
||||
DEBUG(0,("_spoolss_endpageprinter: Invalid handle (%s).\n",OUR_HANDLE(handle)));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
Printer->page_started=False;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -4015,7 +4015,7 @@ WERROR _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, S
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u)
|
||||
WERROR _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
|
||||
@ -4025,7 +4025,7 @@ NTSTATUS _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPO
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u)
|
||||
WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
uint32 buffer_size = q_u->buffer_size;
|
||||
@ -4037,7 +4037,7 @@ NTSTATUS _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL
|
||||
if (!Printer) {
|
||||
DEBUG(0,("_spoolss_writeprinter: Invalid handle (%s)\n",OUR_HANDLE(handle)));
|
||||
r_u->buffer_written = q_u->buffer_size2;
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
(*buffer_written) = print_job_write(Printer->jobid, (char *)buffer, buffer_size);
|
||||
@ -4045,7 +4045,7 @@ NTSTATUS _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL
|
||||
|
||||
r_u->buffer_written = q_u->buffer_size2;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -4608,19 +4608,15 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
|
||||
|
||||
/* Call addprinter hook */
|
||||
|
||||
if (*lp_addprinter_cmd() )
|
||||
if ( !add_printer_hook(printer) ) {
|
||||
if (*lp_addprinter_cmd()) {
|
||||
if (!add_printer_hook(printer)) {
|
||||
result = WERR_ACCESS_DENIED;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update printer info */
|
||||
|
||||
if (add_a_printer(*printer, 2)!=0) {
|
||||
/* I don't really know what to return here !!! */
|
||||
result = WERR_ACCESS_DENIED;
|
||||
goto done;
|
||||
}
|
||||
result = add_a_printer(*printer, 2);
|
||||
|
||||
done:
|
||||
free_a_printer(&printer, 2);
|
||||
@ -4667,7 +4663,7 @@ WERROR _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SET
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
NTSTATUS _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u)
|
||||
WERROR _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u)
|
||||
{
|
||||
POLICY_HND *handle = &q_u->handle;
|
||||
|
||||
@ -4675,7 +4671,7 @@ NTSTATUS _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u)
|
||||
|
||||
if (!Printer) {
|
||||
DEBUG(0,("_spoolss_fcpn: Invalid handle (%s)\n", OUR_HANDLE(handle)));
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
|
||||
if (Printer->notify.client_connected==True)
|
||||
@ -4689,7 +4685,7 @@ NTSTATUS _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u)
|
||||
free_spool_notify_option(&Printer->notify.option);
|
||||
Printer->notify.client_connected=False;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -4840,6 +4836,7 @@ static WERROR enumjobs_level2(print_queue_struct *queue, int snum,
|
||||
NT_PRINTER_INFO_LEVEL *ntprinter = NULL;
|
||||
JOB_INFO_2 *info;
|
||||
int i;
|
||||
WERROR result;
|
||||
|
||||
info=(JOB_INFO_2 *)malloc(*returned*sizeof(JOB_INFO_2));
|
||||
if (info==NULL) {
|
||||
@ -4847,9 +4844,10 @@ static WERROR enumjobs_level2(print_queue_struct *queue, int snum,
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
|
||||
if (get_a_printer(&ntprinter, 2, lp_servicename(snum)) !=0) {
|
||||
result = get_a_printer(&ntprinter, 2, lp_servicename(snum));
|
||||
if (!W_ERROR_IS_OK(result)) {
|
||||
*returned = 0;
|
||||
return WERR_NOMEM;
|
||||
return result;
|
||||
}
|
||||
|
||||
for (i=0; i<*returned; i++)
|
||||
@ -4978,18 +4976,18 @@ WERROR _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u
|
||||
case JOB_CONTROL_CANCEL:
|
||||
case JOB_CONTROL_DELETE:
|
||||
if (print_job_delete(&user, jobid, &errcode)) {
|
||||
errcode = 0;
|
||||
errcode = WERR_OK;
|
||||
}
|
||||
break;
|
||||
case JOB_CONTROL_PAUSE:
|
||||
if (print_job_pause(&user, jobid, &errcode)) {
|
||||
errcode = 0;
|
||||
errcode = WERR_OK;
|
||||
}
|
||||
break;
|
||||
case JOB_CONTROL_RESTART:
|
||||
case JOB_CONTROL_RESUME:
|
||||
if (print_job_resume(&user, jobid, &errcode)) {
|
||||
errcode = 0;
|
||||
errcode = WERR_OK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -5034,10 +5032,12 @@ static WERROR enumprinterdrivers_level1(fstring servername, fstring architecture
|
||||
}
|
||||
|
||||
for (i=0; i<ndrivers; i++) {
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
DEBUGADD(5,("\tdriver: [%s]\n", list[i]));
|
||||
ZERO_STRUCT(driver);
|
||||
if ((status = get_a_printer_driver(&driver, 3, list[i], architecture, version)) != 0) {
|
||||
status = get_a_printer_driver(&driver, 3, list[i],
|
||||
architecture, version);
|
||||
if (!W_ERROR_IS_OK(status)) {
|
||||
safe_free(list);
|
||||
return status;
|
||||
}
|
||||
@ -5111,11 +5111,13 @@ static WERROR enumprinterdrivers_level2(fstring servername, fstring architecture
|
||||
}
|
||||
|
||||
for (i=0; i<ndrivers; i++) {
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
|
||||
DEBUGADD(5,("\tdriver: [%s]\n", list[i]));
|
||||
ZERO_STRUCT(driver);
|
||||
if ((status = get_a_printer_driver(&driver, 3, list[i], architecture, version)) != 0) {
|
||||
status = get_a_printer_driver(&driver, 3, list[i],
|
||||
architecture, version);
|
||||
if (!W_ERROR_IS_OK(status)) {
|
||||
safe_free(list);
|
||||
return status;
|
||||
}
|
||||
@ -5189,11 +5191,13 @@ static WERROR enumprinterdrivers_level3(fstring servername, fstring architecture
|
||||
}
|
||||
|
||||
for (i=0; i<ndrivers; i++) {
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
|
||||
DEBUGADD(5,("\tdriver: [%s]\n", list[i]));
|
||||
ZERO_STRUCT(driver);
|
||||
if ((status = get_a_printer_driver(&driver, 3, list[i], architecture, version)) != 0) {
|
||||
status = get_a_printer_driver(&driver, 3, list[i],
|
||||
architecture, version);
|
||||
if (!W_ERROR_IS_OK(status)) {
|
||||
safe_free(list);
|
||||
return status;
|
||||
}
|
||||
@ -5326,7 +5330,7 @@ WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMF
|
||||
DEBUGADD(5,("Number of user forms [%d]\n", *numofforms));
|
||||
*numofforms += numbuiltinforms;
|
||||
|
||||
if (*numofforms == 0) return ERRnomoreitems;
|
||||
if (*numofforms == 0) return WERR_NO_MORE_ITEMS;
|
||||
|
||||
switch (level) {
|
||||
case 1:
|
||||
@ -5453,7 +5457,7 @@ WERROR _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *
|
||||
|
||||
safe_free(list);
|
||||
if (i == numofforms) {
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
return WERR_BADFID;
|
||||
}
|
||||
}
|
||||
/* check the required size. */
|
||||
@ -5534,7 +5538,8 @@ static WERROR enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *need
|
||||
|
||||
if(numlines) {
|
||||
if((ports=(PORT_INFO_1 *)malloc( numlines * sizeof(PORT_INFO_1) )) == NULL) {
|
||||
DEBUG(10,("Returning WERR_NOMEM [%x]\n", WERR_NOMEM));
|
||||
DEBUG(10,("Returning WERR_NOMEM [%s]\n",
|
||||
werror_str(WERR_NOMEM)));
|
||||
file_lines_free(qlines);
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
@ -5632,7 +5637,6 @@ static WERROR enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *need
|
||||
|
||||
if(numlines) {
|
||||
if((ports=(PORT_INFO_2 *)malloc( numlines * sizeof(PORT_INFO_2) )) == NULL) {
|
||||
DEBUG(10,("Returning WERR_NOMEM [%x]\n", WERR_NOMEM));
|
||||
file_lines_free(qlines);
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
@ -5727,6 +5731,7 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
|
||||
POLICY_HND *handle)
|
||||
{
|
||||
NT_PRINTER_INFO_LEVEL *printer = NULL;
|
||||
WERROR err;
|
||||
fstring name;
|
||||
int snum;
|
||||
|
||||
@ -5777,9 +5782,10 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
|
||||
set_driver_init(printer, 2);
|
||||
|
||||
/* write the ASCII on disk */
|
||||
if (add_a_printer(*printer, 2) != 0) {
|
||||
err = add_a_printer(*printer, 2);
|
||||
if (!W_ERROR_IS_OK(err)) {
|
||||
free_a_printer(&printer,2);
|
||||
return WERR_ACCESS_DENIED;
|
||||
return err;
|
||||
}
|
||||
|
||||
if (!open_printer_hnd(p, handle, name)) {
|
||||
@ -5848,12 +5854,13 @@ WERROR _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u,
|
||||
}
|
||||
|
||||
DEBUG(5,("Cleaning driver's information\n"));
|
||||
if ((err = clean_up_driver_struct(driver, level, &user)) != NT_STATUS_OK )
|
||||
err = clean_up_driver_struct(driver, level, &user);
|
||||
if (!W_ERROR_IS_OK(err))
|
||||
goto done;
|
||||
|
||||
DEBUG(5,("Moving driver to final destination\n"));
|
||||
if(!move_driver_to_download_area(driver, level, &user, &err)) {
|
||||
if (err == 0)
|
||||
if (W_ERROR_IS_OK(err))
|
||||
err = WERR_ACCESS_DENIED;
|
||||
goto done;
|
||||
}
|
||||
@ -5972,6 +5979,7 @@ WERROR _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, S
|
||||
int snum;
|
||||
uint8 *data=NULL;
|
||||
uint32 type;
|
||||
WERROR result;
|
||||
|
||||
ZERO_STRUCT(printer);
|
||||
|
||||
@ -5995,8 +6003,9 @@ WERROR _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, S
|
||||
if (!get_printer_snum(p,handle, &snum))
|
||||
return WERR_BADFID;
|
||||
|
||||
if (get_a_printer(&printer, 2, lp_servicename(snum)) != 0)
|
||||
return WERR_BADFID;
|
||||
result = get_a_printer(&printer, 2, lp_servicename(snum));
|
||||
if (!W_ERROR_IS_OK(result))
|
||||
return result;
|
||||
|
||||
/*
|
||||
* The NT machine wants to know the biggest size of value and data
|
||||
@ -6140,8 +6149,8 @@ WERROR _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP
|
||||
return WERR_BADFID;
|
||||
|
||||
status = get_a_printer(&printer, 2, lp_servicename(snum));
|
||||
if (status != 0x0)
|
||||
return WERR_INVALID_NAME;
|
||||
if (!W_ERROR_IS_OK(status))
|
||||
return status;
|
||||
|
||||
convert_specific_param(¶m, value , type, data, real_len);
|
||||
|
||||
@ -6231,8 +6240,8 @@ WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_
|
||||
}
|
||||
|
||||
status = get_a_printer(&printer, 2, lp_servicename(snum));
|
||||
if (status != 0x0)
|
||||
return WERR_INVALID_NAME;
|
||||
if (!W_ERROR_IS_OK(status))
|
||||
return status;
|
||||
|
||||
ZERO_STRUCTP(¶m);
|
||||
unistr2_to_ascii(param.value, value, sizeof(param.value)-1);
|
||||
@ -6291,7 +6300,7 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE
|
||||
UNISTR2 *form_name = &q_u->name;
|
||||
nt_forms_struct tmpForm;
|
||||
int count=0;
|
||||
WERROR ret = 0;
|
||||
WERROR ret = WERR_OK;
|
||||
nt_forms_struct *list=NULL;
|
||||
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
|
||||
|
||||
@ -6308,7 +6317,7 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE
|
||||
}
|
||||
|
||||
count = get_ntforms(&list);
|
||||
if(!delete_a_form(&list, form_name, &count, &ret))
|
||||
if (!delete_a_form(&list, form_name, &count, &ret))
|
||||
return WERR_INVALID_PARAM;
|
||||
|
||||
safe_free(list);
|
||||
@ -6640,6 +6649,7 @@ static WERROR getjob_level_2(print_queue_struct *queue, int count, int snum, uin
|
||||
BOOL found=False;
|
||||
JOB_INFO_2 *info_2;
|
||||
NT_PRINTER_INFO_LEVEL *ntprinter = NULL;
|
||||
WERROR ret;
|
||||
|
||||
info_2=(JOB_INFO_2 *)malloc(sizeof(JOB_INFO_2));
|
||||
|
||||
@ -6662,9 +6672,10 @@ static WERROR getjob_level_2(print_queue_struct *queue, int count, int snum, uin
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
if (get_a_printer(&ntprinter, 2, lp_servicename(snum)) !=0) {
|
||||
ret = get_a_printer(&ntprinter, 2, lp_servicename(snum));
|
||||
if (!W_ERROR_IS_OK(ret)) {
|
||||
safe_free(queue);
|
||||
return WERR_NOMEM;
|
||||
return ret;
|
||||
}
|
||||
|
||||
fill_job_info_2(info_2, &(queue[i-1]), i, snum, ntprinter);
|
||||
|
@ -26,10 +26,10 @@ extern int DEBUGLEVEL;
|
||||
extern pstring server;
|
||||
|
||||
/* Look up domain related information on a remote host */
|
||||
static uint32 cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char **argv)
|
||||
static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
POLICY_HND pol;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
BOOL got_policy_hnd = False;
|
||||
DOM_SID dom_sid;
|
||||
fstring sid_str, domain_name;
|
||||
@ -38,7 +38,7 @@ static uint32 cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char **
|
||||
|
||||
if (argc > 2) {
|
||||
printf("Usage: %s [info_class]\n", argv[0]);
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
if (!(mem_ctx = talloc_init())) {
|
||||
@ -57,9 +57,10 @@ static uint32 cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char **
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
if ((result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol)) != NT_STATUS_OK) {
|
||||
result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -67,9 +68,9 @@ static uint32 cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char **
|
||||
|
||||
/* Lookup info policy */
|
||||
|
||||
if ((result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, info_class,
|
||||
domain_name, &dom_sid))
|
||||
!= NT_STATUS_OK) {
|
||||
result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, info_class,
|
||||
domain_name, &dom_sid);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -95,10 +96,10 @@ done:
|
||||
|
||||
/* Resolve a list of names to a list of sids */
|
||||
|
||||
static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv)
|
||||
static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
POLICY_HND pol;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
BOOL got_policy_hnd = False;
|
||||
DOM_SID *sids;
|
||||
uint32 *types;
|
||||
@ -107,7 +108,7 @@ static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
if (argc == 1) {
|
||||
printf("Usage: %s [name1 [name2 [...]]]\n", argv[0]);
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
if (!(mem_ctx = talloc_init())) {
|
||||
@ -123,9 +124,10 @@ static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
if ((result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol)) != NT_STATUS_OK) {
|
||||
result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -133,9 +135,9 @@ static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
/* Lookup the names */
|
||||
|
||||
if ((result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1,
|
||||
&argv[1], &sids, &types, &num_names) !=
|
||||
NT_STATUS_OK)) {
|
||||
result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1,
|
||||
&argv[1], &sids, &types, &num_names);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -163,10 +165,10 @@ static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
/* Resolve a list of SIDs to a list of names */
|
||||
|
||||
static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv)
|
||||
static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
POLICY_HND pol;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
BOOL got_policy_hnd = False;
|
||||
DOM_SID *sids;
|
||||
char **names;
|
||||
@ -176,7 +178,7 @@ static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
if (argc == 1) {
|
||||
printf("Usage: %s [sid1 [sid2 [...]]]\n", argv[0]);
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
if (!(mem_ctx = talloc_init())) {
|
||||
@ -191,9 +193,10 @@ static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv)
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
if ((result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol)) != NT_STATUS_OK) {
|
||||
result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -214,9 +217,9 @@ static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
/* Lookup the SIDs */
|
||||
|
||||
if ((result = cli_lsa_lookup_sids(cli, mem_ctx, &pol, argc - 1, sids,
|
||||
&names, &types, &num_names) !=
|
||||
NT_STATUS_OK)) {
|
||||
result = cli_lsa_lookup_sids(cli, mem_ctx, &pol, argc - 1, sids,
|
||||
&names, &types, &num_names);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -255,10 +258,10 @@ static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
/* Enumerate list of trusted domains */
|
||||
|
||||
static uint32 cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **argv)
|
||||
static NTSTATUS cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
POLICY_HND pol;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
BOOL got_policy_hnd = False;
|
||||
DOM_SID *domain_sids;
|
||||
char **domain_names;
|
||||
@ -269,7 +272,7 @@ static uint32 cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **arg
|
||||
|
||||
if (argc != 1) {
|
||||
printf("Usage: %s\n", argv[0]);
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
if (!(mem_ctx = talloc_init())) {
|
||||
@ -284,9 +287,10 @@ static uint32 cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **arg
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
if ((result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol)) != NT_STATUS_OK) {
|
||||
result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -294,10 +298,10 @@ static uint32 cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **arg
|
||||
|
||||
/* Lookup list of trusted domains */
|
||||
|
||||
if ((result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx,
|
||||
&num_domains, &domain_names,
|
||||
&domain_sids)
|
||||
!= NT_STATUS_OK)) {
|
||||
result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx,
|
||||
&num_domains, &domain_names,
|
||||
&domain_sids);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -141,8 +141,8 @@ void display_sam_info_1(SAM_ENTRY1 *e1, SAM_STR1 *s1)
|
||||
static uint32 cmd_samr_query_user(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
POLICY_HND connect_pol, domain_pol, user_pol;
|
||||
uint32 result = NT_STATUS_UNSUCCESSFUL,
|
||||
info_level = 21;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
uint32 info_level = 21;
|
||||
BOOL got_connect_pol = False,
|
||||
got_domain_pol = False,
|
||||
got_user_pol = False;
|
||||
|
@ -192,7 +192,8 @@ static void get_username (char *username)
|
||||
void fetch_domain_sid(struct cli_state *cli)
|
||||
{
|
||||
POLICY_HND pol;
|
||||
uint32 result = 0, info_class = 5;
|
||||
NTSTATUS result = NT_STATUS_OK;
|
||||
uint32 info_class = 5;
|
||||
fstring domain_name;
|
||||
static BOOL got_domain_sid;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
@ -211,15 +212,16 @@ void fetch_domain_sid(struct cli_state *cli)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol) != NT_STATUS_OK)) {
|
||||
result = cli_lsa_open_policy(cli, mem_ctx, True,
|
||||
SEC_RIGHTS_MAXIMUM_ALLOWED,
|
||||
&pol);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, info_class,
|
||||
domain_name, &domain_sid))
|
||||
!= NT_STATUS_OK) {
|
||||
result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, info_class,
|
||||
domain_name, &domain_sid);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -234,7 +236,7 @@ void fetch_domain_sid(struct cli_state *cli)
|
||||
error:
|
||||
fprintf(stderr, "could not obtain sid for domain %s\n", cli->domain);
|
||||
|
||||
if (result != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
fprintf(stderr, "error: %s\n", get_nt_error_msg(result));
|
||||
}
|
||||
|
||||
@ -323,7 +325,7 @@ static uint32 cmd_help(struct cli_state *cli, int argc, char **argv)
|
||||
|
||||
/* Change the debug level */
|
||||
|
||||
static uint32 cmd_debuglevel(struct cli_state *cli, int argc, char **argv)
|
||||
static NTSTATUS cmd_debuglevel(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
if (argc > 2) {
|
||||
printf("Usage: %s [debuglevel]\n", argv[0]);
|
||||
@ -339,7 +341,7 @@ static uint32 cmd_debuglevel(struct cli_state *cli, int argc, char **argv)
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
static uint32 cmd_quit(struct cli_state *cli, int argc, char **argv)
|
||||
static NTSTATUS cmd_quit(struct cli_state *cli, int argc, char **argv)
|
||||
{
|
||||
exit(0);
|
||||
return NT_STATUS_OK; /* NOTREACHED */
|
||||
@ -403,10 +405,10 @@ void add_command_set(struct cmd_set *cmd_set)
|
||||
DLIST_ADD(cmd_list, entry);
|
||||
}
|
||||
|
||||
static uint32 do_cmd(struct cli_state *cli, struct cmd_set *cmd_entry, char *cmd)
|
||||
static NTSTATUS do_cmd(struct cli_state *cli, struct cmd_set *cmd_entry, char *cmd)
|
||||
{
|
||||
char *p = cmd, **argv = NULL;
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
pstring buf;
|
||||
int argc = 0, i;
|
||||
|
||||
@ -430,7 +432,7 @@ static uint32 do_cmd(struct cli_state *cli, struct cmd_set *cmd_entry, char *cmd
|
||||
|
||||
if (!argv) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
p = cmd;
|
||||
@ -461,20 +463,20 @@ static uint32 do_cmd(struct cli_state *cli, struct cmd_set *cmd_entry, char *cmd
|
||||
|
||||
/* Process a command entered at the prompt or as part of -c */
|
||||
|
||||
static uint32 process_cmd(struct cli_state *cli, char *cmd)
|
||||
static NTSTATUS process_cmd(struct cli_state *cli, char *cmd)
|
||||
{
|
||||
struct cmd_list *temp_list;
|
||||
BOOL found = False;
|
||||
pstring buf;
|
||||
char *p = cmd;
|
||||
uint32 result=0;
|
||||
NTSTATUS result = NT_STATUS_OK;
|
||||
int len = 0;
|
||||
|
||||
if (cmd[strlen(cmd) - 1] == '\n')
|
||||
cmd[strlen(cmd) - 1] = '\0';
|
||||
|
||||
if (!next_token(&p, buf, " ", sizeof(buf))) {
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/* strip the trainly \n if it exsists */
|
||||
@ -500,10 +502,10 @@ static uint32 process_cmd(struct cli_state *cli, char *cmd)
|
||||
done:
|
||||
if (!found && buf[0]) {
|
||||
printf("command not found: %s\n", buf);
|
||||
return 0;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
if (result != 0) {
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
printf("result was %s\n", get_nt_error_msg(result));
|
||||
}
|
||||
|
||||
|
@ -68,15 +68,15 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info,
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
}
|
||||
|
||||
if (nt_status != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
nt_status = check_rhosts_security(user_info, server_info);
|
||||
}
|
||||
|
||||
if ((lp_security() == SEC_DOMAIN) && (nt_status != NT_STATUS_OK)) {
|
||||
if ((lp_security() == SEC_DOMAIN) && !NT_STATUS_IS_OK(nt_status)) {
|
||||
nt_status = check_domain_security(user_info, server_info);
|
||||
}
|
||||
|
||||
if ((lp_security() == SEC_SERVER) && (nt_status != NT_STATUS_OK)) {
|
||||
if ((lp_security() == SEC_SERVER) && !NT_STATUS_IS_OK(nt_status)) {
|
||||
nt_status = check_server_security(user_info, server_info);
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info,
|
||||
smb_user_control(user_info->smb_username.str, nt_status);
|
||||
}
|
||||
|
||||
if (nt_status != NT_STATUS_OK) {
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
if ((user_info->plaintext_password.len > 0)
|
||||
&& (!lp_plaintext_to_smbpasswd())) {
|
||||
nt_status = check_unix_security(user_info, server_info);
|
||||
@ -94,14 +94,14 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info,
|
||||
}
|
||||
}
|
||||
|
||||
if ((nt_status == NT_STATUS_OK) && !done_pam) {
|
||||
if (NT_STATUS_IS_OK(nt_status) && !done_pam) {
|
||||
/* We might not be root if we are an RPC call */
|
||||
become_root();
|
||||
nt_status = smb_pam_accountcheck(user_info->smb_username.str);
|
||||
unbecome_root();
|
||||
}
|
||||
|
||||
if (nt_status == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG(5, ("check_password: Password for user %s suceeded\n", user_info->smb_username.str));
|
||||
} else {
|
||||
DEBUG(3, ("check_password: Password for user %s FAILED with error %s\n", user_info->smb_username.str, get_nt_error_msg(nt_status)));
|
||||
@ -233,11 +233,11 @@ BOOL password_ok(char *user, char *password, int pwlen)
|
||||
|
||||
/* The password could be either NTLM or plain LM. Try NTLM first, but fall-through as
|
||||
required. */
|
||||
if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen))) {
|
||||
return True;
|
||||
}
|
||||
|
||||
if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0))) {
|
||||
return True;
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,10 @@ BOOL global_machine_password_needs_changing = False;
|
||||
Check for a valid username and password in security=domain mode.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_domain_security(const auth_usersupplied_info *user_info,
|
||||
auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_domain_security(const auth_usersupplied_info *user_info,
|
||||
auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
char *p, *pserver;
|
||||
unsigned char trust_passwd[16];
|
||||
time_t last_change_time;
|
||||
|
@ -168,10 +168,10 @@ BOOL check_hosts_equiv(char *user)
|
||||
Check for a valid .rhosts/hosts.equiv entry for this user
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_rhosts_security(const auth_usersupplied_info *user_info,
|
||||
NTSTATUS check_rhosts_security(const auth_usersupplied_info *user_info,
|
||||
auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
become_root();
|
||||
if (check_hosts_equiv(user_info->smb_username.str)) {
|
||||
|
@ -113,14 +113,14 @@ struct cli_state *server_cryptkey(void)
|
||||
Validate a password with the password server.
|
||||
****************************************************************************/
|
||||
|
||||
static uint32 server_validate(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
static NTSTATUS server_validate(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
struct cli_state *cli;
|
||||
static unsigned char badpass[24];
|
||||
static fstring baduser;
|
||||
static BOOL tested_password_server = False;
|
||||
static BOOL bad_password_server = False;
|
||||
uint32 nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
cli = server_client();
|
||||
|
||||
@ -232,14 +232,13 @@ use this machine as the password server.\n"));
|
||||
Check for a valid username and password in security=server mode.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_server_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_server_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
|
||||
if(lp_security() != SEC_SERVER)
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
return server_validate(user_info, server_info);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,7 +109,7 @@ static BOOL smb_pwd_check_ntlmv2(const uchar *password, size_t pwd_len,
|
||||
Do a specific test for an smb password being correct, given a smb_password and
|
||||
the lanman and NT responses.
|
||||
****************************************************************************/
|
||||
uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint8 *nt_pw, *lm_pw;
|
||||
uint16 acct_ctrl;
|
||||
@ -202,11 +202,11 @@ SMB hash supplied in the user_info structure
|
||||
return an NT_STATUS constant.
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
SAM_ACCOUNT *sampass=NULL;
|
||||
BOOL ret;
|
||||
uint32 nt_status;
|
||||
NTSTATUS nt_status;
|
||||
|
||||
pdb_init_sam(&sampass);
|
||||
|
||||
@ -220,7 +220,7 @@ uint32 check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_se
|
||||
{
|
||||
DEBUG(1,("Couldn't find user '%s' in passdb file.\n", user_info->smb_username.str));
|
||||
pdb_free_sam(sampass);
|
||||
return(NT_STATUS_NO_SUCH_USER);
|
||||
return NT_STATUS_NO_SUCH_USER;
|
||||
}
|
||||
|
||||
nt_status = smb_password_ok(sampass, user_info, server_info);
|
||||
|
@ -68,9 +68,9 @@ check if a username/password is OK assuming the password
|
||||
in PLAIN TEXT
|
||||
****************************************************************************/
|
||||
|
||||
uint32 check_unix_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
NTSTATUS check_unix_security(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info)
|
||||
{
|
||||
uint32 nt_status;
|
||||
NTSTATUS nt_status;
|
||||
|
||||
become_root();
|
||||
nt_status = (pass_check(user_info->smb_username.str, user_info->plaintext_password.str,
|
||||
|
@ -101,11 +101,11 @@ static int smb_delete_user(char *unix_user)
|
||||
Add and Delete UNIX users on demand, based on NT_STATUS codes.
|
||||
****************************************************************************/
|
||||
|
||||
void smb_user_control(char *unix_user, uint32 nt_status)
|
||||
void smb_user_control(char *unix_user, NTSTATUS nt_status)
|
||||
{
|
||||
struct passwd *pwd=NULL;
|
||||
|
||||
if(nt_status == NT_STATUS_OK) {
|
||||
if (NT_STATUS_IS_OK(nt_status)) {
|
||||
/*
|
||||
* User validated ok against Domain controller.
|
||||
* If the admin wants us to try and create a UNIX
|
||||
@ -127,7 +127,7 @@ void smb_user_control(char *unix_user, uint32 nt_status)
|
||||
smb_create_user(unix_user, pwd->pw_dir);
|
||||
}
|
||||
|
||||
} else if (nt_status == NT_STATUS_NO_SUCH_USER) {
|
||||
} else if (NT_STATUS_V(nt_status) == NT_STATUS_V(NT_STATUS_NO_SUCH_USER)) {
|
||||
/*
|
||||
* User failed to validate ok against Domain controller.
|
||||
* If the failure was "user doesn't exist" and admin
|
||||
|
@ -84,7 +84,7 @@ int unix_error_packet(char *outbuf,int def_class,uint32 def_code,int line)
|
||||
}
|
||||
}
|
||||
|
||||
return error_packet(outbuf,NT_STATUS(0),eclass,ecode,line);
|
||||
return error_packet(outbuf,NT_STATUS_OK,eclass,ecode,line);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2016,6 +2016,7 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid, char *param
|
||||
char *p = skip_string(str2,1);
|
||||
int jobid, errcode;
|
||||
extern struct current_user current_user;
|
||||
WERROR werr = WERR_OK;
|
||||
|
||||
jobid = SVAL(p,0);
|
||||
|
||||
@ -2036,18 +2037,21 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid, char *param
|
||||
|
||||
switch (function) {
|
||||
case 81: /* delete */
|
||||
if (print_job_delete(¤t_user, jobid, &errcode))
|
||||
if (print_job_delete(¤t_user, jobid, &werr))
|
||||
errcode = NERR_Success;
|
||||
break;
|
||||
case 82: /* pause */
|
||||
if (print_job_pause(¤t_user, jobid, &errcode))
|
||||
if (print_job_pause(¤t_user, jobid, &werr))
|
||||
errcode = NERR_Success;
|
||||
break;
|
||||
case 83: /* resume */
|
||||
if (print_job_resume(¤t_user, jobid, &errcode))
|
||||
if (print_job_resume(¤t_user, jobid, &werr))
|
||||
errcode = NERR_Success;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!W_ERROR_IS_OK(werr))
|
||||
errcode = W_ERROR_V(werr);
|
||||
|
||||
out:
|
||||
SSVAL(*rparam,0,errcode);
|
||||
@ -2070,6 +2074,7 @@ static BOOL api_WPrintQueueCtrl(connection_struct *conn,uint16 vuid, char *param
|
||||
char *QueueName = skip_string(str2,1);
|
||||
int errcode = NERR_notsupported;
|
||||
int snum;
|
||||
WERROR werr = WERR_OK;
|
||||
extern struct current_user current_user;
|
||||
|
||||
/* check it's a supported varient */
|
||||
@ -2089,16 +2094,18 @@ static BOOL api_WPrintQueueCtrl(connection_struct *conn,uint16 vuid, char *param
|
||||
|
||||
switch (function) {
|
||||
case 74: /* Pause queue */
|
||||
if (print_queue_pause(¤t_user, snum, &errcode)) errcode = NERR_Success;
|
||||
if (print_queue_pause(¤t_user, snum, &werr)) errcode = NERR_Success;
|
||||
break;
|
||||
case 75: /* Resume queue */
|
||||
if (print_queue_resume(¤t_user, snum, &errcode)) errcode = NERR_Success;
|
||||
if (print_queue_resume(¤t_user, snum, &werr)) errcode = NERR_Success;
|
||||
break;
|
||||
case 103: /* Purge */
|
||||
if (print_queue_purge(¤t_user, snum, &errcode)) errcode = NERR_Success;
|
||||
if (print_queue_purge(¤t_user, snum, &werr)) errcode = NERR_Success;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!W_ERROR_IS_OK(werr)) errcode = W_ERROR_V(werr);
|
||||
|
||||
out:
|
||||
SSVAL(*rparam,0,errcode);
|
||||
SSVAL(*rparam,2,0); /* converter word */
|
||||
|
@ -47,7 +47,7 @@ static struct change_notify *change_notify_list;
|
||||
/****************************************************************************
|
||||
Setup the common parts of the return packet and send it.
|
||||
*****************************************************************************/
|
||||
static void change_notify_reply_packet(char *inbuf, uint32 error_code)
|
||||
static void change_notify_reply_packet(char *inbuf, NTSTATUS error_code)
|
||||
{
|
||||
char outbuf[smb_size+38];
|
||||
|
||||
|
@ -1435,37 +1435,35 @@ static int call_nt_transact_rename(connection_struct *conn,
|
||||
int bufsize,
|
||||
char **ppsetup, char **ppparams, char **ppdata)
|
||||
{
|
||||
char *params = *ppparams;
|
||||
pstring new_name;
|
||||
files_struct *fsp = file_fsp(params, 0);
|
||||
BOOL replace_if_exists = (SVAL(params,2) & RENAME_REPLACE_IF_EXISTS) ? True : False;
|
||||
int outsize = 0;
|
||||
char *params = *ppparams;
|
||||
pstring new_name;
|
||||
files_struct *fsp = file_fsp(params, 0);
|
||||
BOOL replace_if_exists = (SVAL(params,2) & RENAME_REPLACE_IF_EXISTS) ? True : False;
|
||||
NTSTATUS status;
|
||||
|
||||
CHECK_FSP(fsp, conn);
|
||||
srvstr_pull(inbuf, new_name, params+4, sizeof(new_name), -1, STR_TERMINATE);
|
||||
CHECK_FSP(fsp, conn);
|
||||
srvstr_pull(inbuf, new_name, params+4, sizeof(new_name), -1, STR_TERMINATE);
|
||||
|
||||
outsize = rename_internals(conn, inbuf, outbuf, fsp->fsp_name,
|
||||
new_name, replace_if_exists);
|
||||
if(outsize == 0) {
|
||||
/*
|
||||
* Rename was successful.
|
||||
*/
|
||||
send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL, 0);
|
||||
|
||||
DEBUG(3,("nt transact rename from = %s, to = %s succeeded.\n",
|
||||
fsp->fsp_name, new_name));
|
||||
|
||||
outsize = -1;
|
||||
status = rename_internals(conn, fsp->fsp_name,
|
||||
new_name, replace_if_exists);
|
||||
if (!NT_STATUS_IS_OK(status)) return ERROR_NT(status);
|
||||
|
||||
/*
|
||||
* Rename was successful.
|
||||
*/
|
||||
send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL, 0);
|
||||
|
||||
DEBUG(3,("nt transact rename from = %s, to = %s succeeded.\n",
|
||||
fsp->fsp_name, new_name));
|
||||
|
||||
/*
|
||||
* Win2k needs a changenotify request response before it will
|
||||
* update after a rename..
|
||||
*/
|
||||
|
||||
|
||||
process_pending_change_notify_queue((time_t)0);
|
||||
}
|
||||
|
||||
return(outsize);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -499,7 +499,7 @@ static int session_trust_account(connection_struct *conn, char *inbuf, char *out
|
||||
return(ERROR_NT(NT_STATUS_LOGON_FAILURE));
|
||||
}
|
||||
|
||||
if (!smb_password_ok(sam_trust_acct, &user_info, &server_info)) {
|
||||
if (!NT_STATUS_IS_OK(smb_password_ok(sam_trust_acct, &user_info, &server_info))) {
|
||||
DEBUG(0,("session_trust_account: Trust Account %s - password failed\n", user));
|
||||
pdb_free_sam(sam_trust_acct);
|
||||
return(ERROR_NT(NT_STATUS_LOGON_FAILURE));
|
||||
@ -1751,14 +1751,13 @@ static BOOL can_delete(char *fname,connection_struct *conn, int dirtype)
|
||||
code.
|
||||
****************************************************************************/
|
||||
|
||||
int unlink_internals(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
int dirtype, char *name)
|
||||
NTSTATUS unlink_internals(connection_struct *conn, int dirtype, char *name)
|
||||
{
|
||||
pstring directory;
|
||||
pstring mask;
|
||||
char *p;
|
||||
int count=0;
|
||||
int error = ERRnoaccess;
|
||||
NTSTATUS error = NT_STATUS_OK;
|
||||
BOOL has_wild;
|
||||
BOOL exists=False;
|
||||
BOOL bad_path = False;
|
||||
@ -1797,7 +1796,7 @@ int unlink_internals(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
pstrcat(directory,"/");
|
||||
pstrcat(directory,mask);
|
||||
if (!can_delete(directory,conn,dirtype)) {
|
||||
return ERROR_NT(NT_STATUS_SHARING_VIOLATION);
|
||||
return NT_STATUS_SHARING_VIOLATION;
|
||||
}
|
||||
if (vfs_unlink(conn,directory) == 0) {
|
||||
count++;
|
||||
@ -1817,7 +1816,7 @@ int unlink_internals(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
*/
|
||||
|
||||
if (dirptr) {
|
||||
error = ERRbadfile;
|
||||
error = NT_STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
|
||||
if (strequal(mask,"????????.???"))
|
||||
pstrcpy(mask,"*");
|
||||
@ -1828,7 +1827,7 @@ int unlink_internals(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
|
||||
if(!mask_match(fname, mask, case_sensitive)) continue;
|
||||
|
||||
error = ERRnoaccess;
|
||||
error = NT_STATUS_ACCESS_DENIED;
|
||||
slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname);
|
||||
if (!can_delete(fname,conn,dirtype)) continue;
|
||||
if (vfs_unlink(conn,fname) == 0) count++;
|
||||
@ -1838,19 +1837,11 @@ int unlink_internals(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
if (exists)
|
||||
return ERROR_DOS(ERRDOS,error);
|
||||
else {
|
||||
if((errno == ENOENT) && bad_path) {
|
||||
unix_ERR_class = ERRDOS;
|
||||
unix_ERR_code = ERRbadpath;
|
||||
}
|
||||
return(UNIXERROR(ERRDOS,error));
|
||||
}
|
||||
if (count == 0 && NT_STATUS_IS_OK(error)) {
|
||||
error = map_nt_error_from_unix(errno);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -1863,6 +1854,7 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
|
||||
int outsize = 0;
|
||||
pstring name;
|
||||
int dirtype;
|
||||
NTSTATUS status;
|
||||
START_PROFILE(SMBunlink);
|
||||
|
||||
dirtype = SVAL(inbuf,smb_vwv0);
|
||||
@ -1873,16 +1865,16 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
|
||||
|
||||
DEBUG(3,("reply_unlink : %s\n",name));
|
||||
|
||||
outsize = unlink_internals(conn, inbuf, outbuf, dirtype, name);
|
||||
if(outsize == 0) {
|
||||
/*
|
||||
* Win2k needs a changenotify request response before it will
|
||||
* update after a rename..
|
||||
*/
|
||||
process_pending_change_notify_queue((time_t)0);
|
||||
|
||||
outsize = set_message(outbuf,0,0,True);
|
||||
}
|
||||
status = unlink_internals(conn, dirtype, name);
|
||||
if (!NT_STATUS_IS_OK(status)) return ERROR_NT(status);
|
||||
|
||||
/*
|
||||
* Win2k needs a changenotify request response before it will
|
||||
* update after a rename..
|
||||
*/
|
||||
process_pending_change_notify_queue((time_t)0);
|
||||
|
||||
outsize = set_message(outbuf,0,0,True);
|
||||
|
||||
END_PROFILE(SMBunlink);
|
||||
return outsize;
|
||||
@ -3171,28 +3163,22 @@ int reply_printwrite(connection_struct *conn, char *inbuf,char *outbuf, int dum_
|
||||
The guts of the mkdir command, split out so it may be called by the NT SMB
|
||||
code.
|
||||
****************************************************************************/
|
||||
int mkdir_internal(connection_struct *conn, char *inbuf, char *outbuf, pstring directory)
|
||||
NTSTATUS mkdir_internal(connection_struct *conn, pstring directory)
|
||||
{
|
||||
BOOL bad_path = False;
|
||||
SMB_STRUCT_STAT sbuf;
|
||||
int ret= -1;
|
||||
|
||||
unix_convert(directory,conn,0,&bad_path,&sbuf);
|
||||
|
||||
if (check_name(directory, conn))
|
||||
ret = vfs_mkdir(conn,directory,unix_mode(conn,aDIR,directory));
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
if((errno == ENOENT) && bad_path)
|
||||
{
|
||||
unix_ERR_class = ERRDOS;
|
||||
unix_ERR_code = ERRbadpath;
|
||||
}
|
||||
return(UNIXERROR(ERRDOS,ERRnoaccess));
|
||||
}
|
||||
|
||||
return ret;
|
||||
BOOL bad_path = False;
|
||||
SMB_STRUCT_STAT sbuf;
|
||||
int ret= -1;
|
||||
|
||||
unix_convert(directory,conn,0,&bad_path,&sbuf);
|
||||
|
||||
if (check_name(directory, conn))
|
||||
ret = vfs_mkdir(conn,directory,unix_mode(conn,aDIR,directory));
|
||||
|
||||
if (ret == -1) {
|
||||
return map_nt_error_from_unix(errno);
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -3203,13 +3189,15 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
|
||||
{
|
||||
pstring directory;
|
||||
int outsize;
|
||||
NTSTATUS status;
|
||||
START_PROFILE(SMBmkdir);
|
||||
|
||||
srvstr_pull(inbuf, directory, smb_buf(inbuf) + 1, sizeof(directory), -1, STR_TERMINATE);
|
||||
|
||||
outsize=mkdir_internal(conn, inbuf, outbuf, directory);
|
||||
if(outsize == 0)
|
||||
outsize = set_message(outbuf,0,0,True);
|
||||
status = mkdir_internal(conn, directory);
|
||||
if (!NT_STATUS_IS_OK(status)) return ERROR_NT(status);
|
||||
|
||||
outsize = set_message(outbuf,0,0,True);
|
||||
|
||||
DEBUG( 3, ( "mkdir %s ret=%d\n", directory, outsize ) );
|
||||
|
||||
@ -3478,9 +3466,9 @@ static BOOL can_rename(char *fname,connection_struct *conn)
|
||||
The guts of the rename command, split out so it may be called by the NT SMB
|
||||
code.
|
||||
****************************************************************************/
|
||||
int rename_internals(connection_struct *conn,
|
||||
char *inbuf, char *outbuf, char *name,
|
||||
char *newname, BOOL replace_if_exists)
|
||||
NTSTATUS rename_internals(connection_struct *conn,
|
||||
char *name,
|
||||
char *newname, BOOL replace_if_exists)
|
||||
{
|
||||
pstring directory;
|
||||
pstring mask;
|
||||
@ -3490,7 +3478,7 @@ int rename_internals(connection_struct *conn,
|
||||
BOOL bad_path1 = False;
|
||||
BOOL bad_path2 = False;
|
||||
int count=0;
|
||||
int error = ERRnoaccess;
|
||||
NTSTATUS error = NT_STATUS_OK;
|
||||
BOOL exists=False;
|
||||
BOOL rc = True;
|
||||
SMB_STRUCT_STAT sbuf1, sbuf2;
|
||||
@ -3600,13 +3588,13 @@ int rename_internals(connection_struct *conn,
|
||||
|
||||
if(resolve_wildcards(directory,newname) &&
|
||||
can_rename(directory,conn) &&
|
||||
!conn->vfs_ops.rename(conn,directory,newname))
|
||||
conn->vfs_ops.rename(conn,directory,newname) == 0)
|
||||
count++;
|
||||
} else {
|
||||
if (resolve_wildcards(directory,newname) &&
|
||||
can_rename(directory,conn) &&
|
||||
!vfs_file_exist(conn,newname,NULL) &&
|
||||
!conn->vfs_ops.rename(conn,directory,newname))
|
||||
conn->vfs_ops.rename(conn,directory,newname) == 0)
|
||||
count++;
|
||||
}
|
||||
|
||||
@ -3616,7 +3604,7 @@ int rename_internals(connection_struct *conn,
|
||||
if (!count) exists = vfs_file_exist(conn,directory,NULL);
|
||||
if (!count && exists && vfs_file_exist(conn,newname,NULL)) {
|
||||
exists = True;
|
||||
error = ERRrename;
|
||||
error = NT_STATUS_OBJECT_NAME_COLLISION;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@ -3630,7 +3618,7 @@ int rename_internals(connection_struct *conn,
|
||||
dirptr = OpenDir(conn, directory, True);
|
||||
|
||||
if (dirptr) {
|
||||
error = ERRbadfile;
|
||||
error = NT_STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
|
||||
if (strequal(mask,"????????.???"))
|
||||
pstrcpy(mask,"*");
|
||||
@ -3643,7 +3631,7 @@ int rename_internals(connection_struct *conn,
|
||||
if(!mask_match(fname, mask, case_sensitive))
|
||||
continue;
|
||||
|
||||
error = ERRnoaccess;
|
||||
error = NT_STATUS_ACCESS_DENIED;
|
||||
slprintf(fname,sizeof(fname)-1,"%s/%s",directory,dname);
|
||||
if (!can_rename(fname,conn)) {
|
||||
DEBUG(6,("rename %s refused\n", fname));
|
||||
@ -3660,7 +3648,7 @@ int rename_internals(connection_struct *conn,
|
||||
if (!replace_if_exists &&
|
||||
vfs_file_exist(conn,destname, NULL)) {
|
||||
DEBUG(6,("file_exist %s\n", destname));
|
||||
error = 183;
|
||||
error = NT_STATUS_OBJECT_NAME_COLLISION;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3672,59 +3660,52 @@ int rename_internals(connection_struct *conn,
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
if (exists)
|
||||
return ERROR_DOS(ERRDOS,error);
|
||||
else {
|
||||
if((errno == ENOENT) && (bad_path1 || bad_path2)) {
|
||||
unix_ERR_class = ERRDOS;
|
||||
unix_ERR_code = ERRbadpath;
|
||||
}
|
||||
return(UNIXERROR(ERRDOS,error));
|
||||
}
|
||||
if (count == 0 && NT_STATUS_IS_OK(error)) {
|
||||
error = map_nt_error_from_unix(errno);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Reply to a mv.
|
||||
****************************************************************************/
|
||||
|
||||
int reply_mv(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
|
||||
int reply_mv(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
|
||||
int dum_buffsize)
|
||||
{
|
||||
int outsize = 0;
|
||||
pstring name;
|
||||
pstring newname;
|
||||
char *p;
|
||||
int outsize = 0;
|
||||
pstring name;
|
||||
pstring newname;
|
||||
char *p;
|
||||
NTSTATUS status;
|
||||
|
||||
START_PROFILE(SMBmv);
|
||||
START_PROFILE(SMBmv);
|
||||
|
||||
p = smb_buf(inbuf) + 1;
|
||||
p += srvstr_pull(inbuf, name, p, sizeof(name), -1, STR_TERMINATE);
|
||||
p++;
|
||||
p += srvstr_pull(inbuf, newname, p, sizeof(newname), -1, STR_TERMINATE);
|
||||
|
||||
RESOLVE_DFSPATH(name, conn, inbuf, outbuf);
|
||||
RESOLVE_DFSPATH(newname, conn, inbuf, outbuf);
|
||||
|
||||
DEBUG(3,("reply_mv : %s -> %s\n",name,newname));
|
||||
|
||||
outsize = rename_internals(conn, inbuf, outbuf, name, newname, False);
|
||||
if(outsize == 0) {
|
||||
p = smb_buf(inbuf) + 1;
|
||||
p += srvstr_pull(inbuf, name, p, sizeof(name), -1, STR_TERMINATE);
|
||||
p++;
|
||||
p += srvstr_pull(inbuf, newname, p, sizeof(newname), -1, STR_TERMINATE);
|
||||
|
||||
RESOLVE_DFSPATH(name, conn, inbuf, outbuf);
|
||||
RESOLVE_DFSPATH(newname, conn, inbuf, outbuf);
|
||||
|
||||
DEBUG(3,("reply_mv : %s -> %s\n",name,newname));
|
||||
|
||||
status = rename_internals(conn, name, newname, False);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return ERROR_NT(status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Win2k needs a changenotify request response before it will
|
||||
* update after a rename..
|
||||
*/
|
||||
|
||||
process_pending_change_notify_queue((time_t)0);
|
||||
|
||||
outsize = set_message(outbuf,0,0,True);
|
||||
}
|
||||
* Win2k needs a changenotify request response before it will
|
||||
* update after a rename..
|
||||
*/
|
||||
process_pending_change_notify_queue((time_t)0);
|
||||
outsize = set_message(outbuf,0,0,True);
|
||||
|
||||
END_PROFILE(SMBmv);
|
||||
return(outsize);
|
||||
END_PROFILE(SMBmv);
|
||||
return(outsize);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
|
@ -162,13 +162,13 @@ Join a domain using the administrator username and password
|
||||
/* Macro for checking RPC error codes to make things more readable */
|
||||
|
||||
#define CHECK_RPC_ERR(rpc, msg) \
|
||||
if ((result = rpc) != NT_STATUS_OK) { \
|
||||
if (!NT_STATUS_IS_OK(result = rpc)) { \
|
||||
DEBUG(0, (msg ": %s\n", get_nt_error_msg(result))); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define CHECK_RPC_ERR_DEBUG(rpc, debug_args) \
|
||||
if ((result = rpc) != NT_STATUS_OK) { \
|
||||
if (!NT_STATUS_IS_OK(result = rpc)) { \
|
||||
DEBUG(0, debug_args); \
|
||||
goto done; \
|
||||
}
|
||||
@ -203,7 +203,7 @@ static int join_domain_byuser(char *domain, char *remote_machine,
|
||||
|
||||
/* Misc */
|
||||
|
||||
uint32 result;
|
||||
NTSTATUS result;
|
||||
int retval = 1;
|
||||
|
||||
/* Connect to remote machine */
|
||||
@ -301,7 +301,7 @@ static int join_domain_byuser(char *domain, char *remote_machine,
|
||||
result = NT_STATUS_USER_EXISTS;
|
||||
}
|
||||
|
||||
if (result == NT_STATUS_USER_EXISTS) {
|
||||
if (NT_STATUS_V(result) == NT_STATUS_V(NT_STATUS_USER_EXISTS)) {
|
||||
uint32 num_rids, *name_types, *user_rids;
|
||||
uint32 flags = 0x3e8;
|
||||
char *names;
|
||||
@ -334,7 +334,7 @@ static int join_domain_byuser(char *domain, char *remote_machine,
|
||||
("could not re-open existing user %s: %s\n",
|
||||
acct_name, get_nt_error_msg(result)));
|
||||
|
||||
} else if (result != NT_STATUS_OK) {
|
||||
} else if (!NT_STATUS_IS_OK(result)) {
|
||||
DEBUG(0, ("error creating domain user: %s\n",
|
||||
get_nt_error_msg(result)));
|
||||
goto done;
|
||||
|
Loading…
x
Reference in New Issue
Block a user