1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-29 11:21:54 +03:00
Commit Graph

18 Commits

Author SHA1 Message Date
Günther Deschner
04f8c229de s3-kerberos: only use krb5 headers where required.
This seems to be the only way to deal with mixed heimdal/MIT setups during
merged build.

Guenther
2009-11-27 16:36:00 +01:00
Günther Deschner
660ee2e745 cifs.upcall: 2nd part of fix for Bug #6868: support building with Heimdal we well as with MIT.
Guenther
2009-11-25 17:58:52 +01:00
Günther Deschner
b29eed492f cifs.upcall: Fix Bug #6868: support building with Heimdal we well as with MIT.
Guenther
2009-11-12 10:22:39 +01:00
Günther Deschner
60bf0eb607 s3-kerberos: modify cli_krb5_get_ticket to take a new impersonate_princ_s arg.
Guenther
2009-11-06 13:31:17 +01:00
Günther Deschner
c708338682 cifs-upcall: fix the build after spnego merge.
Guenther
2009-09-17 08:53:29 +02:00
Jeff Layton
704b739ad8 cifs.upcall: do a brute-force search for KRB5 credcache
A few weeks ago, I added some code to cifs.upcall to take the pid sent
by the kernel and use that to get the value of the $KRB5CCNAME
environment var for the process. That works fine on the initial mount,
but could be problematic on reconnect.

There's no guarantee on a reconnect that the process that initiates the
upcall will have $KRB5CCNAME pointed at the correct credcache. Because
of this, the current scheme isn't going to be reliable enough and we
need to use something different.

This patch replaces that scheme with one very similar to the one used by
rpc.gssd in nfs-utils. It searches the credcache dir (currently
hardcoded to /tmp) for a valid credcache for the given uid. If it finds
one then it uses that as the credentials cache. If it finds more than
one, it uses the one with the latest TGT expiration.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-09-04 06:29:44 -04:00
Jeff Layton
da99e3a724 cifs.upcall: make using ip address conditional on new option
Igor Mammedov pointed out that reverse resolving an IP address to get
the hostname portion of a principal could open a possible attack
vector. If an attacker were to gain control of DNS, then he could
redirect the mount to a server of his choosing, and fix the reverse
resolution to point to a hostname of his choosing (one where he has
the key for the corresponding cifs/ or host/ principal).

That said, we often trust DNS for other reasons and it can be useful
to do so. Make the code that allows trusting DNS to be enabled by
adding --trust-dns to the cifs.upcall invocation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-26 06:26:02 -04:00
Jeff Layton
3544e685ad cifs.upcall: switch to getopt_long
...to allow long option names.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-26 06:15:42 -04:00
Jeff Layton
19553e1552 cifs.upcall: fix IPv6 addrs sent to upcall to have colon delimiters
Current kernels don't send IPv6 addresses with the colon delimiters, add
a routine to add them when they're not present.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:51 -04:00
Jeff Layton
2f95ccc1e2 cifs.upcall: use ip address passed by kernel to get server's hostname
Instead of using the hostname given by the upcall to get the server's
principal, take the IP address given in the upcall and reverse resolve
it to a hostname.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:50 -04:00
Jeff Layton
acbf026012 cifs.upcall: clean up flag handling
Add a new stack var to hold the flags returned by the decoder routine
so that we don't need to worry so much about preserving "rc".

With this, we can drop privs before trying to find the location of
the credcache.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:50 -04:00
Jeff Layton
b10bdef4e7 cifs.upcall: try getting a "cifs/" principal and fall back to "host/"
cifs.upcall takes a "-c" flag that tells the upcall to get a principal
in the form of "cifs/hostname.example.com@REALM" instead of
"host/hostname.example.com@REALM". This has turned out to be a source of
great confusion for users.

Instead of requiring this flag, have the upcall try to get a "cifs/"
principal first. If that fails, fall back to getting a "host/"
principal.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:50 -04:00
Jeff Layton
750ceb8239 cifs.upcall: declare a structure for holding decoded args
The argument list for the decoder is becoming rather long. Declare an
args structure and use that for holding the args. This also simplifies
pointer handling a bit.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:49 -04:00
Jeff Layton
685fdc33d7 cifs.upcall: formatting cleanup
Clean up some unneeded curly braces, and fix some indentation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:49 -04:00
Jeff Layton
378a2d9aa5 cifs.upcall: clean up logging and add debug messages
Change the log levels to be more appropriate to the messages being
logged. Error messages should be LOG_ERR and not LOG_WARNING, for
instance.

Add some LOG_DEBUG messages that we can use to diagnose problems with
krb5 upcalls. With these, someone can set up syslog to log daemon.debug
and should be able to get more info when things aren't working.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-08-14 07:59:49 -04:00
Volker Lendecke
db1e582568 Attempt to fix the build -- jlayton, please check! 2009-07-10 12:00:11 +02:00
Jeff Layton
8d1b061b51 cifs.upcall: use pid value from kernel to determine KRB5CCNAME to use
If the kernel sends the upcall a pid of the requesting process, we can
open that process' /proc/<pid>/environ file and scrape the KRB5CCNAME
value out of it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-07-09 21:04:08 -04:00
Jelmer Vernooij
8d033ec0d1 Move mount.cifs/umount.cifs to the top level and remove the outdated copy
in Samba 4.
2009-06-02 23:24:33 +02:00