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

823 Commits

Author SHA1 Message Date
Jeremy Allison
07e0094365 Fix all warnings in source3 with gcc4.3.
Jeremy.
2008-12-31 18:06:57 -08:00
Jeremy Allison
bb23f5725f Fix more asprintf and "ignoring return code" warnings from gcc 4.3.
Jeremy.
2008-12-31 16:30:11 -08:00
Volker Lendecke
32a7ecf5ce Make smbclient "put" use cli_push
This should fill the TCP socket even beyond the smbclient io_bufsize, very much
like smbclient "get" should do it since 3.2
2008-12-19 23:33:55 +01:00
Volker Lendecke
daeb3a190d Remove the global "cmdline_auth_info" from source3/lib/util.c
This involves changing all our clients, that's why it's so large.
2008-12-14 14:00:43 +01:00
Jeff Layton
9069c84907 mount.cifs: allow mounts to ipv6 capable servers
The current name resolution scheme in mount.cifs is IPv4 only. Expand
it to be protocol-independent. Also take advantage of the fact that
getaddrinfo() returns a list of addresses and have mount.cifs try each
in turn until it hits one that's reachable and allows the socket to
connect.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-12-12 07:00:38 -05:00
Steve French
420a9071e1 mount.cifs: if mount user not specified use USER environment variable
smbfs also would use the USER environment variable if the user was not
specified on the mount command and no credential file specified, and
mount.cifs man page says that we will use this environment variable
(in most cases this will not cause a behavior change, because
we were doing getuid of the current process which will usually be
the same name).

Fixes Samba bug #5934

Acked-by: Jeff Layton
2008-12-05 08:09:08 -06:00
Tim Prouty
1eb743ab8e s3: Change sockaddr util function names for consistency
Also eliminates name conflicts with OneFS system libraries
2008-12-03 10:40:20 -08:00
Jeff Layton
32695912dd mount.cifs: use lock/unlock_mtab scheme from util-linux-ng mount prog
The util-linux-ng sources have a good, but rather complex scheme for
locking the mtab before updating it. Mount helpers need to follow the
same scheme. Advisory locking only works if everyone is using the same
locking scheme.

Copy the routines we need from util-linux-ng into a separate source file
and then have mount.cifs and umount.cifs link in this object.

The long term goal is to have these routines in a separate helper
library (libmount). Mount helpers can then dynamically link in that lib.
Until that happens, this should serve as a suitable stopgap solution.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-11-06 15:07:07 -05:00
Jeremy Allison
0a6ff29e29 Fix CID: 456 - resource leak on function exit.
Jeremy.
2008-10-29 17:07:14 -07:00
Volker Lendecke
097f40249c Make use of a large buffer for smbclient put command 2008-10-23 17:46:00 +02:00
Jelmer Vernooij
2d89b52be8 Use separate make variables for libutil and libcrypto. 2008-10-18 14:28:40 +02:00
Jelmer Vernooij
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
Jeff Layton
2c9df6401c mount.cifs: make return codes match the return codes for /bin/mount (try #3)
The manpage for /bin/mount specifies that the return code should be a
positive integer (actually, it's a bitfield). Clean up the return
codes from mount.cifs to make them match the expected return values
from /bin/mount. This necessary for proper integration with autofs.

This is the third attempt at this patch. The changes here are minor,
just changing some return's from main() into exit() calls for
consistency's sake.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-10-09 09:58:40 -04:00
Jeff Layton
dd9002cf49 mount.cifs: have uppercase_string return success on NULL pointer
We currently don't attempt to uppercase the device portion of the mount
string if there isn't a prefixpath. Fix that by making uppercase_string
return success without doing anything on a NULL pointer.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-10-09 09:58:39 -04:00
Jeremy Allison
af9dc6381d Fix the build farm. In this branch cli_echo returns NTSTATUS.
Jeremy
2008-10-03 17:57:37 -07:00
Jeremy Allison
a9390d3047 Correctly fix smbclient to terminate on eof from server.
Jeremy.
2008-10-03 14:58:41 -07:00
Volker Lendecke
73aebd7d07 Attempt to fix bug 5778
Jeff, Steve, please check!
2008-09-21 22:56:50 +02:00
Timur
a664cf7658 Fix display of POSIX ACLs. 2008-09-15 18:25:15 -07:00
Jeff Layton
73caef2c12 mount.cifs: make local versions of strlcat and strlcpy static
...to silence -Wmissing-prototypes

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit fc7c71f15b)
2008-09-12 21:21:33 -04:00
Jeff Layton
56d5149dc6 cifs.upcall: make most functions static and silence compiler warnings
...to silence -Wmissing-prototypes and some uninit'ed variable
warnings. Thanks to GD for the extra-paranoid compiler flags.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit f0ee2c145f)
2008-09-12 21:13:54 -04:00
Jeremy Allison
cc5f51d5df Use the given name, not the absolute pathname, when printing out ACL info.
Make this match the non-ACL case.
Jeremy.
(This used to be commit e695c1cc2b)
2008-09-11 17:32:14 -07:00
Jeremy Allison
65ae60489d Fix bug #5751 cannot show ACLs on DFS reported by SATOH Fumiyasu <fumiyas@osstech.co.jp>.
Fix for smbclient and libsmbclient.
Jeremy.
(This used to be commit dbd5d6b145)
2008-09-11 16:20:59 -07:00
Jeremy Allison
d4818c70eb Clarify usage of "force create mode".
Jeremy.
(This used to be commit 1d252ffd31)
2008-08-28 16:06:23 -07:00
Volker Lendecke
228a12681b Add async smbecho client support
(This used to be commit c1d645fbe3)
2008-08-28 18:16:00 +02:00
Steve French
34c073c351 mount.cifs: unclear error message with "credentials"
Thanks to Christophe Curis for the suggestion
(This used to be commit 3b5ad9190d)
2008-08-27 17:00:00 -05:00
Jeff Layton
2ed60a4f6a cifs.upcall: bump SPNEGO msg version number and don't reject old versions
When we added the ability for the kernel to send sec=mskrb5 to the
upcall, we subtly broke old cifs.upcall versions that don't understand
it. Bump the spnego message version to 2 to make this clear. Also,
change cifs.upcall to not reject requests with a version that's lower
than the current one, and to send the reply with the same version that
the request sent. The idea is to try and keep cifs.upcall backward
compatible with old kernels.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit b868463015)
2008-08-22 13:29:16 -04:00
Jeff Layton
e1523fdce4 cifs.upcall: fix build warning
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit aa3443492c)
2008-08-21 21:21:48 -04:00
Jeff Layton
6cbebac514 cifs.upcall: handle MSKRB5 OID properly
When the kernel sends the upcall a sec=mskrb5 parameter, that means
the the MSKRB5 OID is preferred by the server. This patch fixes the
upcall to use that OID in place of the "normal" krb5 OID when it
gets a sec=mskrb5 parameter.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steve French <smfrench@gmail.com>
(This used to be commit 6287e13b34)
2008-08-21 19:38:41 -04:00
Jeff Layton
3be3dac17d mount.cifs: don't prompt for password on krb5 mounts
krb5 mounts require that the user already have a valid krb5 ticket.
Since we can't currently use the password entered, don't prompt for it.

Also, switch to using strncmp instead of strcmp here.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit c75791c34a)
2008-08-21 19:38:35 -04:00
Karolin Seeger
0d64a3b46d smbspool: Fix printing on port 139.
This one was introduced with 8eff35bc.
Thanks to Noèl Köthe for tracking that down!

Karolin
(This used to be commit 250f5a40d6)
2008-08-14 17:32:26 +02:00
Jeff Layton
1759f089e1 cifs.upcall: negatively instantiate keys on error
When a request-key upcall exits without instantiating a key, the kernel
will negatively instantiate the key with a 60s timeout. Older kernels,
however seem to also link that key into the session keyring. This
behavior can interefere with subsequent mount attempts until the
key times out. The next request_key() call will get this negative key
even if the upcall would have worked the second time.

Fix this by having cifs.upcall negatively instantiate the key itself
with a 1s timeout and don't attach it to the session keyring.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit f760dd3f31)
2008-08-12 14:32:54 -04:00
Jeremy Allison
617bf10c66 Fix bug #5675 with a varient of Tim Waugh's patch,
as proposed by James Peach.
Jeremy.
(This used to be commit 5c27ad7583)
2008-08-07 17:55:57 -07:00
Steve French
3b6c8bc662 Building cifs.upcall is giving this build warning:
client/cifs.upcall.c:205: warning: function declaration isn’t a prototype

This patch fixes this by properly declaring usage() args as void.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@samba.org>
(This used to be commit 148a012421)
2008-08-05 15:36:11 -05:00
Steve French
b893729a3d cifs.upcall: fix manpage and comments
The "cifs.resolver" key type has been changed to "dns_resolver". Fix
the comments at the top of cifs.upcall and the manpage accordingly.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@samba.org>
---
 docs-xml/manpages-3/cifs.upcall.8.xml |    4 ++--
 source/client/cifs.upcall.c           |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
(This used to be commit 24a93d03c2)
2008-08-05 13:27:07 -05:00
Steve French
70dccd1468 Backing out most of changeset 5222b8db3f
(so parsing for domain parameter in mount.cifs matches online help)
and rephrasing original code to make it more clear.

The check for "domain" was meant to allow for "dom" or "DOM" and the
option ("dom") described in the help (e.g. "/sbin/mount.cifs -?") is the
shorter ("dom") form.  The reason that the string we compare against
is larger was to improve readability (we could compare against "dom"
but note /* "domain" or "DOMAIN" or "dom" or "DOM" */ but it seemed
terser to just show the larger string in the strcmp target.   The
change to "workgoup" from workg* (anything which begins with "workg"
doesn't matter - it is a minor behavior change - but probably few
scripts depend on the "alias" for this option).

Rework code so that it is clearer what we are comparing against.
(This used to be commit 92fad0fc53)
2008-08-05 13:15:46 -05:00
Steve French
0732750497 cifs.upcall was not recognizing the newer name "dns_resolver" key type
(as a synonym for the older "cifs.resolver" name) when resolving host
names to ip addresses for the kernel.

Acked-by: Jeff Layton
(This used to be commit 22c36b27c6)
2008-07-24 09:32:53 -05:00
Steve French
224f9b839b cifs.upcall: fix compile warning
Steve French noticed these warnings when building cifs.upcall:

   Compiling client/cifs.upcall.c
   client/cifs.upcall.c: In function 'usage':
   client/cifs.upcall.c:204: warning: declaration of 'prog' shadows a global declaration
   client/cifs.upcall.c:33: warning: shadowed declaration is here

Change the usage function to not take and arg and have it just use the global
"prog" variable. Fix a typo in the log message generated when an unknown
option is specified. Also getopt() always returns '?' when it sees an unknown
option so there's no point in printing it out.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(This used to be commit 4b8362f977)
2008-07-23 14:25:17 -05:00
Volker Lendecke
1335da2a7c Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit 9abc9dc4dc)
2008-07-20 17:37:11 +02:00
Jeremy Allison
cdabee2bb4 This patchset comprises a number of cleanups for the cifs upcall
binary. The biggest change is that it renames it from cifs.spnego
to cifs.upcall since the cifs.spnego name really isn't applicable
anymore.

It also fixes a segfault when the program is run without any args
and adds a manpage. Comments and/or suggestions appreciated.

This set should apply cleanly to the 3.3 test branch.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Jeremy.
(This used to be commit c633f10d9e)
2008-07-16 17:27:05 -07:00
Jeremy Allison
4b88ff157d Fix bug #5578, reported by sendel2000@hotbox.ru. Bad (non-Samba) use of strlcat gives error.
Jeremy.
(This used to be commit d7c82997bd)
2008-07-02 11:57:13 -07:00
Volker Lendecke
34dc60a74f Fix two IBM checker warnings
Steve, please check!

Thanks,

Volker
(This used to be commit 5222b8db3f)
2008-06-27 11:23:20 +02:00
Volker Lendecke
c8dfed63a6 Fix a brown paper bag segfault in clitar
Thanks to "No Body is Perfect" from gmail, whoever that is :-)

Volker
(cherry picked from commit 679d8dfa39)
(This used to be commit b8e1d62b8e)
2008-06-17 21:14:47 +02:00
Jeremy Allison
a991c5a7c3 Merge branch 'v3-3-test' of ssh://jra@git.samba.org/data/git/samba into v3-3-test
(This used to be commit 3d01248f63)
2008-05-30 10:09:22 -07:00
Jeremy Allison
2e9136e085 From Michael R Sweet <mike@easysw.com>.
All,

Noticed that smbspool.c still has my Easy Software Products copyright
on it.  The following patch fixes it to match the other code I've
contributed over the years...

Jeremy.
(This used to be commit 9f5897e28d)
2008-05-30 10:08:27 -07:00
Jeremy Allison
d36434f312 Security fix for CVE-2008-1105: Boundary failure when parsing SMB responses
can result in a buffer overrun.
Jeremy.
(This used to be commit 23b825e9d2)
2008-05-28 09:31:42 -07:00
Volker Lendecke
37aaa8d8f9 Remove stuff from client_proto.h
(This used to be commit c1e115964b)
2008-05-25 11:43:56 +02:00
Michael Adam
b398a96b09 rpc_client: use endpoint mapper to get the port for rpc_pipe_open_tcp().
Michael
(This used to be commit f7db445c82)
2008-05-22 11:29:57 +02:00
Kai Blin
59a6b2df74 client: Fix the proto header to fix the build.
(This used to be commit 9e39ac1cc3)
2008-05-22 09:43:50 +02:00
Michael Adam
7a1b7a14e4 smbclient: freeze client_proto.h from "make proto"
Michael
(This used to be commit f8c0710165)
2008-05-18 23:26:51 +02:00
Günther Deschner
4d8836ab96 Fix client authentication with -P switch in client tools (Bug 5435).
Guenther
(This used to be commit d077ef64cd)
2008-05-05 16:59:53 +02:00