summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-08-21 22:13:45 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-08-21 22:13:45 +0000
commit00b7fa8951aa7c101a541847f5ef29318aec03f6 (patch)
treef453f6b822946704c10e5290cff571a53993af78 /source3
parent9abf0703b13c4d7547f2d5dbab86405cd401b7da (diff)
downloadsamba-00b7fa8951aa7c101a541847f5ef29318aec03f6.tar.gz
samba-00b7fa8951aa7c101a541847f5ef29318aec03f6.tar.bz2
samba-00b7fa8951aa7c101a541847f5ef29318aec03f6.zip
More hacks for 'guest account' to get it to show up with the right rid...
Andrew Bartlett (This used to be commit 2795d92268d23063faf5a661279a91f7703d8aac)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_smbpasswd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index d40ea03511..04c0d333e4 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -1327,7 +1327,8 @@ static BOOL smbpasswd_getsampwent(struct pdb_methods *my_methods, SAM_ACCOUNT *u
call getpwnam() for unix account information until we have found
the correct entry
***************************************************************/
-static BOOL smbpasswd_getsampwnam(struct pdb_methods *my_methods, SAM_ACCOUNT *sam_acct, const char *username)
+static BOOL smbpasswd_getsampwnam(struct pdb_methods *my_methods,
+ SAM_ACCOUNT *sam_acct, const char *username)
{
struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
struct smb_passwd *smb_pw;
@@ -1381,6 +1382,16 @@ static BOOL smbpasswd_getsampwrid(struct pdb_methods *my_methods, SAM_ACCOUNT *s
DEBUG(10, ("pdb_getsampwrid: search by rid: %d\n", rid));
+ /* More special case 'guest account' hacks... */
+ if (rid == DOMAIN_USER_RID_GUEST) {
+ const char *guest_account = lp_guestaccount();
+ if (!(guest_account && *guest_account)) {
+ DEBUG(1, ("Guest account not specfied!\n"));
+ return False;
+ }
+ return smbpasswd_getsampwnam(my_methods, sam_acct, guest_account);
+ }
+
/* Open the sam password file - not for update. */
fp = startsmbfilepwent(smbpasswd_state->smbpasswd_file, PWF_READ, &(smbpasswd_state->pw_file_lock_depth));