summaryrefslogtreecommitdiff
path: root/source3/smbd/password.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-10-29 07:28:32 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-10-29 07:28:32 +0000
commit2038649e51f48a489aeec49947e1b791f0b3df43 (patch)
treeb3df7e09c5d563306f9a1b359a4b2579829b1a01 /source3/smbd/password.c
parent0db1899256517507fb5a441bd75725e3fcecc2e8 (diff)
downloadsamba-2038649e51f48a489aeec49947e1b791f0b3df43.tar.gz
samba-2038649e51f48a489aeec49947e1b791f0b3df43.tar.bz2
samba-2038649e51f48a489aeec49947e1b791f0b3df43.zip
This commit is number 3 of 4.
In particular this commit focuses on: Changing the Get_Pwnam code so that it can work in a const-enforced environment. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes allow for 'const' in the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username (This used to be commit e7634f81c5116ff4addfb7e495f54b6bb78e8f77)
Diffstat (limited to 'source3/smbd/password.c')
-rw-r--r--source3/smbd/password.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index b1739d9bb6..e8f40f1fa3 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -276,7 +276,7 @@ void add_session_user(char *user)
fstring suser;
StrnCpy(suser,user,sizeof(suser)-1);
- if (!Get_Pwnam(suser,True)) return;
+ if (!Get_Pwnam_Modify(suser)) return;
if (suser && *suser && !in_list(suser,session_users,False))
{
@@ -551,7 +551,7 @@ and given password ok (%s)\n", user));
if (!ok && GUEST_OK(snum)) {
fstring guestname;
StrnCpy(guestname,lp_guestaccount(snum),sizeof(guestname)-1);
- if (Get_Pwnam(guestname,True)) {
+ if (Get_Pwnam(guestname)) {
fstrcpy(user,guestname);
ok = True;
DEBUG(3,("authorise_login: ACCEPTED: guest account and guest ok (%s)\n",