diff options
author | Günther Deschner <gd@samba.org> | 2005-07-12 23:02:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:00:04 -0500 |
commit | 36f0225e5f5aa4987e0d759fdd62a7a6b95b31b3 (patch) | |
tree | 6a755d652edcee9577276dc01e259dc2a128140a /source3 | |
parent | 1d4eb573239224b2886d1e066d544af31c29ce1f (diff) | |
download | samba-36f0225e5f5aa4987e0d759fdd62a7a6b95b31b3.tar.gz samba-36f0225e5f5aa4987e0d759fdd62a7a6b95b31b3.tar.bz2 samba-36f0225e5f5aa4987e0d759fdd62a7a6b95b31b3.zip |
r8396: fix some compile warnings.
Guenther
(This used to be commit af1aa09cde91078496a29f3a73c69a65ca2c3f6a)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index dd3364dfcb..0c8698a8c2 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -436,7 +436,7 @@ sam_account_from_delta(SAM_ACCOUNT *account, SAM_ACCOUNT_INFO *delta) pdb_sethexhours(oldstr, pdb_get_hours(account)); pdb_sethexhours(newstr, delta->buf_logon_hrs.buffer); if (!strequal(oldstr, newstr)) - pdb_set_hours(account, (const char *)delta->buf_logon_hrs.buffer, PDB_CHANGED); + pdb_set_hours(account, (const uint8 *)delta->buf_logon_hrs.buffer, PDB_CHANGED); } if (pdb_get_bad_password_count(account) != delta->bad_pwd_count) @@ -1716,7 +1716,7 @@ fetch_account_info_to_ldif(SAM_DELTA_CTR *delta, GROUPMAP *groupmap, fprintf(add_fd, "sambaLMPassword: %s\n", hex_lm_passwd); if (strcmp(nopasswd, hex_nt_passwd) != 0) fprintf(add_fd, "sambaNTPassword: %s\n", hex_nt_passwd); - fprintf(add_fd, "sambaPwdLastSet: %d\n", unix_time); + fprintf(add_fd, "sambaPwdLastSet: %d\n", (int)unix_time); fprintf(add_fd, "sambaAcctFlags: %s\n", flags); fprintf(add_fd, "\n"); fflush(add_fd); @@ -1871,11 +1871,18 @@ fetch_database_to_ldif(struct cli_state *cli, unsigned db_type, /* Array element is the account rid */ ACCOUNTMAP *accountmap = NULL; + if (!(mem_ctx = talloc_init("fetch_database"))) { + return NT_STATUS_NO_MEMORY; + } + /* Ensure we have an output file */ if (user_file) - ldif_file = user_file; + ldif_file = talloc_strdup(mem_ctx, user_file); else - ldif_file = "/tmp/tmp.ldif"; + ldif_file = talloc_strdup(mem_ctx, "/tmp/tmp.ldif"); + + if (ldif_file == NULL) + return NT_STATUS_NO_MEMORY; /* Open the add and mod ldif files */ add_fd = fopen(add_ldif, "a"); @@ -1892,10 +1899,6 @@ fetch_database_to_ldif(struct cli_state *cli, unsigned db_type, return NT_STATUS_UNSUCCESSFUL; } - if (!(mem_ctx = talloc_init("fetch_database"))) { - return NT_STATUS_NO_MEMORY; - } - /* Get the sid */ sid_to_string(sid, &dom_sid); |