problems with samba 2.1.0-prealpha

Matthias Wächter matthias at waechter.wol.at
Fri Sep 3 11:23:07 GMT 1999


On Fri, 3 Sep 1999, Matthias Keller wrote:

> but now, i'm not able to use swat. when i try to log
> in as root with the correct smb-password, i get
> access denied.

Swat can't authorize in 2.1 when SHADOW passwords are used. Problem is
passdb/pass_check.c, pass_check() not supporting SHADOW passwords (kind of
brain-dead...).

That diff should fix it. It's from my July CVS download, but I tend to say
the file didn't change very much.

--- old/pass_check.c	Sun Jun 13 06:14:23 1999
+++ pass_check.c	Tue Jul 27 00:54:49 1999
@@ -785,9 +785,73 @@
 		return(False);
 	}
 
+#ifdef HAVE_GETSPNAM
+        {
+                struct spwd *spass;
+
+                /* many shadow systems require you to be root to get
+                   the password, in most cases this should already be
+                   the case when this function is called, except
+                   perhaps for IPC password changing requests */
+
+                spass = getspnam(pass->pw_name);
+                if (spass && spass->sp_pwdp) {
+                        pass->pw_passwd = spass->sp_pwdp;
+                }
+        }
+#elif defined(IA_UINFO)
+        {
+                /* Need to get password with SVR4.2's ia_ functions
+                   instead of get{sp,pw}ent functions. Required by
+                   UnixWare 2.x, tested on version
+                   2.1. (tangent at cyberport.com) */
+                uinfo_t uinfo;
+                if (ia_openinfo(pass->pw_name, &uinfo) != -1) {
+                        ia_get_logpwd(uinfo, &(pass->pw_passwd));
+                }
+        }
+#endif
+
+#ifdef HAVE_GETPRPWNAM
+        {
+                struct pr_passwd *pr_pw = getprpwnam(pass->pw_name);
+                if (pr_pw && pr_pw->ufld.fd_encrypt)
+                        pass->pw_passwd = pr_pw->ufld.fd_encrypt;
+        }
+#endif
+
+#ifdef OSF1_ENH_SEC
+        {
+                struct pr_passwd *mypasswd;
+                DEBUG(5,("Checking password for user %s in OSF1_ENH_SEC\n",
+                         user));
+                mypasswd = getprpwnam (user);
+                if (mypasswd) {
+                        fstrcpy(pass->pw_name,mypasswd->ufld.fd_name);
+                        fstrcpy(pass->pw_passwd,mypasswd->ufld.fd_encrypt);
+                } else {
+                        DEBUG(5,("OSF1_ENH_SEC: No entry for user %s in protected database !\n",
+                                 user));
+                }
+        }
+#endif
+
+#ifdef ULTRIX_AUTH
+        {
+                AUTHORIZATION *ap = getauthuid(pass->pw_uid);
+                if (ap) {
+                        fstrcpy(pass->pw_passwd, ap->a_password);
+                        endauthent();
+                }
+        }
+#endif
+
 	/* extract relevant info */
 	fstrcpy(this_user,pass->pw_name);  
 	fstrcpy(this_salt,pass->pw_passwd);

Sehr Wus,
- Matthias

-- 
Verkauft für 339,88 Dollar!
	- aus: Groundhog Day (Und täglich grüßt das Murmeltier)
-----------------------------------------------------------------------------




More information about the samba-ntdom mailing list