struct smb_passwd
{
- uint32 smb_userid; /* this is actually the unix uid_t */
+ uint32_t smb_userid; /* this is actually the unix uid_t */
const char *smb_name; /* username string */
const unsigned char *smb_passwd; /* Null if no password */
fstring user_name;
char *status;
- char linebuf[256];
+#define LINEBUF_SIZE 255
+ char linebuf[LINEBUF_SIZE + 1];
char readbuf[1024];
int c;
fstring ascii_p16;
linebuf[0] = '\0';
- status = fgets(linebuf, sizeof(linebuf), fp);
+ status = fgets(linebuf, LINEBUF_SIZE, fp);
if (status == NULL && ferror(fp)) {
pw_file_unlock(lockfd, &smbpasswd_state->pw_file_lock_depth);
fclose(fp);
#ifdef DEBUG_PASSWORD
DEBUG(100,("mod_smbfilepwd_entry: "));
- dump_data(100, (uint8 *)ascii_p16, wr_len);
+ dump_data(100, (uint8_t *)ascii_p16, wr_len);
#endif
- if(wr_len > sizeof(linebuf)) {
+ if(wr_len > LINEBUF_SIZE) {
DEBUG(0, ("mod_smbfilepwd_entry: line to write (%d) is too long.\n", wr_len+1));
pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth);
fclose(fp);
/* If the user specified a RID, make sure its able to be both stored and retreived */
if (rid == DOMAIN_RID_GUEST) {
- struct passwd *passwd = Get_Pwnam_alloc(NULL, lp_guestaccount());
+ struct passwd *passwd = Get_Pwnam_alloc(NULL, lp_guest_account());
if (!passwd) {
- DEBUG(0, ("Could not find guest account via Get_Pwnam_alloc()! (%s)\n", lp_guestaccount()));
+ DEBUG(0, ("Could not find guest account via Get_Pwnam_alloc()! (%s)\n", lp_guest_account()));
return False;
}
smb_pw->smb_userid=passwd->pw_uid;
/* More special case 'guest account' hacks... */
if (rid == DOMAIN_RID_GUEST) {
- const char *guest_account = lp_guestaccount();
+ const char *guest_account = lp_guest_account();
if (!(guest_account && *guest_account)) {
DEBUG(1, ("Guest account not specfied!\n"));
return nt_status;
TALLOC_CTX *ctx = talloc_tos();
NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
- if (!*(lp_renameuser_script()))
+ if (!*(lp_rename_user_script(talloc_tos())))
goto done;
if ( !(new_acct = samu_new( NULL )) ) {
interim_account = True;
/* rename the posix user */
- rename_script = talloc_strdup(ctx,
- lp_renameuser_script());
+ rename_script = lp_rename_user_script(ctx);
if (!rename_script) {
ret = NT_STATUS_NO_MEMORY;
goto done;
goto done;
}
- rename_ret = smbrun(rename_script, NULL);
+ rename_ret = smbrun(rename_script, NULL, NULL);
DEBUG(rename_ret ? 0 : 3,("Running the command `%s' gave %d\n", rename_script, rename_ret));
return NT_STATUS_OK;
}
-NTSTATUS pdb_smbpasswd_init(void)
+NTSTATUS pdb_smbpasswd_init(TALLOC_CTX *ctx)
{
return smb_register_passdb(PASSDB_INTERFACE_VERSION, "smbpasswd", pdb_init_smbpasswd);
}