The branch, v3-2-test has been updated
       via  e831cd78ee3cf89abee058a475540955fad423ce (commit)
      from  de96e1a82d6e92c00a0ab3020db8d7c0284aadb1 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit e831cd78ee3cf89abee058a475540955fad423ce
Author: Steve French <smfre...@gmail.com>
Date:   Tue Feb 24 12:52:08 2009 -0600

    cifs mount fix for handling -V parameter
    
    also syncs with 3-3 mount.cifs
    
    Acked-by: Jeff Layton <jlay...@redhat.com>
    Signed-off-by: Steve French <sfre...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source/client/mount.cifs.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index e7397da..67e964d 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -485,7 +485,8 @@ static int parse_options(char ** optionsp, int * 
filesys_flags)
                        }
                } else if (strncmp(data, "sec", 3) == 0) {
                        if (value) {
-                               if (!strcmp(value, "none"))
+                               if (!strncmp(value, "none", 4) ||
+                                   !strncmp(value, "krb5", 4))
                                        got_password = 1;
                        }
                } else if (strncmp(data, "ip", 2) == 0) {
@@ -533,8 +534,11 @@ static int parse_options(char ** optionsp, int * 
filesys_flags)
                                SAFE_FREE(out);
                                return 1;
                        }
-               } else if ((strncmp(data, "domain", 3) == 0)
-                          || (strncmp(data, "workgroup", 5) == 0)) {
+               } else if ((strncmp(data, "dom" /* domain */, 3) == 0)
+                          || (strncmp(data, "workg", 5) == 0)) {
+                       /* note this allows for synonyms of "domain"
+                          such as "DOM" and "dom" and "workgroup"
+                          and "WORKGRP" etc. */
                        if (!value || !*value) {
                                printf("CIFS: invalid domain name\n");
                                SAFE_FREE(out);
@@ -1075,6 +1079,14 @@ int main(int argc, char ** argv)
                }
                mountpoint = argv[2];
        } else {
+               if ((strcmp (argv[1], "--version") == 0) ||
+                   ((strcmp (argv[1], "-V") == 0))) {
+                       printf ("mount.cifs version: %s.%s%s\n",
+                       MOUNT_CIFS_VERSION_MAJOR,
+                       MOUNT_CIFS_VERSION_MINOR,
+                       MOUNT_CIFS_VENDOR_SUFFIX);
+                       exit (0);
+               }
                mount_cifs_usage();
                exit(EX_USAGE);
        }
@@ -1286,7 +1298,13 @@ int main(int argc, char ** argv)
        }
 
        if(got_user == 0) {
-               user_name = getusername();
+               /* Note that the password will not be retrieved from the
+                  USER env variable (ie user%password form) as there is
+                  already a PASSWD environment varaible */
+               if (getenv("USER"))
+                       user_name = strdup(getenv("USER"));
+               if (user_name == NULL)
+                       user_name = getusername();
                got_user = 1;
        }
        


-- 
Samba Shared Repository

Reply via email to