jlayton/cifs-utils.git
14 years agomount.cifs: eliminate some unneeded flags in parsed_mount_info
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: eliminate some unneeded flags in parsed_mount_info

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: parse unc into separate fields
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: parse unc into separate fields

The UNC is currently handled as a single string and mount.cifs will
just munge it whenever it needs to change the delimiter type or
uppercase it, etc. This is tricky to handle correctly and means that
we often need to keep track of what's already been changed. Instead
of doing this, just track the pieces of the UNC in separate fields
in the parsed_mount_info, and then use those pieces to build strings
as needed.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: add username and domain fields to parsed_mount_info
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: add username and domain fields to parsed_mount_info

...and fill and use them accordingly.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: make mountpassword a field in parsed_info
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: make mountpassword a field in parsed_info

...rather than a buffer pointed to by a global var

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: make parse_options return proper mount error codes
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: make parse_options return proper mount error codes

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: have parse_options fill parsed_mount_info
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: have parse_options fill parsed_mount_info

Allocate a zeroed out parsed_mount_info struct and have parse_options
put its info into that instead. realloc() is no longer used here and
instead we just have the option parser carefully check that the result
will fit in the buffer before copying it.

We also no longer use snprintf to stuff info directly into the buffer.
It may not be possible given the other checks, but snprintf can leave a
non-NULL terminated string. Use strlcat everywhere instead to ensure
that doesn't occur.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: declare new struct for holding parsed mount info
Jeff Layton [Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)]
mount.cifs: declare new struct for holding parsed mount info

Currently mount.cifs puts mount info into a disparate series of
dynamically sized buffers. Declate a new struct that holds a set of
fixed-size buffers.  The option and UNC parsing routines can place their
results in this struct.

This should make it easier to implement privilege separation using
shared memory to pass data between processes.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs-utils: release 4.1 cifs-utils-4.1
Jeff Layton [Tue, 23 Mar 2010 13:47:07 +0000 (09:47 -0400)]
cifs-utils: release 4.1

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: fix ver= option passed to the kernel
Jeff Layton [Tue, 23 Mar 2010 13:21:25 +0000 (09:21 -0400)]
mount.cifs: fix ver= option passed to the kernel

Rather than passing the VERSION string to the kernel in the ver=
option, track the OPTIONS_VERSION separately and pass that to the
kernel. If we ever need to have different behavior in kernel for
different mount.cifs versions, we can bump this number.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: don't use exit(3) in get_password_from_file
Jeff Layton [Mon, 22 Mar 2010 12:03:38 +0000 (08:03 -0400)]
mount.cifs: don't use exit(3) in get_password_from_file

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: don't use exit(3) in mount_cifs_usage() and open_cred_file()
Jeff Layton [Mon, 22 Mar 2010 12:03:38 +0000 (08:03 -0400)]
mount.cifs: don't use exit(3) in mount_cifs_usage() and open_cred_file()

...to help ensure that exit processing is handled appropriately.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: don't use exit(3) in main()
Jeff Layton [Mon, 22 Mar 2010 12:03:38 +0000 (08:03 -0400)]
mount.cifs: don't use exit(3) in main()

Clean up error handling in main() so that cleanup tasks are completed
rather than assuming exit processing will handle it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: fix error handling when duplicating options string
Jeff Layton [Mon, 22 Mar 2010 12:03:38 +0000 (08:03 -0400)]
mount.cifs: fix error handling when duplicating options string

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: make check_mountpoint a noop for non-legacy builds
Jeff Layton [Mon, 22 Mar 2010 12:03:38 +0000 (08:03 -0400)]
mount.cifs: make check_mountpoint a noop for non-legacy builds

Now that we chdir() to the mountpoint, the checks in that function are
pointless. Just make it a noop for non-legacy setuid builds.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: remove uuid option
Jeff Layton [Mon, 22 Mar 2010 12:03:37 +0000 (08:03 -0400)]
mount.cifs: remove uuid option

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: remove bogus rsize/wsize options
Jeff Layton [Mon, 22 Mar 2010 12:03:37 +0000 (08:03 -0400)]
mount.cifs: remove bogus rsize/wsize options

They don't actually do anything.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: simplify command-line option parsing
Jeff Layton [Mon, 22 Mar 2010 12:03:37 +0000 (08:03 -0400)]
mount.cifs: simplify command-line option parsing

Let getopt_long do the work of parsing options, then check what's left.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: remove unneeded uname call
Jeff Layton [Mon, 22 Mar 2010 12:03:37 +0000 (08:03 -0400)]
mount.cifs: remove unneeded uname call

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: clean up parse_server
Jeff Layton [Mon, 22 Mar 2010 12:03:35 +0000 (08:03 -0400)]
mount.cifs: clean up parse_server

Get rid of a lot of unnecessary nesting.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: clean up preprocessor macros
Jeff Layton [Sat, 20 Mar 2010 12:10:24 +0000 (08:10 -0400)]
mount.cifs: clean up preprocessor macros

...remove some unneeded junk.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoUpdate the README
Jeff Layton [Sat, 20 Mar 2010 11:50:10 +0000 (07:50 -0400)]
Update the README

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs-utils: switch to using autoconf package version
Jeff Layton [Sat, 20 Mar 2010 11:49:44 +0000 (07:49 -0400)]
cifs-utils: switch to using autoconf package version

Rather than using a hardcoded version string, use the VERSION macro
that autoconf provides. This will help make it clear what version
is actually being used in bug reports when someone runs
"mount.cifs -V" or "cifs.upcall --version".

Also, clean up AC_INIT and AM_INIT_AUTOMAKE macros.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautotools: make cifs.upcall dependent on an enable option
Jeff Layton [Tue, 9 Mar 2010 03:06:46 +0000 (22:06 -0500)]
autotools: make cifs.upcall dependent on an enable option

Make it so that cifs.upcall is built by default, but autodisable it if
the needed headers aren't present.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agomount.cifs: check for NULL addr pointer before handling scopeid
Jeff Layton [Sun, 7 Mar 2010 23:49:33 +0000 (18:49 -0500)]
mount.cifs: check for NULL addr pointer before handling scopeid

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agodocs: these tools are no longer part of Samba
Michael Wood [Wed, 3 Mar 2010 18:31:32 +0000 (13:31 -0500)]
docs: these tools are no longer part of Samba

Remove references to samba(7).
There's no cifs-utils(7) man page, so don't refer to one.

Signed-off-by: Michael Wood <esiotrot@gmail.com>
14 years agodocs: change source from Samba 3.6
Michael Wood [Wed, 3 Mar 2010 18:31:29 +0000 (13:31 -0500)]
docs: change source from Samba 3.6

These tools are no longer part of the Samba suite, so change the source
to cifs-utils 4.0.

Signed-off-by: Michael Wood <esiotrot@gmail.com>
14 years agoautotools: check for keyutils.h cifs-utils-4.0
Jeff Layton [Sat, 27 Feb 2010 02:36:56 +0000 (21:36 -0500)]
autotools: check for keyutils.h

...and throw a (hopefully) helpful error message if it's not present.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: use non-legacy krb5.h location
Jeff Layton [Sat, 27 Feb 2010 02:36:45 +0000 (21:36 -0500)]
cifs.upcall: use non-legacy krb5.h location

<krb5.h> is deprecated in favor of <krb5/krb5.h>. Also, make autoconf
throw a more helpful error message if it's not present.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautotools: remove autogenerated files from git repo cifs-utils-4.0rc1
Jeff Layton [Sat, 20 Feb 2010 15:56:19 +0000 (07:56 -0800)]
autotools: remove autogenerated files from git repo

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautoconf: make sure C files include config.h
Jeff Layton [Sat, 20 Feb 2010 15:48:04 +0000 (07:48 -0800)]
autoconf: make sure C files include config.h

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautoconf: now it works with autoconf 2.59 (RHEL5)
Igor Mammedov [Fri, 19 Feb 2010 16:34:20 +0000 (08:34 -0800)]
autoconf: now it works with autoconf 2.59 (RHEL5)

suggest to install libtalloc-devel if talloc.h is missing

14 years agospnego.c: make sure to free talloc contexts
Jeff Layton [Tue, 16 Feb 2010 20:33:40 +0000 (15:33 -0500)]
spnego.c: make sure to free talloc contexts

We're using talloc_init to get a context in these functions but they
aren't freeing them.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautomake: make sure to link cifs.upcall to keyutils
Jeff Layton [Sun, 14 Feb 2010 15:52:54 +0000 (10:52 -0500)]
automake: make sure to link cifs.upcall to keyutils

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoDon't make "configure" part of the repo
Jeff Layton [Sun, 14 Feb 2010 15:50:52 +0000 (10:50 -0500)]
Don't make "configure" part of the repo

14 years agoautoconf: reshuffle header and function checking
Jeff Layton [Tue, 9 Feb 2010 20:22:30 +0000 (15:22 -0500)]
autoconf: reshuffle header and function checking

Make sure we bail out if necessary functions and headers aren't present.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs-utils: make sure -Wall is always set for builds
Jeff Layton [Tue, 9 Feb 2010 20:08:04 +0000 (15:08 -0500)]
cifs-utils: make sure -Wall is always set for builds

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautoconf: bail out if talloc.h or krb5.h aren't present
Jeff Layton [Tue, 9 Feb 2010 19:40:21 +0000 (14:40 -0500)]
autoconf: bail out if talloc.h or krb5.h aren't present

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautoconf: fix "quoting" around macro args in configure.ac
Jeff Layton [Tue, 9 Feb 2010 19:33:13 +0000 (14:33 -0500)]
autoconf: fix "quoting" around macro args in configure.ac

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoautoconf: add some missing files for the release cifs-utils-4.0a1 release-4-0a1
Jeff Layton [Tue, 9 Feb 2010 16:57:54 +0000 (11:57 -0500)]
autoconf: add some missing files for the release

...we don't want people to have to run autoreconf on their own, so
add them to the tree.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agosilence some build warnings
Jeff Layton [Mon, 8 Feb 2010 18:28:11 +0000 (13:28 -0500)]
silence some build warnings

mount.cifs.c: In function 'main':
mount.cifs.c:1201: warning: 'dev_name' may be used uninitialized in this function
mount.cifs.c:1217: warning: 'addr6' may be used uninitialized in this function

asn1.c: In function 'ber_read_OID_String':
asn1.c:591: warning: 'bytes_eaten' may be used uninitialized in this function

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: include util.h
Jeff Layton [Mon, 8 Feb 2010 18:15:57 +0000 (13:15 -0500)]
cifs.upcall: include util.h

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoClean up ChangeLog and fix versioning
Jeff Layton [Mon, 8 Feb 2010 15:04:45 +0000 (10:04 -0500)]
Clean up ChangeLog and fix versioning

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoAdd manpages to makefile
Jeff Layton [Mon, 8 Feb 2010 14:43:36 +0000 (09:43 -0500)]
Add manpages to makefile

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoadd autoconf check for talloc.h
Jeff Layton [Mon, 8 Feb 2010 14:29:51 +0000 (09:29 -0500)]
add autoconf check for talloc.h

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoAdd checks for specific krb5 functions
Jeff Layton [Mon, 8 Feb 2010 14:29:49 +0000 (09:29 -0500)]
Add checks for specific krb5 functions

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoAdd check for krb5.h.
Jeff Layton [Mon, 8 Feb 2010 14:29:47 +0000 (09:29 -0500)]
Add check for krb5.h.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoAdd more docs...
Jeff Layton [Mon, 8 Feb 2010 14:29:45 +0000 (09:29 -0500)]
Add more docs...

The client guide and manpage XML sources

...eventually we should add a way to build the manpages from XML

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoadd manpages for mount.cifs and cifs.upcall
Jeff Layton [Mon, 8 Feb 2010 14:29:43 +0000 (09:29 -0500)]
add manpages for mount.cifs and cifs.upcall

...for now we just add them as regular troff manpages.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: add proper licenses to files
Jeff Layton [Mon, 8 Feb 2010 14:29:41 +0000 (09:29 -0500)]
cifs.upcall: add proper licenses to files

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: remove strncasecmp redefinition
Jeff Layton [Mon, 8 Feb 2010 14:29:21 +0000 (09:29 -0500)]
cifs.upcall: remove strncasecmp redefinition

...no need for that now.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoutil.c: move strlcat and strlcpy into a separate "util.c" object
Jeff Layton [Sun, 7 Feb 2010 21:23:23 +0000 (16:23 -0500)]
util.c: move strlcat and strlcpy into a separate "util.c" object

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoreplace.h: pare down some unneeded replacements
Jeff Layton [Sun, 7 Feb 2010 19:56:18 +0000 (14:56 -0500)]
replace.h: pare down some unneeded replacements

A lot of this stuff is for other platforms, which we don't need to
really worry about much with cifs-utils.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agospnego.c: add new spnego.c file with SPNEGO/GSSAPI routines we need
Jeff Layton [Sun, 7 Feb 2010 19:54:22 +0000 (14:54 -0500)]
spnego.c: add new spnego.c file with SPNEGO/GSSAPI routines we need

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoasn1.c: remove a couple of unneeded functions
Jeff Layton [Sun, 7 Feb 2010 19:27:16 +0000 (14:27 -0500)]
asn1.c: remove a couple of unneeded functions

These depends on some utility functions that we don't have and
we aren't planning to use them anyway. Just remove them.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoadd asn.1 files from samba tree
Jeff Layton [Sun, 7 Feb 2010 16:28:37 +0000 (11:28 -0500)]
add asn.1 files from samba tree

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agospnego.h: add some needed OID's
Jeff Layton [Sun, 7 Feb 2010 16:27:29 +0000 (11:27 -0500)]
spnego.h: add some needed OID's

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: include arpa/inet.h
Jeff Layton [Sun, 7 Feb 2010 16:11:59 +0000 (11:11 -0500)]
cifs.upcall: include arpa/inet.h

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: include netdb.h
Jeff Layton [Sun, 7 Feb 2010 16:00:34 +0000 (11:00 -0500)]
cifs.upcall: include netdb.h

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: replace SMB_XMALLOC_ARRAY with calloc
Jeff Layton [Sun, 7 Feb 2010 15:58:52 +0000 (10:58 -0500)]
cifs.upcall: replace SMB_XMALLOC_ARRAY with calloc

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: include time.h
Jeff Layton [Sun, 7 Feb 2010 15:55:09 +0000 (10:55 -0500)]
cifs.upcall: include time.h

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoreplace.h: add SAFE_FREE
Jeff Layton [Sun, 7 Feb 2010 15:54:17 +0000 (10:54 -0500)]
replace.h: add SAFE_FREE

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: add a spnego.h file
Jeff Layton [Sun, 7 Feb 2010 15:54:17 +0000 (10:54 -0500)]
cifs.upcall: add a spnego.h file

...to hold SPNEGO definitions.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: fix up the includes
Jeff Layton [Sun, 7 Feb 2010 15:54:13 +0000 (10:54 -0500)]
cifs.upcall: fix up the includes

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: replace SMB_STRNDUP with strndup
Jeff Layton [Sun, 7 Feb 2010 15:52:59 +0000 (10:52 -0500)]
cifs.upcall: replace SMB_STRNDUP with strndup

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoInitial autotools addition
Jeff Layton [Sun, 7 Feb 2010 15:52:57 +0000 (10:52 -0500)]
Initial autotools addition

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: borrow some of the samba headers
Jeff Layton [Sun, 7 Feb 2010 14:29:41 +0000 (09:29 -0500)]
cifs.upcall: borrow some of the samba headers

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: replace cli_krb5_get_ticket
Jeff Layton [Sun, 7 Feb 2010 12:43:42 +0000 (07:43 -0500)]
cifs.upcall: replace cli_krb5_get_ticket

We need to replace the function that we use to fetch krb5 creds since
that's currently provided by a libsmbclient object.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: don't use smb_krb5_unparse_name
Jeff Layton [Sun, 7 Feb 2010 12:43:20 +0000 (07:43 -0500)]
cifs.upcall: don't use smb_krb5_unparse_name

...we don't really need a talloc-ified version here. Just use the normal
one. Also don't use strnequal. Use strncasecmp instead.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: don't use smb_krb5_principal_get_realm
Jeff Layton [Sun, 7 Feb 2010 12:42:58 +0000 (07:42 -0500)]
cifs.upcall: don't use smb_krb5_principal_get_realm

...we need our own version.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoInitial import of files from samba master branch
Jeff Layton [Sun, 7 Feb 2010 12:40:12 +0000 (07:40 -0500)]
Initial import of files from samba master branch

(commit 6e510b49c03be9caba4f587f3f6cec547841b0d7)