s3-build: only include "fake_file.h" where needed.
[metze/samba/wip.git] / source3 / libsmb / cliquota.c
index e40dac368d9ae6b5e686dcecdf202b4970ede921..59c06ace7939ba219c958e8505889c39433692c6 100644 (file)
 */
 
 #include "includes.h"
+#include "../librpc/gen_ndr/ndr_security.h"
+#include "fake_file.h"
 
-bool cli_get_quota_handle(struct cli_state *cli, int *quota_fnum)
+NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum)
 {
-       *quota_fnum = cli_nt_create_full(cli, FAKE_FILE_NAME_QUOTA_WIN32,
+       return cli_ntcreate(cli, FAKE_FILE_NAME_QUOTA_WIN32,
                 0x00000016, DESIRED_ACCESS_PIPE,
                 0x00000000, FILE_SHARE_READ|FILE_SHARE_WRITE,
-                FILE_OPEN, 0x00000000, 0x03);
-
-       if (*quota_fnum == (-1)) {
-               return False;
-       }
-
-       return True;
+                FILE_OPEN, 0x00000000, 0x03, quota_fnum);
 }
 
 void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list)
@@ -150,7 +146,7 @@ bool cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC
        SIVAL(params, 8,0x00000000);
        SIVAL(params,12,0x00000024);
 
-       sid_len = ndr_size_dom_sid(&pqt->sid, NULL, 0);
+       sid_len = ndr_size_dom_sid(&pqt->sid, 0);
        data_len = sid_len+8;
        SIVAL(data, 0, 0x00000000);
        SIVAL(data, 4, sid_len);
@@ -213,7 +209,7 @@ bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC
 
        SSVAL(params,0,quota_fnum);
 
-       sid_len = ndr_size_dom_sid(&pqt->sid, NULL, 0);
+       sid_len = ndr_size_dom_sid(&pqt->sid, 0);
        SIVAL(data,0,0);
        SIVAL(data,4,sid_len);
        SBIG_UINT(data, 8,(uint64_t)0);
@@ -574,7 +570,7 @@ static const char *quota_str_static(uint64_t val, bool special, bool _numeric)
        return result;
 }
 
-void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric))
+void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric))
 {
        TALLOC_CTX *frame = talloc_stackframe();
 
@@ -627,7 +623,7 @@ void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_
        return;
 }
 
-void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric))
+void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric))
 {
        SMB_NTQUOTA_LIST *cur;