From 796cade5585f1237e2c047293ad6a9b8a4e923ba Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) --- source/client/mount.cifs.c | 30 +++++++++--------------------- source/client/smbspool.c | 11 ++++++----- 2 files changed, 15 insertions(+), 26 deletions(-) (limited to 'source/client') diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c index a6136a9e2c2..5750deb31ca 100755 --- a/source/client/mount.cifs.c +++ b/source/client/mount.cifs.c @@ -39,7 +39,7 @@ #include #define MOUNT_CIFS_VERSION_MAJOR "1" -#define MOUNT_CIFS_VERSION_MINOR "9" +#define MOUNT_CIFS_VERSION_MINOR "8" #ifndef MOUNT_CIFS_VENDOR_SUFFIX #define MOUNT_CIFS_VENDOR_SUFFIX "" @@ -127,10 +127,8 @@ static int open_cred_file(char * file_name) if(fs == NULL) return errno; line_buf = malloc(4096); - if(line_buf == NULL) { - fclose(fs); + if(line_buf == NULL) return -ENOMEM; - } while(fgets(line_buf,4096,fs)) { /* parse line from credential file */ @@ -506,8 +504,6 @@ static int parse_options(char * options, int * filesys_flags) *filesys_flags &= ~MS_NOSUID; } else if (strncmp(data, "nodev", 5) == 0) { *filesys_flags |= MS_NODEV; - } else if (strncmp(data, "nobrl", 5) == 0) { - *filesys_flags &= ~MS_MANDLOCK; } else if (strncmp(data, "dev", 3) == 0) { *filesys_flags &= ~MS_NODEV; } else if (strncmp(data, "noexec", 6) == 0) { @@ -574,15 +570,13 @@ static void check_for_comma(char ** ppasswrd) char *pass; int i,j; int number_of_commas = 0; - int len; + int len = strlen(*ppasswrd); if(ppasswrd == NULL) return; else (pass = *ppasswrd); - len = strlen(pass); - for(i=0;i 1023) { printf("mount error: UNC name too long"); @@ -720,13 +715,6 @@ static char * parse_server(char ** punc_name) if(share) { free_share_name = 1; *punc_name = malloc(length+3); - if(*punc_name == NULL) { - /* put the original string back if - no memory left */ - *punc_name = unc_name; - return NULL; - } - *share = '/'; strncpy((*punc_name)+2,unc_name,length); unc_name = *punc_name; @@ -756,7 +744,8 @@ continue_unc_parsing: return NULL; } if(host_entry == NULL) { - printf("mount error: could not find target server. TCP name %s not found\n", unc_name); + printf("mount error: could not find target server. TCP name %s not found ", unc_name); + printf(" rc = %d\n",rc); return NULL; } else { /* BB should we pass an alternate version of the share name as Unicode */ @@ -1029,9 +1018,6 @@ mount_retry: optlen = 0; if(share_name) optlen += strlen(share_name) + 4; - else { - printf("No server share name specified\n"); - } if(user_name) optlen += strlen(user_name) + 6; if(ipaddr) @@ -1140,6 +1126,8 @@ mount_retry: strcat(mountent.mnt_opts,"rw"); if(flags & MS_MANDLOCK) strcat(mountent.mnt_opts,",mand"); + else + strcat(mountent.mnt_opts,",nomand"); if(flags & MS_NOEXEC) strcat(mountent.mnt_opts,",noexec"); if(flags & MS_NOSUID) diff --git a/source/client/smbspool.c b/source/client/smbspool.c index d13ae39416f..da517297f71 100644 --- a/source/client/smbspool.c +++ b/source/client/smbspool.c @@ -70,6 +70,9 @@ static int smb_print(struct cli_state *, char *, FILE *); FILE *fp; /* File to print */ int status=0; /* Status of LPD job */ struct cli_state *cli; /* SMB interface */ + char null_str[1]; + + null_str[0] = '\0'; /* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */ if (argc > 2 && strncmp(argv[0],"smb://", 6) && !strncmp(argv[1],"smb://", 6)) { @@ -158,12 +161,12 @@ static int smb_print(struct cli_state *, char *, FILE *); if ((password = strchr_m(username, ':')) != NULL) *password++ = '\0'; else - password = ""; + password = null_str; } else { - username = ""; - password = ""; + username = null_str; + password = null_str; server = uri + 6; } @@ -335,10 +338,8 @@ char * get_ticket_cache( uid_t uid ) if ( ticket_file == NULL ) { -#ifdef DEVELOPER /* no ticket cache found */ fprintf(stderr, "ERROR: No ticket cache found for userid=%d\n", uid); -#endif return NULL; } -- cgit