diff options
author | Jeremy Allison <jra@samba.org> | 2001-10-11 09:35:01 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-10-11 09:35:01 +0000 |
commit | f0b5382869d12249e593ac2f10fc9f1f9d03bae6 (patch) | |
tree | 97543b143f7e42dfdfd7e6e46ad22d0fd59bcdab /source/client | |
parent | 8d4870bccd026d059c160de3642bb427338256ec (diff) | |
download | samba-f0b5382869d12249e593ac2f10fc9f1f9d03bae6.tar.gz samba-f0b5382869d12249e593ac2f10fc9f1f9d03bae6.tar.xz samba-f0b5382869d12249e593ac2f10fc9f1f9d03bae6.zip |
Sync-up with SAMBA_2_2 branch.
Jeremy.
Diffstat (limited to 'source/client')
-rw-r--r-- | source/client/client.c | 17 | ||||
-rw-r--r-- | source/client/clitar.c | 17 | ||||
-rw-r--r-- | source/client/smbmount.c | 26 | ||||
-rw-r--r-- | source/client/smbumount.c | 5 |
4 files changed, 46 insertions, 19 deletions
diff --git a/source/client/client.c b/source/client/client.c index 4969156f083..d839155bcfc 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -422,20 +422,21 @@ static void adjust_do_list_queue(void) static void add_to_do_list_queue(const char* entry) { + char *dlq; + long new_end = do_list_queue_end + ((long)strlen(entry)) + 1; while (new_end > do_list_queue_size) { do_list_queue_size *= 2; DEBUG(4,("enlarging do_list_queue to %d\n", (int)do_list_queue_size)); - do_list_queue = Realloc(do_list_queue, do_list_queue_size); - if (! do_list_queue) { + dlq = Realloc(do_list_queue, do_list_queue_size); + if (!dlq) { DEBUG(0,("failure enlarging do_list_queue to %d bytes\n", - (int)do_list_queue_size)); + (int)do_list_queue_size)); reset_do_list_queue(); - } - else - { + } else { + do_list_queue = dlq; memset(do_list_queue + do_list_queue_size / 2, 0, do_list_queue_size / 2); } @@ -1020,6 +1021,10 @@ static void do_put(char *rname,char *lname) rname)); buf = (char *)malloc(maxwrite); + if (!buf) { + DEBUG(0, ("ERROR: Not enough memory!\n")); + return; + } while (!feof(f)) { int n = maxwrite; int ret; diff --git a/source/client/clitar.c b/source/client/clitar.c index f6e04230250..335c92eecf1 100644 --- a/source/client/clitar.c +++ b/source/client/clitar.c @@ -1606,14 +1606,15 @@ static int read_inclusion_file(char *filename) } if ((strlen(buf) + 1 + inclusion_buffer_sofar) >= inclusion_buffer_size) { + char *ib; inclusion_buffer_size *= 2; - inclusion_buffer = Realloc(inclusion_buffer,inclusion_buffer_size); - if (! inclusion_buffer) { - DEBUG(0,("failure enlarging inclusion buffer to %d bytes\n", - inclusion_buffer_size)); - error = 1; - break; - } + ib = Realloc(inclusion_buffer,inclusion_buffer_size); + if (! ib) { + DEBUG(0,("failure enlarging inclusion buffer to %d bytes\n", inclusion_buffer_size)); + error = 1; + break; + } else + inclusion_buffer = ib; } safe_strcpy(inclusion_buffer + inclusion_buffer_sofar, buf, inclusion_buffer_size - inclusion_buffer_sofar); @@ -1718,7 +1719,7 @@ int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind) SMB_STRUCT_STAT stbuf; extern time_t newer_than; - if (dos_stat(argv[Optind], &stbuf) == 0) { + if (sys_stat(dos_to_unix(argv[Optind],False), &stbuf) == 0) { newer_than = stbuf.st_mtime; DEBUG(1,("Getting files newer than %s", asctime(LocalTime(&newer_than)))); diff --git a/source/client/smbmount.c b/source/client/smbmount.c index a121d1fa22d..273a5fa85fd 100644 --- a/source/client/smbmount.c +++ b/source/client/smbmount.c @@ -195,11 +195,17 @@ static struct cli_state *do_connection(char *service) password, strlen(password), password, strlen(password), workgroup)) { - DEBUG(0,("%d: session setup failed: %s\n", - getpid(), cli_errstr(c))); - cli_shutdown(c); - free(c); - return NULL; + /* if a password was not supplied then try again with a + null username */ + if (password[0] || !username[0] || + !cli_session_setup(c, "", "", 0, "", 0, workgroup)) { + DEBUG(0,("%d: session setup failed: %s\n", + getpid(), cli_errstr(c))); + cli_shutdown(c); + free(c); + return NULL; + } + DEBUG(0,("Anonymous login successful\n")); } DEBUG(4,("%d: session setup ok\n", getpid())); @@ -777,6 +783,7 @@ static void parse_mount_smb(int argc, char **argv) fprintf(stderr, "Unhandled option: %s\n", opteq+1); exit(1); } else if(!strcmp(opts, "guest")) { + *password = '\0'; got_pass = True; } else if(!strcmp(opts, "rw")) { mount_ro = 0; @@ -817,6 +824,15 @@ static void parse_mount_smb(int argc, char **argv) /* here we are interactive, even if run from autofs */ setup_logging("mount.smbfs",True); + /* CLI_FORCE_ASCII=false makes smbmount negotiate unicode. The default + is to not announce any unicode capabilities as current smbfs does + not support it. */ + p = getenv("CLI_FORCE_ASCII"); + if (p && !strcmp(p, "false")) + unsetenv("CLI_FORCE_ASCII"); + else + setenv("CLI_FORCE_ASCII", "true", 1); + TimeInit(); charset_initialise(); diff --git a/source/client/smbumount.c b/source/client/smbumount.c index dacf4ab67d0..983ad44fa0f 100644 --- a/source/client/smbumount.c +++ b/source/client/smbumount.c @@ -74,6 +74,11 @@ canonicalize (char *path) { char *canonical = malloc (PATH_MAX + 1); + if (!canonical) { + fprintf(stderr, "Error! Not enough memory!\n"); + return NULL; + } + if (strlen(path) > PATH_MAX) { fprintf(stderr, "Mount point string too long\n"); return NULL; |