Ignore:
Timestamp:
May 24, 2009, 7:17:10 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 to 3.3.1

Location:
branches/samba-3.3.x/source/client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/client/client.c

    r206 r221  
    17861786****************************************************************************/
    17871787
    1788 static void free_file_list (struct file_list *list_head)
     1788static void free_file_list (struct file_list *l_head)
    17891789{
    17901790        struct file_list *list, *next;
    17911791
    1792         for (list = list_head; list; list = next) {
     1792        for (list = l_head; list; list = next) {
    17931793                next = list->next;
    1794                 DLIST_REMOVE(list_head, list);
     1794                DLIST_REMOVE(l_head, list);
    17951795                SAFE_FREE(list->file_path);
    17961796                SAFE_FREE(list);
  • branches/samba-3.3.x/source/client/mount.cifs.c

    r206 r221  
    8686const char *thisprogram;
    8787int verboseflag = 0;
     88int fakemnt = 0;
    8889static int got_password = 0;
    8990static int got_user = 0;
     
    10311032        char * temp;
    10321033        char * dev_name;
    1033         int rc;
     1034        int rc = 0;
    10341035        int rsize = 0;
    10351036        int wsize = 0;
     
    11041105                        exit(EX_USAGE);
    11051106                case 'n':
    1106                     ++nomtab;
    1107                     break;
     1107                        ++nomtab;
     1108                        break;
    11081109                case 'b':
    11091110#ifdef MS_BIND
     
    12091210                        break;
    12101211                case 't':
     1212                        break;
     1213                case 'f':
     1214                        ++fakemnt;
    12111215                        break;
    12121216                default:
     
    14111415        }
    14121416
    1413         if (mount(dev_name, mountpoint, "cifs", flags, options)) {
     1417        if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
    14141418                switch (errno) {
    14151419                case ECONNREFUSED:
     
    14411445        }
    14421446
     1447        if (nomtab)
     1448                goto mount_exit;
    14431449        atexit(unlock_mtab);
    14441450        rc = lock_mtab();
  • branches/samba-3.3.x/source/client/umount.cifs.c

    r206 r221  
    3434#include <string.h>
    3535#include <mntent.h>
     36#include <limits.h>
    3637#include "mount.h"
    3738
     
    232233}
    233234
     235/* Make a canonical pathname from PATH.  Returns a freshly malloced string.
     236   It is up the *caller* to ensure that the PATH is sensible.  i.e.
     237   canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.''
     238   is not a legal pathname for ``/dev/fd0''  Anything we cannot parse
     239   we return unmodified.   */
     240static char *
     241canonicalize(char *path)
     242{
     243        char *canonical;
     244
     245        if (path == NULL) {
     246                return NULL;
     247        }
     248
     249        if (strlen(path) > PATH_MAX) {
     250                fprintf(stderr, "Mount point string too long\n");
     251                return NULL;
     252        }
     253
     254        canonical = (char *)malloc (PATH_MAX + 1);
     255
     256        if (!canonical) {
     257                fprintf(stderr, "Error! Not enough memory!\n");
     258                return NULL;
     259        }
     260
     261        if (realpath (path, canonical))
     262                return canonical;
     263
     264        strncpy (canonical, path, PATH_MAX);
     265        canonical[PATH_MAX] = '\0';
     266        return canonical;
     267}
     268
    234269int main(int argc, char ** argv)
    235270{
     
    305340        argc -= optind;
    306341
    307         mountpoint = argv[0];
     342        mountpoint = canonicalize(argv[0]);
    308343
    309344        if((argc < 1) || (argv[0] == NULL)) {
Note: See TracChangeset for help on using the changeset viewer.