summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c10
-rw-r--r--source3/passdb/smbpass.c8
-rw-r--r--source3/passdb/smbpasschange.c2
-rw-r--r--source3/passdb/smbpassfile.c4
-rw-r--r--source3/passdb/smbpassgroup.c5
5 files changed, 14 insertions, 15 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index a4c663e388..da45f15f5f 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -548,7 +548,7 @@ char *pwdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length)
15 lines, which is more important.
**********************************************************/
-uint16 pwdb_decode_acct_ctrl(char *p)
+uint16 pwdb_decode_acct_ctrl(const char *p)
{
uint16 acct_ctrl = 0;
BOOL finished = False;
@@ -591,7 +591,7 @@ uint16 pwdb_decode_acct_ctrl(char *p)
gets password-database-format time from a string.
********************************************************************/
-static time_t get_time_from_string(char *p)
+static time_t get_time_from_string(const char *p)
{
int i;
@@ -609,7 +609,7 @@ static time_t get_time_from_string(char *p)
* read into a time_t as the seconds since
* 1970 that the password was last changed.
*/
- return (time_t)strtol((char *)p, NULL, 16);
+ return (time_t)strtol(p, NULL, 16);
}
return (time_t)-1;
}
@@ -618,9 +618,9 @@ static time_t get_time_from_string(char *p)
gets password last set time
********************************************************************/
-time_t pwdb_get_last_set_time(char *p)
+time_t pwdb_get_last_set_time(const char *p)
{
- if (*p && StrnCaseCmp((char *)p, "LCT-", 4))
+ if (*p && StrnCaseCmp(p, "LCT-", 4))
{
return get_time_from_string(p + 4);
}
diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c
index bdf01ee6a8..67f8ea6cfb 100644
--- a/source3/passdb/smbpass.c
+++ b/source3/passdb/smbpass.c
@@ -118,14 +118,14 @@ static struct smb_passwd *getsmbfilepwent(void *vp)
* As 256 is shorter than a pstring we don't need to check
* length here - if this ever changes....
*/
- p = strncpyn(user_name, linebuf, sizeof(user_name), ':');
+ p = (unsigned char *)strncpyn(user_name, linebuf, sizeof(user_name), ':');
/* Go past ':' */
p++;
/* Get smb uid. */
- p = Atoic((char *) p, &uidval, ":");
+ p = (unsigned char *)Atoic((char *) p, &uidval, ":");
pw_buf.smb_name = user_name;
pw_buf.smb_userid = uidval;
@@ -218,7 +218,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp)
if (*p == ':')
{
p++;
- pw_buf.pass_last_set_time = pwdb_get_last_set_time(p);
+ pw_buf.pass_last_set_time = pwdb_get_last_set_time((char *)p);
}
}
else
@@ -522,7 +522,7 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override)
}
DEBUG(10, ("mod_smbfilepwd_entry: opening file %s\n", pfile));
- fp = fopen(pfile, "r+");
+ fp = sys_fopen(pfile, "r+");
if (fp == NULL) {
DEBUG(0, ("mod_smbfilepwd_entry: unable to open file %s\n", pfile));
diff --git a/source3/passdb/smbpasschange.c b/source3/passdb/smbpasschange.c
index 71bfc65f84..1a3c100fa5 100644
--- a/source3/passdb/smbpasschange.c
+++ b/source3/passdb/smbpasschange.c
@@ -93,7 +93,7 @@ account without a valid system user.\n", user_name);
FILE *fp;
slprintf(msg_str,msg_str_len-1,
"smbpasswd file did not exist - attempting to create it.\n");
- fp = fopen(lp_smb_passwd_file(), "w");
+ fp = sys_fopen(lp_smb_passwd_file(), "w");
if (fp) {
fprintf(fp, "# Samba SMB password file\n");
fclose(fp);
diff --git a/source3/passdb/smbpassfile.c b/source3/passdb/smbpassfile.c
index a50bc93eac..51eb799fc2 100644
--- a/source3/passdb/smbpassfile.c
+++ b/source3/passdb/smbpassfile.c
@@ -66,9 +66,9 @@ BOOL trust_password_lock( char *domain, char *name, BOOL update)
get_trust_account_file_name( domain, name, mac_file);
- if((mach_passwd_fp = fopen(mac_file, "r+b")) == NULL) {
+ if((mach_passwd_fp = sys_fopen(mac_file, "r+b")) == NULL) {
if(errno == ENOENT && update) {
- mach_passwd_fp = fopen(mac_file, "w+b");
+ mach_passwd_fp = sys_fopen(mac_file, "w+b");
}
if(mach_passwd_fp == NULL) {
diff --git a/source3/passdb/smbpassgroup.c b/source3/passdb/smbpassgroup.c
index 9454becc99..f3a0d4244b 100644
--- a/source3/passdb/smbpassgroup.c
+++ b/source3/passdb/smbpassgroup.c
@@ -77,9 +77,8 @@ static struct smb_passwd *getsmbfilegrpent(void *vp,
static pstring user_name;
struct passwd *pwfile;
pstring linebuf;
- unsigned char *p;
+ char *p;
int uidval;
- size_t linebuf_len;
if (vp == NULL)
{
@@ -92,7 +91,7 @@ static struct smb_passwd *getsmbfilegrpent(void *vp,
/*
* Scan the file, a line at a time.
*/
- while ((linebuf_len = getfileline(vp, linebuf, sizeof(linebuf))) > 0)
+ while (getfileline(vp, linebuf, sizeof(linebuf)) > 0)
{
/*
* The line we have should be of the form :-