Remove const from some functions to match the changed prototype in a
authorAndrew Bartlett <abartlet@samba.org>
Sat, 18 May 2002 09:32:59 +0000 (09:32 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 18 May 2002 09:32:59 +0000 (09:32 +0000)
previous commit, and remove some unsued variables.

Main change:  Make sure to fill in the username when making a non-unix
account from smbpasswd.
(This used to be commit 7019486eacb72ca44c42ce620b8696bb29f12292)

source3/passdb/pdb_ldap.c
source3/passdb/pdb_smbpasswd.c

index 9614483ee1e0c5c5688fc360a971c11fffe64591..e10dc73d0b33b1d670e9bf0a0bf72917a4f698a6 100644 (file)
@@ -1187,7 +1187,7 @@ static BOOL ldapsam_getsampwrid(struct pdb_methods *my_methods, SAM_ACCOUNT * us
 /**********************************************************************
 Delete entry from LDAP for username 
 *********************************************************************/
 /**********************************************************************
 Delete entry from LDAP for username 
 *********************************************************************/
-static BOOL ldapsam_delete_sam_account(struct pdb_methods *my_methods, const SAM_ACCOUNT * sam_acct)
+static BOOL ldapsam_delete_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT * sam_acct)
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        const char *sname;
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        const char *sname;
@@ -1247,7 +1247,7 @@ static BOOL ldapsam_delete_sam_account(struct pdb_methods *my_methods, const SAM
 /**********************************************************************
 Update SAM_ACCOUNT 
 *********************************************************************/
 /**********************************************************************
 Update SAM_ACCOUNT 
 *********************************************************************/
-static BOOL ldapsam_update_sam_account(struct pdb_methods *my_methods, const SAM_ACCOUNT * newpwd)
+static BOOL ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT * newpwd)
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        int rc;
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        int rc;
@@ -1314,7 +1314,7 @@ static BOOL ldapsam_update_sam_account(struct pdb_methods *my_methods, const SAM
 /**********************************************************************
 Add SAM_ACCOUNT to LDAP 
 *********************************************************************/
 /**********************************************************************
 Add SAM_ACCOUNT to LDAP 
 *********************************************************************/
-static BOOL ldapsam_add_sam_account(struct pdb_methods *my_methods, const SAM_ACCOUNT * newpwd)
+static BOOL ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT * newpwd)
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        int rc;
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        int rc;
index f7ab6f307035a6d8b08e615a628da974a13be9b3..e2050627e1d613e5ca4e943e718c872ef4f3ac8b 100644 (file)
@@ -1248,7 +1248,8 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state,
                   a general default for non-unix users. --abartlet 2002-01-08
                */
                pdb_set_group_rid (sam_pass, DOMAIN_GROUP_RID_USERS); 
                   a general default for non-unix users. --abartlet 2002-01-08
                */
                pdb_set_group_rid (sam_pass, DOMAIN_GROUP_RID_USERS); 
-               
+               pdb_set_username (sam_pass, pw_buf->smb_name);
+               pdb_set_domain (sam_pass, lp_workgroup());
        } else {
 
                pwfile = getpwnam_alloc(pw_buf->smb_name);
        } else {
 
                pwfile = getpwnam_alloc(pw_buf->smb_name);
@@ -1367,9 +1368,6 @@ static BOOL smbpasswd_getsampwnam(struct pdb_methods *my_methods, SAM_ACCOUNT *s
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
        struct smb_passwd *smb_pw;
        void *fp = NULL;
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
        struct smb_passwd *smb_pw;
        void *fp = NULL;
-       char *domain = NULL;
-       char *user = NULL;
-       fstring name;
 
        DEBUG(10, ("getsampwnam (smbpasswd): search by name: %s\n", username));
 
 
        DEBUG(10, ("getsampwnam (smbpasswd): search by name: %s\n", username));
 
@@ -1456,7 +1454,7 @@ static BOOL smbpasswd_getsampwrid(struct pdb_methods *my_methods, SAM_ACCOUNT *s
        return True;
 }
 
        return True;
 }
 
-static BOOL smbpasswd_add_sam_account(struct pdb_methods *my_methods, const SAM_ACCOUNT *sampass)
+static BOOL smbpasswd_add_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT *sampass)
 {
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
        struct smb_passwd smb_pw;
 {
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
        struct smb_passwd smb_pw;
@@ -1474,7 +1472,7 @@ static BOOL smbpasswd_add_sam_account(struct pdb_methods *my_methods, const SAM_
        return True;
 }
 
        return True;
 }
 
-static BOOL smbpasswd_update_sam_account(struct pdb_methods *my_methods, const SAM_ACCOUNT *sampass)
+static BOOL smbpasswd_update_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT *sampass)
 {
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
        struct smb_passwd smb_pw;
 {
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
        struct smb_passwd smb_pw;
@@ -1494,7 +1492,7 @@ static BOOL smbpasswd_update_sam_account(struct pdb_methods *my_methods, const S
        return True;
 }
 
        return True;
 }
 
-static BOOL smbpasswd_delete_sam_account (struct pdb_methods *my_methods, const SAM_ACCOUNT *sampass)
+static BOOL smbpasswd_delete_sam_account (struct pdb_methods *my_methods, SAM_ACCOUNT *sampass)
 {
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
 
 {
        struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;