summaryrefslogtreecommitdiffstats
path: root/source/libads
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-10-01 13:10:57 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-10-01 13:10:57 +0000
commit83973c389355a5cc9ca74af467dfd8b5dabd2c8f (patch)
treebe71e8fe529dbe83e457a0951e141e2d8922643b /source/libads
parentd8d351eb01ea7c84828dbc96224d7b13d643b558 (diff)
downloadsamba-83973c389355a5cc9ca74af467dfd8b5dabd2c8f.tar.gz
samba-83973c389355a5cc9ca74af467dfd8b5dabd2c8f.tar.xz
samba-83973c389355a5cc9ca74af467dfd8b5dabd2c8f.zip
Updates from Samba HEAD:
- Fix segfaults in the 'net ads' commands when no password is provided - Readd --with-ldapsam for 2.2 compatability. This conditionally compiles the old options, but the actual code is available on all ldap systems. - Fix shadow passwords (as per work with vl) - Fix sending plaintext passwords to unicode servers (again vl) - Add a bit of const to secrets.c functions - Fix some spelling and grammer by vance. - Document the -r option in smbgroupedit. There are more changes in HEAD, I'm only merging the changes I've been involved with. Andrew Bartlett
Diffstat (limited to 'source/libads')
-rw-r--r--source/libads/kerberos.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index a80837cf4df..b586d842262 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -114,7 +114,14 @@ int ads_kinit_password(ADS_STRUCT *ads)
char *s;
int ret;
- asprintf(&s, "%s@%s", ads->auth.user_name, ads->auth.realm);
+ if (asprintf(&s, "%s@%s", ads->auth.user_name, ads->auth.realm) == -1) {
+ return KRB5_CC_NOMEM;
+ }
+
+ if (!ads->auth.password) {
+ return KRB5_LIBOS_CANTREADPWD;
+ }
+
ret = kerberos_kinit_password(s, ads->auth.password, ads->auth.time_offset);
if (ret) {