samba compile prob.

Hans Insulander hin at stacken.kth.se
Mon Sep 4 22:37:30 CEST 2000


Tom Vaughan <tom at vaughan.to> writes:

> > Look in the Samba password verification code and make sure something
> > like this is run somewhere:
> > 
> > if(k_hasafs()) {
> >         ...
> >         k_setpag();
> >         ...
> >         krb_afslog(...);
> >         ...
> > }
> > 
> 
> Uh oh.
> 
> nutrimatic# pwd
> /exhome/tvaughan/local/src/samba-2.0.7/source
> nutrimatic# find . -name "*.[ch]" -print | xargs grep -n k_hasafs
> nutrimatic# find . -name "*.[ch]" -print | xargs grep -n k_setpag
> nutrimatic# 

Oh, so they've removed that functinality. How splendid...

Here's a completely untested patch that "should" work... It's not
 perfect but i believe it will work. Try it!

The problem you may run into is that one really should destroy the token
somewhere in the code. I have no clue where that would be. The samba team
seems to have restructured the code completely since the last time i was
mucking around with it... (using atexit() would be an ugly solution)

If you can find a suitable spot in the code, insert these two lines:
        if (k_hasafs())
            k_unlog();
That would be someplace that will be executed when a user logs out and the
smb process exits.


And here's the patch that _should_ make the smb process authenticated:

--- samba-2.0.7/source/passdb/pass_check.c.orig	Mon Sep  4 22:18:55 2000
+++ samba-2.0.7/source/passdb/pass_check.c	Mon Sep  4 22:21:04 2000
@@ -559,6 +559,10 @@
 			    password, 0,
 			    "rmcd") == KSUCCESS) {
 		unlink(tkfile);
+		if(k_hasafs()) {
+		    k_setpag();
+		    krb_afslog(0, 0);
+		}
 		return 1;
 	}
 	unlink(tkfile);

This patch could be a bit smarter about checking _what_ cell{,s} the
user should be authenticated in. When i get a Milko cell at home i might
be able to fix that too...

If you get it to work, and solve the kdestroy issue above, please mail patches
to the Samba team.

-- 
--- Hans Insulander <hin at stacken.kth.se>, SM0UTY -----------------------
Gravity never looses. The best you can hope for is a draw.





More information about the Arla-drinkers mailing list