1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r18188: merge 3.0-libndr branch

(This used to be commit 1115745cae)
This commit is contained in:
Jelmer Vernooij 2006-09-06 18:32:20 +00:00 committed by Gerald (Jerry) Carter
parent a7be2ec7c5
commit 995205fc60
41 changed files with 1809 additions and 1426 deletions

View File

@ -212,6 +212,8 @@ SOCKET_WRAPPER_OBJ = lib/socket_wrapper.o
LIBNDR_OBJ = libndr/ndr_basic.o libndr/ndr.o libndr/ndr_misc.o \
libndr/ndr_sec_helper.o libndr/ndr_string.o libndr/sid.o
LIBNDR_GEN_OBJ = libndr/ndr_unixinfo.o
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
TALLOC_OBJ = lib/talloc.o
@ -292,7 +294,9 @@ LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o \
rpc_client/cli_ds.o rpc_client/cli_echo.o \
rpc_client/cli_shutdown.o rpc_client/cli_svcctl.o \
rpc_client/cli_unixinfo.o
rpc_client/ndr.o
LIBMSRPC_GEN_OBJ = rpc_client/cli_unixinfo.o $(LIBNDR_GEN_OBJ) $(LIBNDR_OBJ)
REGOBJS_OBJ = registry/reg_objects.o
@ -307,7 +311,7 @@ RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
rpc_server/srv_samr_util.o
RPC_UNIXINFO_OBJ = rpc_server/srv_unixinfo.o rpc_server/srv_unixinfo_nt.o
RPC_UNIXINFO_OBJ = rpc_server/srv_unixinfo.o rpc_server/srv_unixinfo_nt.o rpc_parse/parse_unixinfo.o
REGFIO_OBJ = registry/regfio.o
RPC_REG_OBJ = rpc_server/srv_reg.o rpc_server/srv_reg_nt.o $(REGFIO_OBJ)
@ -348,7 +352,7 @@ RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \
rpc_parse/parse_wks.o rpc_parse/parse_ds.o \
rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o \
rpc_parse/parse_echo.o rpc_parse/parse_shutdown.o \
rpc_parse/parse_svcctl.o rpc_parse/parse_unixinfo.o \
rpc_parse/parse_svcctl.o \
rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o \
rpc_parse/parse_ntsvcs.o $(REGOBJS_OBJ)
@ -454,7 +458,7 @@ SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
$(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \
$(LIB_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) \
$(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
$(LIBMSRPC_OBJ) \
$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \
$(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
$(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
$(BUILDOPT_OBJ) $(SMBLDAP_OBJ)
@ -490,7 +494,7 @@ SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(LIBSMB_OBJ) \
$(LOCKING_OBJ) $(PASSDB_OBJ) $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \
$(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
$(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_OBJ) \
$(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
$(PASSCHANGE_OBJ)
STATUS_OBJ = utils/status.o utils/status_profile.o \
@ -519,7 +523,7 @@ TESTPARM_OBJ = utils/testparm.o \
SMBPASSWD_OBJ = utils/smbpasswd.o utils/passwd_util.o $(PASSCHANGE_OBJ) \
$(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \
$(GROUPDB_OBJ) $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \
$(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_OBJ)
$(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ)
PDBEDIT_OBJ = utils/pdbedit.o utils/passwd_util.o $(PARAM_OBJ) $(PASSDB_OBJ) \
$(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) \
@ -538,7 +542,7 @@ RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \
RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
$(PARAM_OBJ) $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \
$(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_OBJ) \
$(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
$(READLINE_OBJ) $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) \
$(LIBADS_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
$(SMBLDAP_OBJ) $(DCUTIL_OBJ)
@ -550,7 +554,7 @@ LIBSMBCLIENT_OBJ = libsmb/libsmbclient.o libsmb/libsmb_compat.o \
libsmb/libsmb_cache.o \
$(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
$(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
$(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
$(SECRETS_OBJ) $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ)
CAC_OBJ = $(LIBSMBCLIENT_OBJ) \
@ -567,7 +571,7 @@ LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDB_BASE_OBJ)
LIBBIGBALLOFMUD_MAJOR = 0
LIBBIGBALLOFMUD_OBJ = $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) \
$(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \
$(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \
$(GROUPDB_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ)
LIBBIGBALLOFMUD_PICOBJS = $(LIBBIGBALLOFMUD_OBJ:.o=.@PICSUFFIX@)
@ -596,8 +600,8 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
NET_OBJ = $(NET_OBJ1) $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
$(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
$(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(LIBADDNS_OBJ0)\
$(LIBMSRPC_OBJ) $(IDMAP_OBJ) \
$(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(LIBADDNS_OBJ0) \
$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(IDMAP_OBJ) \
$(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \
$(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
$(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
@ -654,13 +658,13 @@ LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
$(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
$(PASSDB_OBJ) $(GROUPDB_OBJ) $(LIBMSRPC_OBJ) $(SECRETS_OBJ) \
$(PASSDB_OBJ) $(GROUPDB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(SECRETS_OBJ) \
$(POPT_LIB_OBJ) $(DCUTIL_OBJ) $(LIBADS_OBJ) $(SMBLDAP_OBJ)
SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
$(PARAM_OBJ) \
$(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
$(LIBMSRPC_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
$(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ)
EVTLOGADM_OBJ0 = utils/eventlogadm.o
@ -694,7 +698,7 @@ DEBUG2HTML_OBJ = utils/debug2html.o utils/debugparse.o
SMBFILTER_OBJ = utils/smbfilter.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(SECRETS_OBJ) \
$(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ)
PROTO_OBJ = $(SMBD_OBJ_MAIN) \
PROTO_OBJ = $(SMBD_OBJ_MAIN) $(LIBNDR_OBJ) \
$(SMBD_OBJ_SRV) $(NMBD_OBJ1) $(SWAT_OBJ1) $(LIB_OBJ) $(LIBSMB_OBJ) \
$(SMBTORTURE_OBJ1) $(RPCCLIENT_OBJ1) \
$(LIBMSRPC_OBJ) @SMBWRAP_OBJS@ \
@ -747,7 +751,7 @@ WINBINDD_OBJ1 = \
WINBINDD_OBJ = \
$(WINBINDD_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
$(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
$(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
$(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
$(PROFILE_OBJ) $(SLCACHE_OBJ) $(SMBLDAP_OBJ) \
$(SECRETS_OBJ) $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \
$(DCUTIL_OBJ) $(IDMAP_OBJ) \
@ -1576,7 +1580,7 @@ installpammodules: $(PAM_MODULES)
# Python extensions
PYTHON_OBJS = $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBSMB_OBJ) $(RPC_PARSE_OBJ) \
$(LIBMSRPC_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
$(SECRETS_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ)
PYTHON_PICOBJS = $(PYTHON_OBJS:.o=.@PICSUFFIX@)

4
source3/TODO Normal file
View File

@ -0,0 +1,4 @@
- Properly map Samba4's dom_sid to Samba3's DOM_SID
- Allow building IDL files from within the Samba3 tree
- Autogenerate correct headers so generated files don't have to
be edited for Samba3

View File

@ -661,8 +661,8 @@ typedef struct account_lockout_string {
uint32 offset;
uint32 length;
/* uint16 *bindata; */
UINT64_S lockout_duration;
UINT64_S reset_count;
uint64 lockout_duration;
uint64 reset_count;
uint32 bad_attempt_lockout;
uint32 dummy;
} LOCKOUT_STRING;
@ -679,12 +679,12 @@ typedef struct sam_domain_info_info {
UNIHDR hdr_dom_name;
UNIHDR hdr_oem_info;
UINT64_S force_logoff;
uint64 force_logoff;
uint16 min_pwd_len;
uint16 pwd_history_len;
UINT64_S max_pwd_age;
UINT64_S min_pwd_age;
UINT64_S dom_mod_count;
uint64 max_pwd_age;
uint64 min_pwd_age;
uint64 dom_mod_count;
NTTIME creation_time;
uint32 security_information;
@ -848,7 +848,7 @@ typedef struct sam_alias_mem_info_info {
/* SAM_DELTA_POLICY (0x0D) */
typedef struct {
uint32 max_log_size; /* 0x5000 */
UINT64_S audit_retention_period; /* 0 */
uint64 audit_retention_period; /* 0 */
uint32 auditing_mode; /* 0 */
uint32 num_events;
uint32 ptr_events;
@ -860,7 +860,7 @@ typedef struct {
uint32 min_workset_size; /* 0x00010000 */
uint32 max_workset_size; /* 0x0f000000 */
uint32 page_file_limit; /* 0 */
UINT64_S time_limit; /* 0 */
uint64 time_limit; /* 0 */
NTTIME modify_time; /* 0x3c*/
NTTIME create_time; /* a7080110 */
BUFHDR2 hdr_sec_desc;
@ -907,7 +907,7 @@ typedef struct {
uint32 min_workset_size; /* 0x00010000 */
uint32 max_workset_size; /* 0x0f000000 */
uint32 page_file_limit; /* 0 */
UINT64_S time_limit; /* 0 */
uint64 time_limit; /* 0 */
uint32 system_flags; /* 1 */
BUFHDR2 hdr_sec_desc;
@ -961,7 +961,7 @@ typedef struct {
typedef struct {
uint32 seqnum;
uint32 dom_mod_count_ptr;
UINT64_S dom_mod_count; /* domain mod count at last sync */
uint64 dom_mod_count; /* domain mod count at last sync */
} SAM_DELTA_MOD_COUNT;
typedef union sam_delta_ctr_info {
@ -1003,7 +1003,7 @@ typedef struct net_q_sam_deltas_info {
DOM_CRED ret_creds;
uint32 database_id;
UINT64_S dom_mod_count; /* domain mod count at last sync */
uint64 dom_mod_count; /* domain mod count at last sync */
uint32 max_size; /* preferred maximum length */
} NET_Q_SAM_DELTAS;
@ -1012,7 +1012,7 @@ typedef struct net_q_sam_deltas_info {
typedef struct net_r_sam_deltas_info {
DOM_CRED srv_creds;
UINT64_S dom_mod_count; /* new domain mod count */
uint64 dom_mod_count; /* new domain mod count */
uint32 ptr_deltas;
uint32 num_deltas;

View File

@ -59,8 +59,8 @@ typedef struct perf_object_type
uint32 DefaultCounter;
uint32 NumInstances;
uint32 CodePage;
UINT64_S PerfTime;
UINT64_S PerfFreq;
uint64 PerfTime;
uint64 PerfFreq;
PERF_COUNTER_DEFINITION *counters;
PERF_INSTANCE_DEFINITION *instances;
PERF_COUNTER_BLOCK counter_data;
@ -88,13 +88,13 @@ typedef struct perf_data_block
PerfTime, and having it there will make my offset math much easier. */
uint32 Padding;
/* Now when I'm marshalling this, I'll need to call prs_align_uint64()
before I start encodint the UINT64_S structs */
before I start encodint the uint64 structs */
/* clock rate * seconds uptime */
UINT64_S PerfTime;
uint64 PerfTime;
/* The clock rate of the CPU */
UINT64_S PerfFreq;
uint64 PerfFreq;
/* used for high-res timers -- for now PerfTime * 10e7 */
UINT64_S PerfTime100nSec;
uint64 PerfTime100nSec;
uint32 SystemNameLength;
uint32 SystemNameOffset;
/* The SystemName, in unicode, terminated */

View File

@ -553,7 +553,7 @@ typedef struct sam_unknown_info_2_inf
pointer is referring to
*/
UINT64_S seq_num;
uint64 seq_num;
uint32 unknown_4; /* 0x0000 0001 */
uint32 server_role;
@ -605,7 +605,7 @@ typedef struct sam_unknown_info_7_info
typedef struct sam_unknown_info_8_info
{
UINT64_S seq_num;
uint64 seq_num;
NTTIME domain_create_time;
} SAM_UNK_INFO_8;
@ -626,7 +626,7 @@ typedef struct sam_unknown_info_12_inf
typedef struct sam_unknown_info_13_info
{
UINT64_S seq_num;
uint64 seq_num;
NTTIME domain_create_time;
uint32 unknown1;
uint32 unknown2;

View File

@ -1556,7 +1556,7 @@ typedef struct {
uint32 previousnames_len;
uint32 previousnames_ptr;
NTTIME driverdate;
UINT64_S driverversion;
uint64 driverversion;
uint32 dummy4;
uint32 mfgname_ptr;
uint32 oemurl_ptr;

View File

@ -34,12 +34,12 @@ typedef struct unixinfo_q_sid_to_uid {
} UNIXINFO_Q_SID_TO_UID;
typedef struct unixinfo_r_sid_to_uid {
UINT64_S uid;
uint64 uid;
NTSTATUS status;
} UNIXINFO_R_SID_TO_UID;
typedef struct unixinfo_q_uid_to_sid {
UINT64_S uid;
uint64 uid;
} UNIXINFO_Q_UID_TO_SID;
typedef struct unixinfo_r_uid_to_sid {
@ -53,12 +53,12 @@ typedef struct unixinfo_q_sid_to_gid {
} UNIXINFO_Q_SID_TO_GID;
typedef struct unixinfo_r_sid_to_gid {
UINT64_S gid;
uint64 gid;
NTSTATUS status;
} UNIXINFO_R_SID_TO_GID;
typedef struct unixinfo_q_gid_to_sid {
UINT64_S gid;
uint64 gid;
} UNIXINFO_Q_GID_TO_SID;
typedef struct unixinfo_r_gid_to_sid {
@ -69,7 +69,7 @@ typedef struct unixinfo_r_gid_to_sid {
typedef struct unixinfo_q_getpwuid {
uint32 count;
UINT64_S *uid;
uint64 *uid;
} UNIXINFO_Q_GETPWUID;
struct unixinfo_getpwuid {
@ -123,12 +123,12 @@ typedef struct unixinfo_q_sid_to_uid {
} UNIXINFO_Q_SID_TO_UID;
typedef struct unixinfo_r_sid_to_uid {
UINT64_S uid;
uint64 uid;
NTSTATUS status;
} UNIXINFO_R_SID_TO_UID;
typedef struct unixinfo_q_uid_to_sid {
UINT64_S uid;
uint64 uid;
} UNIXINFO_Q_UID_TO_SID;
typedef struct unixinfo_r_uid_to_sid {
@ -142,12 +142,12 @@ typedef struct unixinfo_q_sid_to_gid {
} UNIXINFO_Q_SID_TO_GID;
typedef struct unixinfo_r_sid_to_gid {
UINT64_S gid;
uint64 gid;
NTSTATUS status;
} UNIXINFO_R_SID_TO_GID;
typedef struct unixinfo_q_gid_to_sid {
UINT64_S gid;
uint64 gid;
} UNIXINFO_Q_GID_TO_SID;
typedef struct unixinfo_r_gid_to_sid {
@ -157,7 +157,7 @@ typedef struct unixinfo_r_gid_to_sid {
} UNIXINFO_R_GID_TO_SID;
typedef struct unixinfo_q_getpwuid {
UINT64_S uid;
uint64 uid;
} UNIXINFO_Q_GETPWUID;
typedef struct unixinfo_r_getpwuid {

View File

@ -213,14 +213,8 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN];
#define PI_NTSVCS 14
#define PI_MAX_PIPES 15
typedef struct uint64_s
{
uint32 low;
uint32 high;
} UINT64_S;
/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
typedef UINT64_S NTTIME;
typedef uint64_t NTTIME;
/* Allowable account control bits */
@ -280,7 +274,7 @@ enum SID_NAME_USE {
*
* @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp
**/
typedef struct sid_info {
typedef struct dom_sid {
uint8 sid_rev_num; /**< SID revision number */
uint8 num_auths; /**< Number of sub-authorities */
uint8 id_auth[6]; /**< Identifier Authority */
@ -293,6 +287,9 @@ typedef struct sid_info {
uint32 sub_auths[MAXSUBAUTHS];
} DOM_SID;
#include "libndr/misc.h"
#include "libndr/security.h"
struct lsa_dom_info {
BOOL valid;
DOM_SID sid;

File diff suppressed because it is too large Load Diff

View File

@ -878,9 +878,9 @@ static void dump_pac_logon_info(PAC_LOGON_INFO *logon_info) {
DEBUG(2,("decode_pac_data: Logon time mismatch between ticket and PAC!\n"));
DEBUGADD(2, ("decode_pac_data: PAC: %s\n",
http_timestring(nt_time_to_unix(&logon_name->logon_time))));
http_timestring(nt_time_to_unix(logon_name->logon_time))));
DEBUGADD(2, ("decode_pac_data: Ticket: %s\n",
http_timestring(nt_time_to_unix(&tgs_authtime_nttime))));
http_timestring(nt_time_to_unix(tgs_authtime_nttime))));
nt_status = NT_STATUS_ACCESS_DENIED;
goto out;

View File

@ -239,19 +239,19 @@ void cac_InitCacTime(CacTime *cactime, NTTIME nttime) {
ZERO_STRUCTP(cactime);
/*this code is taken from display_time() found in rpcclient/cmd_samr.c*/
if (nttime.high==0 && nttime.low==0)
if (nttime==0)
return;
if (nttime.high==0x80000000 && nttime.low==0)
if (nttime==0x80000000000000LL)
return;
high = 65536;
high = high/10000;
high = high*65536;
high = high/1000;
high = high * (~nttime.high);
high = high * (~(nttime >> 32));
low = ~nttime.low;
low = ~(nttime & 0xFFFFFFFF);
low = low/(1000*1000*10);
sec=high+low;

View File

@ -448,12 +448,12 @@ CacUserInfo *cac_MakeUserInfo(TALLOC_CTX *mem_ctx, SAM_USERINFO_CTR *ctr) {
ZERO_STRUCTP(info);
info->logon_time = nt_time_to_unix(&id21->logon_time);
info->logoff_time = nt_time_to_unix(&id21->logoff_time);
info->kickoff_time = nt_time_to_unix(&id21->kickoff_time);
info->pass_last_set_time = nt_time_to_unix(&id21->pass_last_set_time);
info->pass_can_change_time = nt_time_to_unix(&id21->pass_can_change_time);
info->pass_must_change_time = nt_time_to_unix(&id21->pass_must_change_time);
info->logon_time = nt_time_to_unix(id21->logon_time);
info->logoff_time = nt_time_to_unix(id21->logoff_time);
info->kickoff_time = nt_time_to_unix(id21->kickoff_time);
info->pass_last_set_time = nt_time_to_unix(id21->pass_last_set_time);
info->pass_can_change_time = nt_time_to_unix(id21->pass_can_change_time);
info->pass_must_change_time = nt_time_to_unix(id21->pass_must_change_time);
info->username = talloc_unistr2_to_ascii(mem_ctx, id21->uni_user_name);
if(!info->username)

View File

@ -22,15 +22,6 @@
#include "includes.h"
/* Evil hack to convert Samba3 NTTIME's to Samba4 NTTIME's */
union NTTIME_big {
NTTIME s3;
uint64_t s4;
};
#define NDR_SVAL(ndr, ofs) (NDR_BE(ndr)?RSVAL(ndr->data,ofs):SVAL(ndr->data,ofs))
#define NDR_IVAL(ndr, ofs) (NDR_BE(ndr)?RIVAL(ndr->data,ofs):IVAL(ndr->data,ofs))
#define NDR_IVALS(ndr, ofs) (NDR_BE(ndr)?RIVALS(ndr->data,ofs):IVALS(ndr->data,ofs))
@ -514,8 +505,7 @@ NTSTATUS ndr_push_ref_ptr(struct ndr_push *ndr, const void *p)
*/
NTSTATUS ndr_push_NTTIME(struct ndr_push *ndr, int ndr_flags, NTTIME t)
{
union NTTIME_big b; b.s3 = t;
NDR_CHECK(ndr_push_udlong(ndr, ndr_flags, b.s4));
NDR_CHECK(ndr_push_udlong(ndr, ndr_flags, t));
return NT_STATUS_OK;
}
@ -524,10 +514,7 @@ NTSTATUS ndr_push_NTTIME(struct ndr_push *ndr, int ndr_flags, NTTIME t)
*/
NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
{
union NTTIME_big b;
NDR_CHECK(ndr_pull_udlong(ndr, ndr_flags, &b.s4));
*t = b.s3;
NDR_CHECK(ndr_pull_udlong(ndr, ndr_flags, t));
return NT_STATUS_OK;
}
@ -536,10 +523,8 @@ NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
*/
NTSTATUS ndr_push_NTTIME_1sec(struct ndr_push *ndr, int ndr_flags, NTTIME t)
{
union NTTIME_big b; b.s3 = t;
b.s4 /= 10000000;
NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, b.s4));
t /= 10000000;
NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, t));
return NT_STATUS_OK;
}
@ -548,10 +533,8 @@ NTSTATUS ndr_push_NTTIME_1sec(struct ndr_push *ndr, int ndr_flags, NTTIME t)
*/
NTSTATUS ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
{
union NTTIME_big b;
NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, &b.s4));
b.s4 *= 10000000;
*t = b.s3;
NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, t));
(*t) *= 10000000;
return NT_STATUS_OK;
}
@ -560,9 +543,7 @@ NTSTATUS ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
*/
NTSTATUS ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
{
union NTTIME_big b;
NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, &b.s4));
*t = b.s3;
NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, t));
return NT_STATUS_OK;
}
@ -571,8 +552,7 @@ NTSTATUS ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
*/
NTSTATUS ndr_push_NTTIME_hyper(struct ndr_push *ndr, int ndr_flags, NTTIME t)
{
union NTTIME_big b; b.s3 = t;
NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, b.s4));
NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, t));
return NT_STATUS_OK;
}

View File

@ -0,0 +1,504 @@
/* parser auto-generated by pidl */
#include "includes.h"
#include "libndr/ndr_unixinfo.h"
static NTSTATUS ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->homedir));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->shell));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->homedir) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
}
if (r->shell) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
}
}
return NT_STATUS_OK;
}
static NTSTATUS ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r)
{
uint32_t _ptr_homedir;
TALLOC_CTX *_mem_save_homedir_0;
uint32_t _ptr_shell;
TALLOC_CTX *_mem_save_shell_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir));
if (_ptr_homedir) {
NDR_PULL_ALLOC_SIZE(ndr, r->homedir, 1);
} else {
r->homedir = NULL;
}
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell));
if (_ptr_shell) {
NDR_PULL_ALLOC_SIZE(ndr, r->shell, 1);
} else {
r->shell = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
if (r->homedir) {
_mem_save_homedir_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->homedir, 0);
NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
if (ndr_get_array_length(ndr, &r->homedir) > ndr_get_array_size(ndr, &r->homedir)) {
return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->homedir), ndr_get_array_length(ndr, &r->homedir));
}
NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t)));
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t), CH_UTF8));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_homedir_0, 0);
}
if (r->shell) {
_mem_save_shell_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->shell, 0);
NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
if (ndr_get_array_length(ndr, &r->shell) > ndr_get_array_size(ndr, &r->shell)) {
return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->shell), ndr_get_array_length(ndr, &r->shell));
}
NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t)));
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t), CH_UTF8));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_shell_0, 0);
}
}
return NT_STATUS_OK;
}
void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r)
{
ndr_print_struct(ndr, name, "unixinfo_GetPWUidInfo");
ndr->depth++;
ndr_print_NTSTATUS(ndr, "status", r->status);
ndr_print_ptr(ndr, "homedir", r->homedir);
ndr->depth++;
if (r->homedir) {
ndr_print_string(ndr, "homedir", r->homedir);
}
ndr->depth--;
ndr_print_ptr(ndr, "shell", r->shell);
ndr->depth++;
if (r->shell) {
ndr_print_string(ndr, "shell", r->shell);
}
ndr->depth--;
ndr->depth--;
}
NTSTATUS ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r)
{
if (flags & NDR_IN) {
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
}
if (flags & NDR_OUT) {
if (r->out.uid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r)
{
TALLOC_CTX *_mem_save_uid_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
NDR_PULL_ALLOC(ndr, r->out.uid);
ZERO_STRUCTP(r->out.uid);
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.uid);
}
_mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
}
void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r)
{
ndr_print_struct(ndr, name, "unixinfo_SidToUid");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "unixinfo_SidToUid");
ndr->depth++;
ndr_print_dom_sid(ndr, "sid", &r->in.sid);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "unixinfo_SidToUid");
ndr->depth++;
ndr_print_ptr(ndr, "uid", r->out.uid);
ndr->depth++;
ndr_print_hyper(ndr, "uid", *r->out.uid);
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
ndr->depth--;
}
NTSTATUS ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r)
{
if (flags & NDR_IN) {
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
}
if (flags & NDR_OUT) {
if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r)
{
TALLOC_CTX *_mem_save_sid_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
NDR_PULL_ALLOC(ndr, r->out.sid);
ZERO_STRUCTP(r->out.sid);
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.sid);
}
_mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
}
void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r)
{
ndr_print_struct(ndr, name, "unixinfo_UidToSid");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "unixinfo_UidToSid");
ndr->depth++;
ndr_print_hyper(ndr, "uid", r->in.uid);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "unixinfo_UidToSid");
ndr->depth++;
ndr_print_ptr(ndr, "sid", r->out.sid);
ndr->depth++;
ndr_print_dom_sid(ndr, "sid", r->out.sid);
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
ndr->depth--;
}
NTSTATUS ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r)
{
if (flags & NDR_IN) {
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
}
if (flags & NDR_OUT) {
if (r->out.gid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r)
{
TALLOC_CTX *_mem_save_gid_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
NDR_PULL_ALLOC(ndr, r->out.gid);
ZERO_STRUCTP(r->out.gid);
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.gid);
}
_mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
}
void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r)
{
ndr_print_struct(ndr, name, "unixinfo_SidToGid");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "unixinfo_SidToGid");
ndr->depth++;
ndr_print_dom_sid(ndr, "sid", &r->in.sid);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "unixinfo_SidToGid");
ndr->depth++;
ndr_print_ptr(ndr, "gid", r->out.gid);
ndr->depth++;
ndr_print_hyper(ndr, "gid", *r->out.gid);
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
ndr->depth--;
}
NTSTATUS ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r)
{
if (flags & NDR_IN) {
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
}
if (flags & NDR_OUT) {
if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r)
{
TALLOC_CTX *_mem_save_sid_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
NDR_PULL_ALLOC(ndr, r->out.sid);
ZERO_STRUCTP(r->out.sid);
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.sid);
}
_mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
}
void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r)
{
ndr_print_struct(ndr, name, "unixinfo_GidToSid");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "unixinfo_GidToSid");
ndr->depth++;
ndr_print_hyper(ndr, "gid", r->in.gid);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "unixinfo_GidToSid");
ndr->depth++;
ndr_print_ptr(ndr, "sid", r->out.sid);
ndr->depth++;
ndr_print_dom_sid(ndr, "sid", r->out.sid);
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
ndr->depth--;
}
NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r)
{
uint32_t cntr_uids_0;
uint32_t cntr_infos_1;
if (flags & NDR_IN) {
if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uids[cntr_uids_0]));
}
}
if (flags & NDR_OUT) {
if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
if (r->out.infos == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_1]));
}
for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_BUFFERS, &r->out.infos[cntr_infos_1]));
}
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r)
{
uint32_t cntr_uids_0;
uint32_t cntr_infos_1;
TALLOC_CTX *_mem_save_count_0;
TALLOC_CTX *_mem_save_uids_0;
TALLOC_CTX *_mem_save_infos_1;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.count);
}
_mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
if (*r->in.count < 0 || *r->in.count > 1023) {
return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_array_size(ndr, &r->in.uids));
NDR_PULL_ALLOC_N(ndr, r->in.uids, ndr_get_array_size(ndr, &r->in.uids));
_mem_save_uids_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.uids, 0);
for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uids[cntr_uids_0]));
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uids_0, 0);
NDR_PULL_ALLOC(ndr, r->out.count);
*r->out.count = *r->in.count;
if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_PULL_ALLOC_N(ndr, r->out.infos, *r->in.count);
memset(r->out.infos, 0, *r->in.count * sizeof(*r->out.infos));
if (r->in.uids) {
if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count));
}
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.count);
}
_mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
if (*r->out.count < 0 || *r->out.count > 1023) {
return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_array_size(ndr, &r->out.infos));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC_N(ndr, r->out.infos, ndr_get_array_size(ndr, &r->out.infos));
}
_mem_save_infos_1 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.infos, 0);
for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_1]));
}
for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_BUFFERS, &r->out.infos[cntr_infos_1]));
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_1, 0);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
if (r->out.infos) {
if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count));
}
}
return NT_STATUS_OK;
}
void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r)
{
uint32_t cntr_uids_0;
uint32_t cntr_infos_1;
ndr_print_struct(ndr, name, "unixinfo_GetPWUid");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "unixinfo_GetPWUid");
ndr->depth++;
ndr_print_ptr(ndr, "count", r->in.count);
ndr->depth++;
ndr_print_uint32(ndr, "count", *r->in.count);
ndr->depth--;
ndr->print(ndr, "%s: ARRAY(%d)", "uids", *r->in.count);
ndr->depth++;
for (cntr_uids_0=0;cntr_uids_0<*r->in.count;cntr_uids_0++) {
char *idx_0=NULL;
asprintf(&idx_0, "[%d]", cntr_uids_0);
if (idx_0) {
ndr_print_hyper(ndr, "uids", r->in.uids[cntr_uids_0]);
free(idx_0);
}
}
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "unixinfo_GetPWUid");
ndr->depth++;
ndr_print_ptr(ndr, "count", r->out.count);
ndr->depth++;
ndr_print_uint32(ndr, "count", *r->out.count);
ndr->depth--;
ndr_print_ptr(ndr, "infos", r->out.infos);
ndr->depth++;
ndr->print(ndr, "%s: ARRAY(%d)", "infos", *r->out.count);
ndr->depth++;
for (cntr_infos_1=0;cntr_infos_1<*r->out.count;cntr_infos_1++) {
char *idx_1=NULL;
asprintf(&idx_1, "[%d]", cntr_infos_1);
if (idx_1) {
ndr_print_unixinfo_GetPWUidInfo(ndr, "infos", &r->out.infos[cntr_infos_1]);
free(idx_1);
}
}
ndr->depth--;
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
ndr->depth--;
}

View File

@ -0,0 +1,41 @@
/* header auto-generated by pidl */
#include "libndr/unixinfo.h"
#ifndef _HEADER_NDR_unixinfo
#define _HEADER_NDR_unixinfo
#define DCERPC_UNIXINFO_UUID "9c54e310-a955-4885-bd31-78787147dfa6"
#define DCERPC_UNIXINFO_VERSION 0.0
#define DCERPC_UNIXINFO_NAME "unixinfo"
#define DCERPC_UNIXINFO_HELPSTRING "Unixinfo specific stuff"
extern const struct dcerpc_interface_table dcerpc_table_unixinfo;
NTSTATUS dcerpc_server_unixinfo_init(void);
#define DCERPC_UNIXINFO_SIDTOUID (0x00)
#define DCERPC_UNIXINFO_UIDTOSID (0x01)
#define DCERPC_UNIXINFO_SIDTOGID (0x02)
#define DCERPC_UNIXINFO_GIDTOSID (0x03)
#define DCERPC_UNIXINFO_GETPWUID (0x04)
#define DCERPC_UNIXINFO_CALL_COUNT (5)
void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r);
NTSTATUS ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r);
NTSTATUS ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r);
void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r);
NTSTATUS ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r);
NTSTATUS ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r);
void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r);
NTSTATUS ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r);
NTSTATUS ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r);
void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r);
NTSTATUS ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r);
NTSTATUS ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r);
void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r);
NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r);
NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r);
void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r);
#endif /* _HEADER_NDR_unixinfo */

View File

@ -135,13 +135,6 @@ enum sec_privilege {
SEC_PRIV_REMOTE_INTERACTIVE_LOGON=24
};
struct dom_sid {
uint8_t sid_rev_num;
int8_t num_auths;/* [range(0 15)] */
uint8_t id_auth[6];
uint32_t *sub_auths;
}/* [noprint,gensize,noejs,public,nosize] */;
/* bitmap security_ace_flags */
#define SEC_ACE_FLAG_OBJECT_INHERIT ( 0x01 )
#define SEC_ACE_FLAG_CONTAINER_INHERIT ( 0x02 )

View File

@ -42,22 +42,17 @@ NTSTATUS ndr_push_dom_sid(struct ndr_push *ndr, int ndr_flags, const struct dom_
NTSTATUS ndr_pull_dom_sid(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *r)
{
uint32_t cntr_sub_auths_0;
TALLOC_CTX *_mem_save_sub_auths_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sid_rev_num));
NDR_CHECK(ndr_pull_int8(ndr, NDR_SCALARS, &r->num_auths));
if (r->num_auths < 0 || r->num_auths > 15) {
NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_auths));
if (r->num_auths > 15) {
return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
}
NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->id_auth, 6));
NDR_PULL_ALLOC_N(ndr, r->sub_auths, r->num_auths);
_mem_save_sub_auths_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->sub_auths, 0);
for (cntr_sub_auths_0 = 0; cntr_sub_auths_0 < r->num_auths; cntr_sub_auths_0++) {
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sub_auths[cntr_sub_auths_0]));
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sub_auths_0, 0);
}
if (ndr_flags & NDR_BUFFERS) {
}

79
source3/libndr/unixinfo.h Normal file
View File

@ -0,0 +1,79 @@
/* header auto-generated by pidl */
#ifndef _HEADER_unixinfo
#define _HEADER_unixinfo
struct unixinfo_GetPWUidInfo {
NTSTATUS status;
const char *homedir;/* [unique,charset(UTF8)] */
const char *shell;/* [unique,charset(UTF8)] */
};
struct unixinfo_SidToUid {
struct {
struct dom_sid sid;
} in;
struct {
uint64_t *uid;/* [ref] */
NTSTATUS result;
} out;
};
struct unixinfo_UidToSid {
struct {
uint64_t uid;
} in;
struct {
struct dom_sid *sid;/* [ref] */
NTSTATUS result;
} out;
};
struct unixinfo_SidToGid {
struct {
struct dom_sid sid;
} in;
struct {
uint64_t *gid;/* [ref] */
NTSTATUS result;
} out;
};
struct unixinfo_GidToSid {
struct {
uint64_t gid;
} in;
struct {
struct dom_sid *sid;/* [ref] */
NTSTATUS result;
} out;
};
struct unixinfo_GetPWUid {
struct {
uint32_t *count;/* [ref,range(0 1023)] */
uint64_t *uids;/* [size_is(*count)] */
} in;
struct {
uint32_t *count;/* [ref,range(0 1023)] */
struct unixinfo_GetPWUidInfo *infos;/* [ref,size_is(*count)] */
NTSTATUS result;
} out;
};
#endif /* _HEADER_unixinfo */

View File

@ -215,9 +215,9 @@ static NTTIME centry_nttime(struct cache_entry *centry)
centry->len - centry->ofs));
smb_panic("centry_nttime");
}
ret.low = IVAL(centry->data, centry->ofs);
ret = IVAL(centry->data, centry->ofs);
centry->ofs += 4;
ret.high = IVAL(centry->data, centry->ofs);
ret += (uint64_t)IVAL(centry->data, centry->ofs) << 32;
centry->ofs += 4;
return ret;
}
@ -685,9 +685,9 @@ static void centry_put_sid(struct cache_entry *centry, const DOM_SID *sid)
static void centry_put_nttime(struct cache_entry *centry, NTTIME nt)
{
centry_expand(centry, 8);
SIVAL(centry->data, centry->ofs, nt.low);
SIVAL(centry->data, centry->ofs, nt & 0xFFFFFFFF);
centry->ofs += 4;
SIVAL(centry->data, centry->ofs, nt.high);
SIVAL(centry->data, centry->ofs, nt >> 32);
centry->ofs += 4;
}

View File

@ -35,17 +35,17 @@ static NTSTATUS append_info3_as_txt(TALLOC_CTX *mem_ctx,
fstring str_sid;
state->response.data.auth.info3.logon_time =
nt_time_to_unix(&(info3->logon_time));
nt_time_to_unix(info3->logon_time);
state->response.data.auth.info3.logoff_time =
nt_time_to_unix(&(info3->logoff_time));
nt_time_to_unix(info3->logoff_time);
state->response.data.auth.info3.kickoff_time =
nt_time_to_unix(&(info3->kickoff_time));
nt_time_to_unix(info3->kickoff_time);
state->response.data.auth.info3.pass_last_set_time =
nt_time_to_unix(&(info3->pass_last_set_time));
nt_time_to_unix(info3->pass_last_set_time);
state->response.data.auth.info3.pass_can_change_time =
nt_time_to_unix(&(info3->pass_can_change_time));
nt_time_to_unix(info3->pass_can_change_time);
state->response.data.auth.info3.pass_must_change_time =
nt_time_to_unix(&(info3->pass_must_change_time));
nt_time_to_unix(info3->pass_must_change_time);
state->response.data.auth.info3.logon_count = info3->logon_count;
state->response.data.auth.info3.bad_pw_count = info3->bad_pw_count;
@ -819,12 +819,12 @@ NTSTATUS winbindd_dual_pam_auth_cached(struct winbindd_domain *domain,
return NT_STATUS_LOGON_FAILURE;
}
#endif
kickoff_time = nt_time_to_unix(&my_info3->kickoff_time);
kickoff_time = nt_time_to_unix(my_info3->kickoff_time);
if (kickoff_time != 0 && time(NULL) > kickoff_time) {
return NT_STATUS_ACCOUNT_EXPIRED;
}
must_change_time = nt_time_to_unix(&my_info3->pass_must_change_time);
must_change_time = nt_time_to_unix(my_info3->pass_must_change_time);
if (must_change_time != 0 && must_change_time < time(NULL)) {
return NT_STATUS_PASSWORD_EXPIRED;
}

View File

@ -868,7 +868,7 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq)
result = rpccli_samr_query_dom_info(cli, mem_ctx, &dom_pol, 8, &ctr);
if (NT_STATUS_IS_OK(result)) {
*seq = ctr.info.inf8.seq_num.low;
*seq = ctr.info.inf8.seq_num;
got_seq_num = True;
goto seq_num;
}
@ -879,7 +879,7 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq)
result = rpccli_samr_query_dom_info(cli, mem_ctx, &dom_pol, 2, &ctr);
if (NT_STATUS_IS_OK(result)) {
*seq = ctr.info.inf2.seq_num.low;
*seq = ctr.info.inf2.seq_num;
got_seq_num = True;
}

View File

@ -638,7 +638,7 @@ NTSTATUS rpccli_netlogon_sam_sync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Sam synchronisation */
NTSTATUS rpccli_netlogon_sam_deltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
uint32 database_id, UINT64_S seqnum,
uint32 database_id, uint64 seqnum,
uint32 *num_deltas,
SAM_DELTA_HDR **hdr_deltas,
SAM_DELTA_CTR **deltas)

View File

@ -521,7 +521,7 @@ WERROR rpccli_reg_enum_key(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
else
fstrcpy( class_name, "" );
*mod_time = nt_time_to_unix(out.time);
*mod_time = nt_time_to_unix(*out.time);
return out.status;
}

View File

@ -1,226 +1,105 @@
/*
Unix SMB/CIFS implementation.
RPC pipe client
Copyright (C) Volker Lendecke 2005
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Unix SMB/CIFS implementation.
* client auto-generated by pidl. DO NOT MODIFY!
*/
#include "includes.h"
#include "./cli_unixinfo.h"
NTSTATUS rpccli_unixinfo_uid2sid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, uid_t uid, DOM_SID *sid)
NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *uid)
{
prs_struct qbuf, rbuf;
UNIXINFO_Q_UID_TO_SID q;
UNIXINFO_R_UID_TO_SID r;
NTSTATUS result = NT_STATUS_NET_WRITE_FAULT;
ZERO_STRUCT(q);
ZERO_STRUCT(r);
/* Marshall data and send request */
{
UINT64_S uid64;
uid64.high = 0;
uid64.low = uid;
init_q_unixinfo_uid_to_sid(&q, uid64);
struct unixinfo_SidToUid r;
NTSTATUS status;
/* In parameters */
r.in.sid = sid;
status = cli_do_rpc_ndr(cli, mem_ctx, PI_UNIXINFO, DCERPC_UNIXINFO_SIDTOUID, &r, (ndr_pull_flags_fn_t)ndr_pull_unixinfo_SidToUid, (ndr_push_flags_fn_t)ndr_push_unixinfo_SidToUid);
if (NT_STATUS_IS_ERR(status)) {
return status;
}
CLI_DO_RPC(cli, mem_ctx, PI_UNIXINFO, UNIXINFO_UID_TO_SID,
q, r,
qbuf, rbuf,
unixinfo_io_q_unixinfo_uid_to_sid,
unixinfo_io_r_unixinfo_uid_to_sid,
NT_STATUS_NET_WRITE_FAULT);
if (NT_STATUS_IS_OK(r.status) && (sid != NULL)) {
sid_copy(sid, &r.sid);
}
result = r.status;
return result;
/* Return variables */
*uid = *r.out.uid;
/* Return result */
return r.out.result;
}
NTSTATUS rpccli_unixinfo_sid2uid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const DOM_SID *sid, uid_t *uid)
NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t uid, struct dom_sid *sid)
{
prs_struct qbuf, rbuf;
UNIXINFO_Q_SID_TO_UID q;
UNIXINFO_R_SID_TO_UID r;
NTSTATUS result = NT_STATUS_NET_WRITE_FAULT;
ZERO_STRUCT(q);
ZERO_STRUCT(r);
/* Marshall data and send request */
init_q_unixinfo_sid_to_uid(&q, sid);
CLI_DO_RPC(cli, mem_ctx, PI_UNIXINFO, UNIXINFO_SID_TO_UID,
q, r,
qbuf, rbuf,
unixinfo_io_q_unixinfo_sid_to_uid,
unixinfo_io_r_unixinfo_sid_to_uid,
NT_STATUS_NET_WRITE_FAULT);
if (NT_STATUS_IS_OK(r.status)) {
if (r.uid.high != 0) {
/* 64-Bit uid's not yet handled */
return NT_STATUS_INVALID_PARAMETER;
}
if (uid != NULL) {
*uid = r.uid.low;
}
struct unixinfo_UidToSid r;
NTSTATUS status;
/* In parameters */
r.in.uid = uid;
status = cli_do_rpc_ndr(cli, mem_ctx, PI_UNIXINFO, DCERPC_UNIXINFO_UIDTOSID, &r, (ndr_pull_flags_fn_t)ndr_pull_unixinfo_UidToSid, (ndr_push_flags_fn_t)ndr_push_unixinfo_UidToSid);
if (NT_STATUS_IS_ERR(status)) {
return status;
}
result = r.status;
return result;
/* Return variables */
*sid = *r.out.sid;
/* Return result */
return r.out.result;
}
NTSTATUS rpccli_unixinfo_gid2sid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, gid_t gid, DOM_SID *sid)
NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *gid)
{
prs_struct qbuf, rbuf;
UNIXINFO_Q_GID_TO_SID q;
UNIXINFO_R_GID_TO_SID r;
NTSTATUS result = NT_STATUS_NET_WRITE_FAULT;
ZERO_STRUCT(q);
ZERO_STRUCT(r);
/* Marshall data and send request */
{
UINT64_S gid64;
gid64.high = 0;
gid64.low = gid;
init_q_unixinfo_gid_to_sid(&q, gid64);
struct unixinfo_SidToGid r;
NTSTATUS status;
/* In parameters */
r.in.sid = sid;
status = cli_do_rpc_ndr(cli, mem_ctx, PI_UNIXINFO, DCERPC_UNIXINFO_SIDTOGID, &r, (ndr_pull_flags_fn_t)ndr_pull_unixinfo_SidToGid, (ndr_push_flags_fn_t)ndr_push_unixinfo_SidToGid);
if (NT_STATUS_IS_ERR(status)) {
return status;
}
CLI_DO_RPC(cli, mem_ctx, PI_UNIXINFO, UNIXINFO_GID_TO_SID,
q, r,
qbuf, rbuf,
unixinfo_io_q_unixinfo_gid_to_sid,
unixinfo_io_r_unixinfo_gid_to_sid,
NT_STATUS_NET_WRITE_FAULT);
if (NT_STATUS_IS_OK(r.status) && (sid != NULL)) {
sid_copy(sid, &r.sid);
}
result = r.status;
return result;
/* Return variables */
*gid = *r.out.gid;
/* Return result */
return r.out.result;
}
NTSTATUS rpccli_unixinfo_sid2gid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const DOM_SID *sid, gid_t *gid)
NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t gid, struct dom_sid *sid)
{
prs_struct qbuf, rbuf;
UNIXINFO_Q_SID_TO_GID q;
UNIXINFO_R_SID_TO_GID r;
NTSTATUS result = NT_STATUS_NET_WRITE_FAULT;
ZERO_STRUCT(q);
ZERO_STRUCT(r);
/* Marshall data and send request */
init_q_unixinfo_sid_to_gid(&q, sid);
CLI_DO_RPC(cli, mem_ctx, PI_UNIXINFO, UNIXINFO_SID_TO_GID,
q, r,
qbuf, rbuf,
unixinfo_io_q_unixinfo_sid_to_gid,
unixinfo_io_r_unixinfo_sid_to_gid,
NT_STATUS_NET_WRITE_FAULT);
if (NT_STATUS_IS_OK(r.status)) {
if (r.gid.high != 0) {
/* 64-Bit gid's not yet handled */
return NT_STATUS_INVALID_PARAMETER;
}
if (gid != NULL) {
*gid = r.gid.low;
}
struct unixinfo_GidToSid r;
NTSTATUS status;
/* In parameters */
r.in.gid = gid;
status = cli_do_rpc_ndr(cli, mem_ctx, PI_UNIXINFO, DCERPC_UNIXINFO_GIDTOSID, &r, (ndr_pull_flags_fn_t)ndr_pull_unixinfo_GidToSid, (ndr_push_flags_fn_t)ndr_push_unixinfo_GidToSid);
if (NT_STATUS_IS_ERR(status)) {
return status;
}
result = r.status;
return result;
/* Return variables */
*sid = *r.out.sid;
/* Return result */
return r.out.result;
}
NTSTATUS rpccli_unixinfo_getpwuid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int count, uid_t *uids,
struct unixinfo_getpwuid **info)
NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo *infos)
{
prs_struct qbuf, rbuf;
UNIXINFO_Q_GETPWUID q;
UNIXINFO_R_GETPWUID r;
NTSTATUS result = NT_STATUS_NET_WRITE_FAULT;
int i;
UINT64_S *uids64;
ZERO_STRUCT(q);
ZERO_STRUCT(r);
/* Marshall data and send request */
uids64 = TALLOC_ARRAY(mem_ctx, UINT64_S, count);
if (uids64 == NULL) {
return NT_STATUS_NO_MEMORY;
struct unixinfo_GetPWUid r;
NTSTATUS status;
/* In parameters */
r.in.count = count;
r.in.uids = uids;
status = cli_do_rpc_ndr(cli, mem_ctx, PI_UNIXINFO, DCERPC_UNIXINFO_GETPWUID, &r, (ndr_pull_flags_fn_t)ndr_pull_unixinfo_GetPWUid, (ndr_push_flags_fn_t)ndr_push_unixinfo_GetPWUid);
if (NT_STATUS_IS_ERR(status)) {
return status;
}
for (i=0; i<count; i++) {
uids64[i].high = 0;
uids64[i].low = uids[i];
}
init_q_unixinfo_getpwuid(&q, count, uids64);
CLI_DO_RPC(cli, mem_ctx, PI_UNIXINFO, UNIXINFO_GETPWUID,
q, r,
qbuf, rbuf,
unixinfo_io_q_unixinfo_getpwuid,
unixinfo_io_r_unixinfo_getpwuid,
NT_STATUS_NET_WRITE_FAULT);
if (!NT_STATUS_IS_OK(r.status)) {
result = r.status;
*info = NULL;
return result;
}
if (r.count != count) {
DEBUG(0, ("Expected array size %d, got %d\n",
count, r.count));
return NT_STATUS_INVALID_PARAMETER;
}
*info = TALLOC_ARRAY(mem_ctx, struct unixinfo_getpwuid, count);
if (*info == NULL) {
return NT_STATUS_NO_MEMORY;
}
for (i=0; i<count; i++) {
(*info)[i].status = r.info[i].status;
(*info)[i].homedir = talloc_strdup(mem_ctx, r.info[i].homedir);
(*info)[i].shell = talloc_strdup(mem_ctx, r.info[i].shell);
}
result = r.status;
return result;
/* Return variables */
*count = *r.out.count;
*infos = *r.out.infos;
/* Return result */
return r.out.result;
}

View File

@ -0,0 +1,9 @@
#include "libndr/ndr_unixinfo.h"
#ifndef __CLI_UNIXINFO__
#define __CLI_UNIXINFO__
NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *uid);
NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t uid, struct dom_sid *sid);
NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *gid);
NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t gid, struct dom_sid *sid);
NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo *infos);
#endif /* __CLI_UNIXINFO__ */

View File

@ -115,6 +115,7 @@ static BOOL smb_io_utime(const char *desc, UTIME *t, prs_struct *ps, int depth)
BOOL smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth)
{
uint32 low, high;
if (nttime == NULL)
return False;
@ -124,11 +125,13 @@ BOOL smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth)
if(!prs_align(ps))
return False;
if(!prs_uint32("low ", ps, depth, &nttime->low)) /* low part */
if(!prs_uint32("low ", ps, depth, &low)) /* low part */
return False;
if(!prs_uint32("high", ps, depth, &nttime->high)) /* high part */
if(!prs_uint32("high", ps, depth, &high)) /* high part */
return False;
*nttime = (((uint64_t)high << 32) + low);
return True;
}
@ -1762,10 +1765,25 @@ BOOL smb_io_unistr3(const char *desc, UNISTR3 *name, prs_struct *ps, int depth)
/*******************************************************************
Stream a uint64_struct
********************************************************************/
BOOL prs_uint64(const char *name, prs_struct *ps, int depth, UINT64_S *data64)
BOOL prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64)
{
return prs_uint32(name, ps, depth+1, &data64->low) &&
prs_uint32(name, ps, depth+1, &data64->high);
if (UNMARSHALLING(ps)) {
uint32 high, low;
if (!prs_uint32(name, ps, depth+1, &low))
return False;
if (!prs_uint32(name, ps, depth+1, &high))
return False;
*data64 = ((uint64_t)high << 32) + low;
return True;
} else {
uint32 high = (*data64) >> 32, low = (*data64) & 0xFFFFFFFF;
return prs_uint32(name, ps, depth+1, &low) &&
prs_uint32(name, ps, depth+1, &high);
}
}
/*******************************************************************

View File

@ -3104,7 +3104,7 @@ makes a NET_Q_SAM_DELTAS structure.
********************************************************************/
BOOL init_net_q_sam_deltas(NET_Q_SAM_DELTAS *q_s, const char *srv_name,
const char *cli_name, DOM_CRED *cli_creds,
uint32 database_id, UINT64_S dom_mod_count)
uint32 database_id, uint64 dom_mod_count)
{
DEBUG(5, ("init_net_q_sam_deltas\n"));
@ -3115,8 +3115,7 @@ BOOL init_net_q_sam_deltas(NET_Q_SAM_DELTAS *q_s, const char *srv_name,
memset(&q_s->ret_creds, 0, sizeof(q_s->ret_creds));
q_s->database_id = database_id;
q_s->dom_mod_count.low = dom_mod_count.low;
q_s->dom_mod_count.high = dom_mod_count.high;
q_s->dom_mod_count = dom_mod_count;
q_s->max_size = 0xffff;
return True;

View File

@ -511,12 +511,10 @@ void init_unk_info1(SAM_UNK_INFO_1 *u_1, uint16 min_pass_len, uint16 pass_hist,
u_1->password_properties = password_properties;
/* password never expire */
u_1->expire.high = nt_expire.high;
u_1->expire.low = nt_expire.low;
u_1->expire = nt_expire;
/* can change the password now */
u_1->min_passwordage.high = nt_min_age.high;
u_1->min_passwordage.low = nt_min_age.low;
u_1->min_passwordage = nt_min_age;
}
@ -555,11 +553,9 @@ void init_unk_info2(SAM_UNK_INFO_2 * u_2,
const char *comment, const char *domain, const char *server,
uint32 seq_num, uint32 num_users, uint32 num_groups, uint32 num_alias, NTTIME nt_logout, uint32 server_role)
{
u_2->logout.low = nt_logout.low;
u_2->logout.high = nt_logout.high;
u_2->logout = nt_logout;
u_2->seq_num.low = seq_num;
u_2->seq_num.high = 0x00000000;
u_2->seq_num = seq_num;
u_2->unknown_4 = 0x00000001;
@ -635,8 +631,7 @@ inits a structure.
void init_unk_info3(SAM_UNK_INFO_3 *u_3, NTTIME nt_logout)
{
u_3->logout.low = nt_logout.low;
u_3->logout.high = nt_logout.high;
u_3->logout = nt_logout;
}
/*******************************************************************
@ -789,8 +784,7 @@ inits a structure.
void init_unk_info8(SAM_UNK_INFO_8 * u_8, uint32 seq_num)
{
unix_to_nt_time(&u_8->domain_create_time, 0);
u_8->seq_num.low = seq_num;
u_8->seq_num.high = 0x0000;
u_8->seq_num = seq_num;
}
/*******************************************************************
@ -849,10 +843,8 @@ inits a structure.
void init_unk_info12(SAM_UNK_INFO_12 * u_12, NTTIME nt_lock_duration, NTTIME nt_reset_time, uint16 lockout)
{
u_12->duration.low = nt_lock_duration.low;
u_12->duration.high = nt_lock_duration.high;
u_12->reset_count.low = nt_reset_time.low;
u_12->reset_count.high = nt_reset_time.high;
u_12->duration = nt_lock_duration;
u_12->reset_count = nt_reset_time;
u_12->bad_attempt_lockout = lockout;
}
@ -887,8 +879,7 @@ inits a structure.
void init_unk_info13(SAM_UNK_INFO_13 * u_13, uint32 seq_num)
{
unix_to_nt_time(&u_13->domain_create_time, 0);
u_13->seq_num.low = seq_num;
u_13->seq_num.high = 0x0000;
u_13->seq_num = seq_num;
u_13->unknown1 = 0;
u_13->unknown2 = 0;
}

View File

@ -2643,9 +2643,7 @@ BOOL smb_io_printer_driver_info_6(const char *desc, RPC_BUFFER *buffer, DRIVER_I
if (!smb_io_relarraystr("previousdrivernames", buffer, depth, &info->previousdrivernames))
return False;
if (!prs_uint32("date.low", ps, depth, &info->driver_date.low))
return False;
if (!prs_uint32("date.high", ps, depth, &info->driver_date.high))
if (!prs_uint64("date", ps, depth, &info->driver_date))
return False;
if (!prs_uint32("padding", ps, depth, &info->padding))

View File

@ -48,7 +48,7 @@ BOOL unixinfo_io_r_unixinfo_sid_to_uid(const char *desc, UNIXINFO_R_SID_TO_UID *
return True;
}
void init_q_unixinfo_uid_to_sid(UNIXINFO_Q_UID_TO_SID *q_d, UINT64_S uid)
void init_q_unixinfo_uid_to_sid(UNIXINFO_Q_UID_TO_SID *q_d, uint64 uid)
{
q_d->uid = uid;
}
@ -97,7 +97,7 @@ BOOL unixinfo_io_q_unixinfo_sid_to_gid(const char *desc, UNIXINFO_Q_SID_TO_GID *
return smb_io_dom_sid(desc, &q_d->sid, ps, depth);
}
void init_r_unixinfo_sid_to_gid(UNIXINFO_R_SID_TO_GID *r_d, UINT64_S gid)
void init_r_unixinfo_sid_to_gid(UNIXINFO_R_SID_TO_GID *r_d, uint64 gid)
{
r_d->gid = gid;
r_d->status = NT_STATUS_OK;
@ -115,7 +115,7 @@ BOOL unixinfo_io_r_unixinfo_sid_to_gid(const char *desc, UNIXINFO_R_SID_TO_GID *
return True;
}
void init_q_unixinfo_gid_to_sid(UNIXINFO_Q_GID_TO_SID *q_d, UINT64_S gid)
void init_q_unixinfo_gid_to_sid(UNIXINFO_Q_GID_TO_SID *q_d, uint64 gid)
{
q_d->gid = gid;
}
@ -154,7 +154,7 @@ BOOL unixinfo_io_r_unixinfo_gid_to_sid(const char *desc, UNIXINFO_R_GID_TO_SID *
}
void init_q_unixinfo_getpwuid(UNIXINFO_Q_GETPWUID *r_d, int count,
UINT64_S *uids)
uint64 *uids)
{
r_d->count = count;
r_d->uid = uids;
@ -186,7 +186,7 @@ BOOL unixinfo_io_q_unixinfo_getpwuid(const char *desc,
}
if (UNMARSHALLING(ps)) {
q_d->uid = PRS_ALLOC_MEM(ps, UINT64_S, q_d->count);
q_d->uid = PRS_ALLOC_MEM(ps, uint64, q_d->count);
if (q_d->uid == NULL) {
return False;
}

View File

@ -76,7 +76,7 @@ void copy_id21_to_sam_passwd(struct samu *to, SAM_USER_INFO_21 *from)
return;
if (from->fields_present & ACCT_LAST_LOGON) {
unix_time=nt_time_to_unix(&from->logon_time);
unix_time=nt_time_to_unix(from->logon_time);
stored_time = pdb_get_logon_time(to);
DEBUG(10,("INFO_21 LOGON_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -84,7 +84,7 @@ void copy_id21_to_sam_passwd(struct samu *to, SAM_USER_INFO_21 *from)
}
if (from->fields_present & ACCT_LAST_LOGOFF) {
unix_time=nt_time_to_unix(&from->logoff_time);
unix_time=nt_time_to_unix(from->logoff_time);
stored_time = pdb_get_logoff_time(to);
DEBUG(10,("INFO_21 LOGOFF_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -92,7 +92,7 @@ void copy_id21_to_sam_passwd(struct samu *to, SAM_USER_INFO_21 *from)
}
if (from->fields_present & ACCT_EXPIRY) {
unix_time=nt_time_to_unix(&from->kickoff_time);
unix_time=nt_time_to_unix(from->kickoff_time);
stored_time = pdb_get_kickoff_time(to);
DEBUG(10,("INFO_21 KICKOFF_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -100,7 +100,7 @@ void copy_id21_to_sam_passwd(struct samu *to, SAM_USER_INFO_21 *from)
}
if (from->fields_present & ACCT_ALLOW_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_can_change_time);
unix_time=nt_time_to_unix(from->pass_can_change_time);
stored_time = pdb_get_pass_can_change_time(to);
DEBUG(10,("INFO_21 PASS_CAN_CH: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -108,7 +108,7 @@ void copy_id21_to_sam_passwd(struct samu *to, SAM_USER_INFO_21 *from)
}
if (from->fields_present & ACCT_LAST_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_last_set_time);
unix_time=nt_time_to_unix(from->pass_last_set_time);
stored_time = pdb_get_pass_last_set_time(to);
DEBUG(10,("INFO_21 PASS_LAST_SET: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -116,7 +116,7 @@ void copy_id21_to_sam_passwd(struct samu *to, SAM_USER_INFO_21 *from)
}
if (from->fields_present & ACCT_FORCE_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_must_change_time);
unix_time=nt_time_to_unix(from->pass_must_change_time);
stored_time=pdb_get_pass_must_change_time(to);
DEBUG(10,("INFO_21 PASS_MUST_CH: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -324,7 +324,7 @@ void copy_id23_to_sam_passwd(struct samu *to, SAM_USER_INFO_23 *from)
return;
if (from->fields_present & ACCT_LAST_LOGON) {
unix_time=nt_time_to_unix(&from->logon_time);
unix_time=nt_time_to_unix(from->logon_time);
stored_time = pdb_get_logon_time(to);
DEBUG(10,("INFO_23 LOGON_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -332,7 +332,7 @@ void copy_id23_to_sam_passwd(struct samu *to, SAM_USER_INFO_23 *from)
}
if (from->fields_present & ACCT_LAST_LOGOFF) {
unix_time=nt_time_to_unix(&from->logoff_time);
unix_time=nt_time_to_unix(from->logoff_time);
stored_time = pdb_get_logoff_time(to);
DEBUG(10,("INFO_23 LOGOFF_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -340,7 +340,7 @@ void copy_id23_to_sam_passwd(struct samu *to, SAM_USER_INFO_23 *from)
}
if (from->fields_present & ACCT_EXPIRY) {
unix_time=nt_time_to_unix(&from->kickoff_time);
unix_time=nt_time_to_unix(from->kickoff_time);
stored_time = pdb_get_kickoff_time(to);
DEBUG(10,("INFO_23 KICKOFF_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -348,7 +348,7 @@ void copy_id23_to_sam_passwd(struct samu *to, SAM_USER_INFO_23 *from)
}
if (from->fields_present & ACCT_ALLOW_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_can_change_time);
unix_time=nt_time_to_unix(from->pass_can_change_time);
stored_time = pdb_get_pass_can_change_time(to);
DEBUG(10,("INFO_23 PASS_CAN_CH: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -356,7 +356,7 @@ void copy_id23_to_sam_passwd(struct samu *to, SAM_USER_INFO_23 *from)
}
if (from->fields_present & ACCT_LAST_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_last_set_time);
unix_time=nt_time_to_unix(from->pass_last_set_time);
stored_time = pdb_get_pass_last_set_time(to);
DEBUG(10,("INFO_23 PASS_LAST_SET: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -364,7 +364,7 @@ void copy_id23_to_sam_passwd(struct samu *to, SAM_USER_INFO_23 *from)
}
if (from->fields_present & ACCT_FORCE_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_must_change_time);
unix_time=nt_time_to_unix(from->pass_must_change_time);
stored_time=pdb_get_pass_must_change_time(to);
DEBUG(10,("INFO_23 PASS_MUST_CH: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -562,7 +562,7 @@ void copy_id25_to_sam_passwd(struct samu *to, SAM_USER_INFO_25 *from)
return;
if (from->fields_present & ACCT_LAST_LOGON) {
unix_time=nt_time_to_unix(&from->logon_time);
unix_time=nt_time_to_unix(from->logon_time);
stored_time = pdb_get_logon_time(to);
DEBUG(10,("INFO_25 LOGON_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -570,7 +570,7 @@ void copy_id25_to_sam_passwd(struct samu *to, SAM_USER_INFO_25 *from)
}
if (from->fields_present & ACCT_LAST_LOGOFF) {
unix_time=nt_time_to_unix(&from->logoff_time);
unix_time=nt_time_to_unix(from->logoff_time);
stored_time = pdb_get_logoff_time(to);
DEBUG(10,("INFO_25 LOGOFF_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -578,7 +578,7 @@ void copy_id25_to_sam_passwd(struct samu *to, SAM_USER_INFO_25 *from)
}
if (from->fields_present & ACCT_EXPIRY) {
unix_time=nt_time_to_unix(&from->kickoff_time);
unix_time=nt_time_to_unix(from->kickoff_time);
stored_time = pdb_get_kickoff_time(to);
DEBUG(10,("INFO_25 KICKOFF_TIME: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -586,7 +586,7 @@ void copy_id25_to_sam_passwd(struct samu *to, SAM_USER_INFO_25 *from)
}
if (from->fields_present & ACCT_ALLOW_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_can_change_time);
unix_time=nt_time_to_unix(from->pass_can_change_time);
stored_time = pdb_get_pass_can_change_time(to);
DEBUG(10,("INFO_25 PASS_CAN_CH: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -594,7 +594,7 @@ void copy_id25_to_sam_passwd(struct samu *to, SAM_USER_INFO_25 *from)
}
if (from->fields_present & ACCT_LAST_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_last_set_time);
unix_time=nt_time_to_unix(from->pass_last_set_time);
stored_time = pdb_get_pass_last_set_time(to);
DEBUG(10,("INFO_25 PASS_LAST_SET: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)
@ -602,7 +602,7 @@ void copy_id25_to_sam_passwd(struct samu *to, SAM_USER_INFO_25 *from)
}
if (from->fields_present & ACCT_FORCE_PWD_CHANGE) {
unix_time=nt_time_to_unix(&from->pass_must_change_time);
unix_time=nt_time_to_unix(from->pass_must_change_time);
stored_time=pdb_get_pass_must_change_time(to);
DEBUG(10,("INFO_25 PASS_MUST_CH: %lu -> %lu\n",(long unsigned int)stored_time, (long unsigned int)unix_time));
if (stored_time != unix_time)

View File

@ -5287,8 +5287,7 @@ static void fill_printer_driver_info_6(DRIVER_INFO_6 *info, NT_PRINTER_DRIVER_IN
info->previousdrivernames=NULL;
init_unistr_array(&info->previousdrivernames, &nullstr, servername);
info->driver_date.low=0;
info->driver_date.high=0;
info->driver_date=0;
info->padding=0;
info->driver_version_low=0;

View File

@ -34,12 +34,11 @@ NTSTATUS _unixinfo_sid_to_uid(pipes_struct *p,
{
uid_t uid;
r_u->uid.low = 0;
r_u->uid.high = 0;
r_u->uid = 0;
r_u->status = sid_to_uid(&q_u->sid, &uid) ? NT_STATUS_OK : NT_STATUS_NONE_MAPPED;
if (NT_STATUS_IS_OK(r_u->status))
r_u->uid.low = uid;
r_u->uid = uid;
return r_u->status;
}
@ -54,8 +53,8 @@ NTSTATUS _unixinfo_uid_to_sid(pipes_struct *p,
r_u->status = NT_STATUS_NO_SUCH_USER;
if (q_u->uid.high == 0) {
uid_to_sid(&sid, q_u->uid.low);
if (q_u->uid == 0) {
uid_to_sid(&sid, q_u->uid);
r_u->status = NT_STATUS_OK;
}
@ -73,12 +72,11 @@ NTSTATUS _unixinfo_sid_to_gid(pipes_struct *p,
{
gid_t gid;
r_u->gid.low = 0;
r_u->gid.high = 0;
r_u->gid = 0;
r_u->status = sid_to_gid(&q_u->sid, &gid) ? NT_STATUS_OK : NT_STATUS_NONE_MAPPED;
if (NT_STATUS_IS_OK(r_u->status))
r_u->gid.low = gid;
r_u->gid = gid;
return r_u->status;
}
@ -93,8 +91,8 @@ NTSTATUS _unixinfo_gid_to_sid(pipes_struct *p,
r_u->status = NT_STATUS_NO_SUCH_USER;
if (q_u->gid.high == 0) {
gid_to_sid(&sid, q_u->gid.low);
if (q_u->gid == 0) {
gid_to_sid(&sid, q_u->gid);
r_u->status = NT_STATUS_OK;
}
@ -135,15 +133,10 @@ NTSTATUS _unixinfo_getpwuid(pipes_struct *p,
r_u->info[i].homedir = "";
r_u->info[i].shell = "";
if (q_u->uid[i].high != 0) {
DEBUG(10, ("64-bit uids not yet supported...\n"));
continue;
}
pw = getpwuid(q_u->uid[i].low);
pw = getpwuid(q_u->uid[i]);
if (pw == NULL) {
DEBUG(10, ("Did not find uid %d\n", q_u->uid[i].low));
DEBUG(10, ("Did not find uid %lld\n", q_u->uid[i]));
continue;
}

View File

@ -63,9 +63,9 @@ static void display_query_info_1(DOM_QUERY_1 d)
{
d_printf("percent_full:\t%d\n", d.percent_full);
d_printf("log_size:\t%d\n", d.log_size);
d_printf("retention_time:\t%08x %08x\n", d.retention_time.high, d.retention_time.low);
d_printf("retention_time:\t%lld\n", d.retention_time);
d_printf("shutdown_in_progress:\t%d\n", d.shutdown_in_progress);
d_printf("time_to_shutdown:\t%08x %08x\n", d.time_to_shutdown.high, d.time_to_shutdown.low);
d_printf("time_to_shutdown:\t%lld\n", d.time_to_shutdown);
d_printf("next_audit_record:\t%d\n", d.next_audit_record);
d_printf("unknown:\t%d\n", d.unknown);
}

View File

@ -263,7 +263,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
uint32 database_id, num_deltas, tmp;
SAM_DELTA_HDR *hdr_deltas;
SAM_DELTA_CTR *deltas;
UINT64_S seqnum;
uint64 seqnum;
if (argc != 3) {
fprintf(stderr, "Usage: %s database_id seqnum\n", argv[0]);
@ -273,8 +273,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
database_id = atoi(argv[1]);
tmp = atoi(argv[2]);
seqnum.low = tmp & 0xffff;
seqnum.high = 0;
seqnum = tmp & 0xffff;
result = rpccli_netlogon_sam_deltas(cli, mem_ctx, database_id,
seqnum, &num_deltas,

View File

@ -84,17 +84,17 @@ static void display_sam_user_info_21(SAM_USER_INFO_21 *usr)
printf("\tRemote Dial :\t%s\n", temp);
printf("\tLogon Time :\t%s\n",
http_timestring(nt_time_to_unix(&usr->logon_time)));
http_timestring(nt_time_to_unix(usr->logon_time)));
printf("\tLogoff Time :\t%s\n",
http_timestring(nt_time_to_unix(&usr->logoff_time)));
http_timestring(nt_time_to_unix(usr->logoff_time)));
printf("\tKickoff Time :\t%s\n",
http_timestring(nt_time_to_unix(&usr->kickoff_time)));
http_timestring(nt_time_to_unix(usr->kickoff_time)));
printf("\tPassword last set Time :\t%s\n",
http_timestring(nt_time_to_unix(&usr->pass_last_set_time)));
http_timestring(nt_time_to_unix(usr->pass_last_set_time)));
printf("\tPassword can change Time :\t%s\n",
http_timestring(nt_time_to_unix(&usr->pass_can_change_time)));
http_timestring(nt_time_to_unix(usr->pass_can_change_time)));
printf("\tPassword must change Time:\t%s\n",
http_timestring(nt_time_to_unix(&usr->pass_must_change_time)));
http_timestring(nt_time_to_unix(usr->pass_must_change_time)));
printf("\tunknown_2[0..31]...\n"); /* user passwords? */
@ -114,40 +114,6 @@ static void display_sam_user_info_21(SAM_USER_INFO_21 *usr)
}
}
static const char *display_time(NTTIME nttime)
{
static fstring string;
float high;
float low;
int sec;
int days, hours, mins, secs;
if (nttime.high==0 && nttime.low==0)
return "Now";
if (nttime.high==0x80000000 && nttime.low==0)
return "Never";
high = 65536;
high = high/10000;
high = high*65536;
high = high/1000;
high = high * (~nttime.high);
low = ~nttime.low;
low = low/(1000*1000*10);
sec=high+low;
days=sec/(60*60*24);
hours=(sec - (days*60*60*24)) / (60*60);
mins=(sec - (days*60*60*24) - (hours*60*60) ) / 60;
secs=sec - (days*60*60*24) - (hours*60*60) - (mins*60);
fstr_sprintf(string, "%u days, %u hours, %u minutes, %u seconds", days, hours, mins, secs);
return (string);
}
static void display_password_properties(uint32 password_properties)
{
@ -199,7 +165,7 @@ static void display_sam_unk_info_2(SAM_UNK_INFO_2 *info2)
printf("Total Groups:\t%d\n", info2->num_domain_grps);
printf("Total Aliases:\t%d\n", info2->num_local_grps);
printf("Sequence No:\t%d\n", info2->seq_num.low);
printf("Sequence No:\t%lld\n", info2->seq_num);
printf("Force Logoff:\t%d\n", (int)nt_time_to_unix_abs(&info2->logout));
@ -244,9 +210,9 @@ static void display_sam_unk_info_7(SAM_UNK_INFO_7 *info7)
static void display_sam_unk_info_8(SAM_UNK_INFO_8 *info8)
{
printf("Sequence No:\t%d\n", info8->seq_num.low);
printf("Sequence No:\t%lld\n", info8->seq_num);
printf("Domain Create Time:\t%s\n",
http_timestring(nt_time_to_unix(&info8->domain_create_time)));
http_timestring(nt_time_to_unix(info8->domain_create_time)));
}
static void display_sam_unk_info_9(SAM_UNK_INFO_9 *info9)
@ -263,9 +229,9 @@ static void display_sam_unk_info_12(SAM_UNK_INFO_12 *info12)
static void display_sam_unk_info_13(SAM_UNK_INFO_13 *info13)
{
printf("Sequence No:\t%d\n", info13->seq_num.low);
printf("Sequence No:\t%lld\n", info13->seq_num);
printf("Domain Create Time:\t%s\n",
http_timestring(nt_time_to_unix(&info13->domain_create_time)));
http_timestring(nt_time_to_unix(info13->domain_create_time)));
printf("Unknown1:\t%d\n", info13->unknown1);
printf("Unknown2:\t%d\n", info13->unknown2);

View File

@ -21,6 +21,7 @@
#include "includes.h"
#include "rpcclient.h"
#include "rpc_client/cli_unixinfo.h"
static NTSTATUS cmd_unixinfo_uid2sid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
@ -36,8 +37,7 @@ static NTSTATUS cmd_unixinfo_uid2sid(struct rpc_pipe_client *cli,
}
uid = atoi(argv[1]);
result = rpccli_unixinfo_uid2sid(cli, mem_ctx, uid, &sid);
result = rpccli_unixinfo_UidToSid(cli, mem_ctx, uid, &sid);
if (!NT_STATUS_IS_OK(result))
goto done;
@ -52,7 +52,7 @@ static NTSTATUS cmd_unixinfo_sid2uid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
uid_t uid;
uint64_t uid;
DOM_SID sid;
NTSTATUS result;
@ -66,12 +66,12 @@ static NTSTATUS cmd_unixinfo_sid2uid(struct rpc_pipe_client *cli,
goto done;
}
result = rpccli_unixinfo_sid2uid(cli, mem_ctx, &sid, &uid);
result = rpccli_unixinfo_SidToUid(cli, mem_ctx, sid, &uid);
if (!NT_STATUS_IS_OK(result))
goto done;
printf("%u\n", uid);
printf("%llu\n", uid);
done:
return result;
@ -92,7 +92,7 @@ static NTSTATUS cmd_unixinfo_gid2sid(struct rpc_pipe_client *cli,
gid = atoi(argv[1]);
result = rpccli_unixinfo_gid2sid(cli, mem_ctx, gid, &sid);
result = rpccli_unixinfo_GidToSid(cli, mem_ctx, gid, &sid);
if (!NT_STATUS_IS_OK(result))
goto done;
@ -107,7 +107,7 @@ static NTSTATUS cmd_unixinfo_sid2gid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
gid_t gid;
uint64_t gid;
DOM_SID sid;
NTSTATUS result;
@ -121,12 +121,12 @@ static NTSTATUS cmd_unixinfo_sid2gid(struct rpc_pipe_client *cli,
goto done;
}
result = rpccli_unixinfo_sid2gid(cli, mem_ctx, &sid, &gid);
result = rpccli_unixinfo_SidToGid(cli, mem_ctx, sid, &gid);
if (!NT_STATUS_IS_OK(result))
goto done;
printf("%u\n", gid);
printf("%llu\n", gid);
done:
return result;
@ -136,9 +136,9 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
uid_t *uids;
int i, num_uids;
struct unixinfo_getpwuid *info;
uint64_t *uids;
unsigned int i, num_uids;
struct unixinfo_GetPWUidInfo *info;
NTSTATUS result;
if (argc < 2) {
@ -147,7 +147,7 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli,
}
num_uids = argc-1;
uids = TALLOC_ARRAY(mem_ctx, uid_t, num_uids);
uids = TALLOC_ARRAY(mem_ctx, uint64_t, num_uids);
if (uids == NULL) {
return NT_STATUS_NO_MEMORY;
@ -157,7 +157,7 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli,
uids[i] = atoi(argv[i+1]);
}
result = rpccli_unixinfo_getpwuid(cli, mem_ctx, num_uids, uids, &info);
result = rpccli_unixinfo_GetPWUid(cli, mem_ctx, &num_uids, uids, &info);
if (!NT_STATUS_IS_OK(result)) {
return result;
@ -165,10 +165,10 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli,
for (i=0; i<num_uids; i++) {
if (NT_STATUS_IS_OK(info[i].status)) {
printf("%d:%s:%s\n", uids[i], info[i].homedir,
printf("%llu:%s:%s\n", uids[i], info[i].homedir,
info[i].shell);
} else {
printf("%d:%s\n", uids[i], nt_errstr(info[i].status));
printf("%llu:%s\n", uids[i], nt_errstr(info[i].status));
}
}

View File

@ -35,6 +35,7 @@ raw="$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH"
rpc="RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY"
rpc="$rpc RPC-SAMBA3-SRVSVC RPC-SAMBA3-GETUSERNAME RPC-SAMBA3-SHARESEC"
rpc="$rpc RPC-UNIXINFO"
tests="$base $raw $rpc"

View File

@ -26,23 +26,6 @@
static int pong_count;
/* samba4 timeval functions */
double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2)
{
return (tv2->tv_sec - tv1->tv_sec) +
(tv2->tv_usec - tv1->tv_usec)*1.0e-6;
}
/**
return the number of seconds elapsed since a given time
*/
double timeval_elapsed(const struct timeval *tv)
{
struct timeval tv2 = timeval_current();
return timeval_elapsed2(tv, &tv2);
}
/****************************************************************************
a useful function for testing the message system
****************************************************************************/

View File

@ -462,7 +462,7 @@ NTSTATUS rpc_info_internals(const DOM_SID *domain_sid,
TALLOC_CTX *ctx = talloc_init("rpc_info_internals");
d_printf("Domain Name: %s\n", unistr2_tdup(ctx, &ctr.info.inf2.uni_domain));
d_printf("Domain SID: %s\n", sid_str);
d_printf("Sequence number: %u\n", ctr.info.inf2.seq_num.low);
d_printf("Sequence number: %llu\n", ctr.info.inf2.seq_num);
d_printf("Num users: %u\n", ctr.info.inf2.num_domain_usrs);
d_printf("Num domain groups: %u\n", ctr.info.inf2.num_domain_grps);
d_printf("Num local groups: %u\n", ctr.info.inf2.num_local_grps);

View File

@ -42,44 +42,6 @@ static void display_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *g)
d_printf("\n");
}
static const char *display_time(const UINT64_S *nttime)
{
static fstring string;
float high;
float low;
int sec;
int days, hours, mins, secs;
int offset = 1;
if (nttime->high==0 && nttime->low==0)
return "Now";
if (nttime->high==0x80000000 && nttime->low==0)
return "Never";
high = 65536;
high = high/10000;
high = high*65536;
high = high/1000;
high = high * (~nttime->high);
low = ~nttime->low;
low = low/(1000*1000*10);
sec=high+low;
sec+=offset;
days=sec/(60*60*24);
hours=(sec - (days*60*60*24)) / (60*60);
mins=(sec - (days*60*60*24) - (hours*60*60) ) / 60;
secs=sec - (days*60*60*24) - (hours*60*60) - (mins*60);
fstr_sprintf(string, "%u days, %u hours, %u minutes, %u seconds", days, hours, mins, secs);
return (string);
}
static void display_alias_info(uint32 rid, SAM_ALIAS_INFO *a)
{
d_printf("Alias '%s' ", unistr2_static(&a->uni_als_name));
@ -123,11 +85,10 @@ static void display_account_info(uint32 rid, SAM_ACCOUNT_INFO *a)
pdb_encode_acct_ctrl(a->acb_info, NEW_PW_FORMAT_SPACE_PADDED_LEN));
}
static time_t uint64s_nt_time_to_unix_abs(const UINT64_S *src)
static time_t uint64s_nt_time_to_unix_abs(const uint64 *src)
{
NTTIME nttime;
nttime.high = src->high;
nttime.low = src->low;
nttime = *src;
return nt_time_to_unix_abs(&nttime);
}
@ -144,11 +105,11 @@ static void display_domain_info(SAM_DOMAIN_INFO *a)
d_printf("Force Logoff: %d\n", (int)u_logout);
d_printf("Max Password Age: %s\n", display_time(&a->max_pwd_age));
d_printf("Min Password Age: %s\n", display_time(&a->min_pwd_age));
d_printf("Max Password Age: %s\n", display_time(a->max_pwd_age));
d_printf("Min Password Age: %s\n", display_time(a->min_pwd_age));
d_printf("Lockout Time: %s\n", display_time(&a->account_lockout.lockout_duration));
d_printf("Lockout Reset Time: %s\n", display_time(&a->account_lockout.reset_count));
d_printf("Lockout Time: %s\n", display_time(a->account_lockout.lockout_duration));
d_printf("Lockout Reset Time: %s\n", display_time(a->account_lockout.reset_count));
d_printf("Bad Attempt Lockout: %d\n", a->account_lockout.bad_attempt_lockout);
d_printf("User must logon to change password: %d\n", a->logon_chgpass);
@ -420,14 +381,14 @@ static NTSTATUS sam_account_from_delta(struct samu *account, SAM_ACCOUNT_INFO *d
/* Logon and password information */
if (!nt_time_is_zero(&delta->logon_time)) {
unix_time = nt_time_to_unix(&delta->logon_time);
unix_time = nt_time_to_unix(delta->logon_time);
stored_time = pdb_get_logon_time(account);
if (stored_time != unix_time)
pdb_set_logon_time(account, unix_time, PDB_CHANGED);
}
if (!nt_time_is_zero(&delta->logoff_time)) {
unix_time = nt_time_to_unix(&delta->logoff_time);
unix_time = nt_time_to_unix(delta->logoff_time);
stored_time = pdb_get_logoff_time(account);
if (stored_time != unix_time)
pdb_set_logoff_time(account, unix_time,PDB_CHANGED);
@ -463,7 +424,7 @@ static NTSTATUS sam_account_from_delta(struct samu *account, SAM_ACCOUNT_INFO *d
pdb_set_logon_count(account, delta->logon_count, PDB_CHANGED);
if (!nt_time_is_zero(&delta->pwd_last_set_time)) {
unix_time = nt_time_to_unix(&delta->pwd_last_set_time);
unix_time = nt_time_to_unix(delta->pwd_last_set_time);
stored_time = pdb_get_pass_last_set_time(account);
if (stored_time != unix_time)
pdb_set_pass_last_set_time(account, unix_time, PDB_CHANGED);
@ -1632,7 +1593,7 @@ static NTSTATUS fetch_account_info_to_ldif(SAM_DELTA_CTR *delta,
} else {
pdb_sethexpwd(hex_nt_passwd, NULL, 0);
}
unix_time = nt_time_to_unix(&(delta->account_info.pwd_last_set_time));
unix_time = nt_time_to_unix(delta->account_info.pwd_last_set_time);
/* The nobody user is entered by populate_ldap_for_ldif */
if (strcmp(username, "nobody") == 0) {