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/libsmb
Files:
13 edited

Legend:

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

    r206 r221  
    319319{
    320320        struct cli_state *cli = (struct cli_state *)p;
    321         struct cli_request *req;
     321        struct cli_request *req, *next;
    322322        NTSTATUS status;
    323323
     
    422422
    423423 sock_error:
    424         for (req = cli->outstanding_requests; req; req = req->next) {
     424        for (req = cli->outstanding_requests; req; req = next) {
     425                next = req;
    425426                async_req_error(req->async, status);
    426427        }
  • branches/samba-3.3.x/source/libsmb/clifsinfo.c

    r206 r221  
    303303        return ret;
    304304}
     305
     306bool cli_get_fs_full_size_info(struct cli_state *cli,
     307                               SMB_BIG_UINT *total_allocation_units,
     308                               SMB_BIG_UINT *caller_allocation_units,
     309                               SMB_BIG_UINT *actual_allocation_units,
     310                               SMB_BIG_UINT *sectors_per_allocation_unit,
     311                               SMB_BIG_UINT *bytes_per_sector)
     312{
     313        bool ret = False;
     314        uint16 setup;
     315        char param[2];
     316        char *rparam=NULL, *rdata=NULL;
     317        unsigned int rparam_count=0, rdata_count=0;
     318
     319        setup = TRANSACT2_QFSINFO;
     320
     321        SSVAL(param,0,SMB_FS_FULL_SIZE_INFORMATION);
     322
     323        if (!cli_send_trans(cli, SMBtrans2,
     324                    NULL,
     325                    0, 0,
     326                    &setup, 1, 0,
     327                    param, 2, 0,
     328                    NULL, 0, 560)) {
     329                goto cleanup;
     330        }
     331
     332        if (!cli_receive_trans(cli, SMBtrans2,
     333                              &rparam, &rparam_count,
     334                              &rdata, &rdata_count)) {
     335                goto cleanup;
     336        }
     337
     338        if (cli_is_error(cli)) {
     339                ret = False;
     340                goto cleanup;
     341        } else {
     342                ret = True;
     343        }
     344
     345        if (rdata_count != 32) {
     346                goto cleanup;
     347        }
     348
     349        if (total_allocation_units) {
     350                *total_allocation_units = BIG_UINT(rdata, 0);
     351        }
     352        if (caller_allocation_units) {
     353                *caller_allocation_units = BIG_UINT(rdata,8);
     354        }
     355        if (actual_allocation_units) {
     356                *actual_allocation_units = BIG_UINT(rdata,16);
     357        }
     358        if (sectors_per_allocation_unit) {
     359                *sectors_per_allocation_unit = IVAL(rdata,24);
     360        }
     361        if (bytes_per_sector) {
     362                *bytes_per_sector = IVAL(rdata,28);
     363        }
     364
     365cleanup:
     366        SAFE_FREE(rparam);
     367        SAFE_FREE(rdata);
     368
     369        return ret;
     370}
     371
     372bool cli_get_posix_fs_info(struct cli_state *cli,
     373                           uint32 *optimal_transfer_size,
     374                           uint32 *block_size,
     375                           SMB_BIG_UINT *total_blocks,
     376                           SMB_BIG_UINT *blocks_available,
     377                           SMB_BIG_UINT *user_blocks_available,
     378                           SMB_BIG_UINT *total_file_nodes,
     379                           SMB_BIG_UINT *free_file_nodes,
     380                           SMB_BIG_UINT *fs_identifier)
     381{
     382        bool ret = False;
     383        uint16 setup;
     384        char param[2];
     385        char *rparam=NULL, *rdata=NULL;
     386        unsigned int rparam_count=0, rdata_count=0;
     387
     388        setup = TRANSACT2_QFSINFO;
     389
     390        SSVAL(param,0,SMB_QUERY_POSIX_FS_INFO);
     391
     392        if (!cli_send_trans(cli, SMBtrans2,
     393                    NULL,
     394                    0, 0,
     395                    &setup, 1, 0,
     396                    param, 2, 0,
     397                    NULL, 0, 560)) {
     398                goto cleanup;
     399        }
     400
     401        if (!cli_receive_trans(cli, SMBtrans2,
     402                              &rparam, &rparam_count,
     403                              &rdata, &rdata_count)) {
     404                goto cleanup;
     405        }
     406
     407        if (cli_is_error(cli)) {
     408                ret = False;
     409                goto cleanup;
     410        } else {
     411                ret = True;
     412        }
     413
     414        if (rdata_count != 56) {
     415                goto cleanup;
     416        }
     417
     418        if (optimal_transfer_size) {
     419                *optimal_transfer_size = IVAL(rdata, 0);
     420        }
     421        if (block_size) {
     422                *block_size = IVAL(rdata,4);
     423        }
     424        if (total_blocks) {
     425                *total_blocks = BIG_UINT(rdata,8);
     426        }
     427        if (blocks_available) {
     428                *blocks_available = BIG_UINT(rdata,16);
     429        }
     430        if (user_blocks_available) {
     431                *user_blocks_available = BIG_UINT(rdata,24);
     432        }
     433        if (total_file_nodes) {
     434                *total_file_nodes = BIG_UINT(rdata,32);
     435        }
     436        if (free_file_nodes) {
     437                *free_file_nodes = BIG_UINT(rdata,40);
     438        }
     439        if (fs_identifier) {
     440                *fs_identifier = BIG_UINT(rdata,48);
     441        }
     442
     443cleanup:
     444        SAFE_FREE(rparam);
     445        SAFE_FREE(rdata);
     446
     447        return ret;
     448}
     449
    305450
    306451/******************************************************************************
  • branches/samba-3.3.x/source/libsmb/clikrb5.c

    r206 r221  
    17471747                }
    17481748
     1749                if (tmp[0] == '/') {
     1750                        /* Treat as a FILE: keytab definition. */
     1751                        found_valid_name = true;
     1752                }
     1753
    17491754                if (found_valid_name) {
    17501755                        if (tmp[0] != '/') {
  • branches/samba-3.3.x/source/libsmb/libsmb_compat.c

    r206 r221  
    331331
    332332int
     333smbc_statvfs(char *path,
     334             struct statvfs *st)
     335{
     336        return smbc_getFunctionStatVFS(statcont)(statcont, path, st);
     337}
     338
     339int
     340smbc_fstatvfs(int fd,
     341              struct statvfs *st)
     342{
     343        SMBCFILE * file = find_fd(fd);
     344        return smbc_getFunctionFstatVFS(statcont)(statcont, file, st);
     345}
     346
     347int
    333348smbc_ftruncate(int fd,
    334349               off_t size)
  • branches/samba-3.3.x/source/libsmb/libsmb_context.c

    r206 r221  
    9595        smbc_setFunctionFtruncate(context, SMBC_ftruncate_ctx);
    9696        smbc_setFunctionStat(context, SMBC_stat_ctx);
     97        smbc_setFunctionStatVFS(context, SMBC_statvfs_ctx);
     98        smbc_setFunctionFstatVFS(context, SMBC_fstatvfs_ctx);
    9799        smbc_setFunctionFstat(context, SMBC_fstat_ctx);
    98100        smbc_setFunctionOpendir(context, SMBC_opendir_ctx);
     
    645647        cli_cm_set_credentials();
    646648}
     649
     650void smbc_set_credentials_with_fallback(SMBCCTX *context,
     651                                        const char *workgroup,
     652                                        const char *user,
     653                                        const char *password)
     654{
     655        smbc_bool use_kerberos = false;
     656        const char *signing_state = "off";
     657       
     658        if (!context ||
     659            ! workgroup || ! *workgroup ||
     660            ! user || ! *user ||
     661            ! password || ! *password) {
     662           
     663                return;
     664        }
     665
     666        if (smbc_getOptionUseKerberos(context)) {
     667                use_kerberos = True;
     668        }
     669
     670        if (lp_client_signing()) {
     671                signing_state = "on";
     672        }
     673
     674        if (lp_client_signing() == Required) {
     675                signing_state = "force";
     676        }
     677
     678        /* Using CONST_DISCARD here is ugly, but
     679         * we know that smbc_set_credentials() doesn't
     680         * actually modify the strings, and should have
     681         * been const from the start. We're constrained
     682         * by the ABI here.
     683         */
     684
     685        smbc_set_credentials(CONST_DISCARD(char *,workgroup),
     686                             CONST_DISCARD(char *,user),
     687                             CONST_DISCARD(char *,password),
     688                             use_kerberos,
     689                             CONST_DISCARD(char *,signing_state));
     690
     691        if (smbc_getOptionFallbackAfterKerberos(context)) {
     692                cli_cm_set_fallback_after_kerberos();
     693        }
     694}
  • branches/samba-3.3.x/source/libsmb/libsmb_dir.c

    r206 r221  
    15021502        char *password = NULL;
    15031503        char *workgroup = NULL;
     1504        char *targetpath = NULL;
     1505        struct cli_state *targetcli = NULL;
    15041506        char *path = NULL;
    15051507        uint16 mode;
     
    15191521        }
    15201522
    1521         DEBUG(4, ("smbc_chmod(%s, 0%3o)\n", fname, newmode));
     1523        DEBUG(4, ("smbc_chmod(%s, 0%3o)\n", fname, (unsigned int)newmode));
    15221524
    15231525        if (SMBC_parse_path(frame,
     
    15521554                return -1;  /* errno set by SMBC_server */
    15531555        }
     1556       
     1557        /*d_printf(">>>unlink: resolving %s\n", path);*/
     1558        if (!cli_resolve_path(frame, "", srv->cli, path,
     1559                              &targetcli, &targetpath)) {
     1560                d_printf("Could not resolve %s\n", path);
     1561                TALLOC_FREE(frame);
     1562                return -1;
     1563        }
    15541564
    15551565        mode = 0;
     
    15601570        if ((newmode & S_IXOTH) && lp_map_hidden(-1)) mode |= aHIDDEN;
    15611571
    1562         if (!cli_setatr(srv->cli, path, mode, 0)) {
    1563                 errno = SMBC_errno(context, srv->cli);
     1572        if (!cli_setatr(targetcli, targetpath, mode, 0)) {
     1573                errno = SMBC_errno(context, targetcli);
    15641574                TALLOC_FREE(frame);
    15651575                return -1;
     
    19021912        }
    19031913
     1914        /* set the credentials to make DFS work */
     1915        smbc_set_credentials_with_fallback(ocontext,
     1916                                           workgroup,
     1917                                           user1,
     1918                                           password1);
     1919
    19041920        /*d_printf(">>>rename: resolving %s\n", path1);*/
    19051921        if (!cli_resolve_path(frame, "", srv->cli, path1,
     
    19091925                return -1;
    19101926        }
     1927       
     1928        /* set the credentials to make DFS work */
     1929        smbc_set_credentials_with_fallback(ncontext,
     1930                                           workgroup,
     1931                                           user2,
     1932                                           password2);
     1933       
    19111934        /*d_printf(">>>rename: resolved path as %s\n", targetpath1);*/
    19121935        /*d_printf(">>>rename: resolving %s\n", path2);*/
  • branches/samba-3.3.x/source/libsmb/libsmb_file.c

    r206 r221  
    383383                return -1;
    384384        }
    385        
     385
    386386        /*d_printf(">>>write: resolving %s\n", path);*/
    387387        if (!cli_resolve_path(frame, "", file->srv->cli, path,
  • branches/samba-3.3.x/source/libsmb/libsmb_path.c

    r206 r221  
    234234        const char *p;
    235235        char *q, *r;
     236        char *workgroup = NULL;
    236237        int len;
    237238       
     
    333334               
    334335                if (strchr_m(u, ';')) {
    335                         char *workgroup;
    336336                        next_token_no_ltrim_talloc(ctx, &u, &workgroup, ";");
    337337                        if (!workgroup) {
     
    395395        (void) urldecode_talloc(ctx, pp_user, *pp_user);
    396396        (void) urldecode_talloc(ctx, pp_password, *pp_password);
     397
     398        if (!workgroup) {
     399                workgroup = talloc_strdup(ctx, smbc_getWorkgroup(context));
     400        }
     401        if (!workgroup) {
     402                return -1;
     403        }
     404
     405        /* set the credentials to make DFS work */
     406        smbc_set_credentials_with_fallback(context,
     407                                           workgroup,
     408                                           *pp_user,
     409                                           *pp_password);
    397410       
    398411        return 0;
  • branches/samba-3.3.x/source/libsmb/libsmb_server.c

    r206 r221  
    239239{
    240240        SMBCSRV *srv=NULL;
     241        char *workgroup = NULL;
    241242        struct cli_state *c;
    242243        struct nmb_name called, calling;
     
    360361               
    361362                /* ... then we're done here.  Give 'em what they came for. */
    362                 return srv;
     363                goto done;
    363364        }
    364365       
     
    599600       
    600601        DLIST_ADD(context->internal->servers, srv);
     602done:
     603        if (!pp_workgroup || !*pp_workgroup || !**pp_workgroup) {
     604                workgroup = talloc_strdup(ctx, smbc_getWorkgroup(context));
     605        } else {
     606                workgroup = *pp_workgroup;
     607        }
     608        if(!workgroup) {
     609                return NULL;
     610        }
     611       
     612        /* set the credentials to make DFS work */
     613        smbc_set_credentials_with_fallback(context,
     614                                           workgroup,
     615                                           *pp_username,
     616                                           *pp_password);
     617       
    601618        return srv;
    602619       
  • branches/samba-3.3.x/source/libsmb/libsmb_setget.c

    r206 r221  
    660660}
    661661
     662smbc_statvfs_fn
     663smbc_getFunctionStatVFS(SMBCCTX *c)
     664{
     665        return c->internal->posix_emu.statvfs_fn;
     666}
     667
     668void
     669smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn)
     670{
     671        c->internal->posix_emu.statvfs_fn = fn;
     672}
     673
     674smbc_fstatvfs_fn
     675smbc_getFunctionFstatVFS(SMBCCTX *c)
     676{
     677        return c->internal->posix_emu.fstatvfs_fn;
     678}
     679
     680void
     681smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn)
     682{
     683        c->internal->posix_emu.fstatvfs_fn = fn;
     684}
     685
    662686smbc_ftruncate_fn
    663687smbc_getFunctionFtruncate(SMBCCTX *c)
  • branches/samba-3.3.x/source/libsmb/libsmb_stat.c

    r206 r221  
    156156                return -1;
    157157        }
    158        
     158
    159159        if (!user || user[0] == (char)0) {
    160160                user = talloc_strdup(frame, smbc_getUser(context));
     
    301301       
    302302}
     303
     304
     305/*
     306 * Routine to obtain file system information given a path
     307 */
     308int
     309SMBC_statvfs_ctx(SMBCCTX *context,
     310                 char *path,
     311                 struct statvfs *st)
     312{
     313        int             ret;
     314        bool            bIsDir;
     315        struct stat     statbuf;
     316        SMBCFILE *      pFile;
     317
     318        /* Determine if the provided path is a file or a folder */
     319        if (SMBC_stat_ctx(context, path, &statbuf) < 0) {
     320                return -1;
     321        }
     322
     323        /* Is it a file or a directory?  */
     324        if (S_ISDIR(statbuf.st_mode)) {
     325                /* It's a directory. */
     326                if ((pFile = SMBC_opendir_ctx(context, path)) == NULL) {
     327                        return -1;
     328                }
     329                bIsDir = true;
     330        } else if (S_ISREG(statbuf.st_mode)) {
     331                /* It's a file. */
     332                if ((pFile = SMBC_open_ctx(context, path,
     333                                           O_RDONLY, 0)) == NULL) {
     334                        return -1;
     335                }
     336                bIsDir = false;
     337        } else {
     338                /* It's neither a file nor a directory. Not supported. */
     339                errno = ENOSYS;
     340                return -1;
     341        }
     342
     343        /* Now we have an open file handle, so just use SMBC_fstatvfs */
     344        ret = SMBC_fstatvfs_ctx(context, pFile, st);
     345
     346        /* Close the file or directory */
     347        if (bIsDir) {
     348                SMBC_closedir_ctx(context, pFile);
     349        } else {
     350                SMBC_close_ctx(context, pFile);
     351        }
     352
     353        return ret;
     354}
     355
     356
     357/*
     358 * Routine to obtain file system information given an fd
     359 */
     360
     361int
     362SMBC_fstatvfs_ctx(SMBCCTX *context,
     363                  SMBCFILE *file,
     364                  struct statvfs *st)
     365{
     366        unsigned long flags = 0;
     367        uint32 fs_attrs = 0;
     368        struct cli_state *cli = file->srv->cli;
     369               
     370
     371        /* Initialize all fields (at least until we actually use them) */
     372        memset(st, 0, sizeof(*st));
     373
     374        /*
     375         * The state of each flag is such that the same bits are unset as
     376         * would typically be unset on a local file system on a POSIX OS. Thus
     377         * the bit is on, for example, only for case-insensitive file systems
     378         * since most POSIX file systems are case sensitive and fstatvfs()
     379         * would typically return zero in these bits on such a local file
     380         * system.
     381         */
     382
     383        /* See if the server has UNIX CIFS support */
     384        if (! SERVER_HAS_UNIX_CIFS(cli)) {
     385                SMB_BIG_UINT total_allocation_units;
     386                SMB_BIG_UINT caller_allocation_units;
     387                SMB_BIG_UINT actual_allocation_units;
     388                SMB_BIG_UINT sectors_per_allocation_unit;
     389                SMB_BIG_UINT bytes_per_sector;
     390               
     391                /* Nope. If size data is available... */
     392                if (cli_get_fs_full_size_info(cli,
     393                                              &total_allocation_units,
     394                                              &caller_allocation_units,
     395                                              &actual_allocation_units,
     396                                              &sectors_per_allocation_unit,
     397                                              &bytes_per_sector)) {
     398
     399                        /* ... then provide it */
     400                        st->f_bsize =
     401                                (unsigned long) bytes_per_sector;
     402#if HAVE_FRSIZE
     403                        st->f_frsize =
     404                                (unsigned long) sectors_per_allocation_unit;
     405#endif
     406                        st->f_blocks =
     407                                (fsblkcnt_t) total_allocation_units;
     408                        st->f_bfree =
     409                                (fsblkcnt_t) actual_allocation_units;
     410                }
     411
     412                flags |= SMBC_VFS_FEATURE_NO_UNIXCIFS;
     413        } else {
     414                uint32 optimal_transfer_size;
     415                uint32 block_size;
     416                SMB_BIG_UINT total_blocks;
     417                SMB_BIG_UINT blocks_available;
     418                SMB_BIG_UINT user_blocks_available;
     419                SMB_BIG_UINT total_file_nodes;
     420                SMB_BIG_UINT free_file_nodes;
     421                SMB_BIG_UINT fs_identifier;
     422
     423                /* Has UNIXCIFS. If POSIX filesystem info is available... */
     424                if (cli_get_posix_fs_info(cli,
     425                                          &optimal_transfer_size,
     426                                          &block_size,
     427                                          &total_blocks,
     428                                          &blocks_available,
     429                                          &user_blocks_available,
     430                                          &total_file_nodes,
     431                                          &free_file_nodes,
     432                                          &fs_identifier)) {
     433
     434                        /* ... then what's provided here takes precedence. */
     435                        st->f_bsize =
     436                                (unsigned long) block_size;
     437                        st->f_blocks =
     438                                (fsblkcnt_t) total_blocks;
     439                        st->f_bfree =
     440                                (fsblkcnt_t) blocks_available;
     441                        st->f_bavail =
     442                                (fsblkcnt_t) user_blocks_available;
     443                        st->f_files =
     444                                (fsfilcnt_t) total_file_nodes;
     445                        st->f_ffree =
     446                                (fsfilcnt_t) free_file_nodes;
     447#if HAVE_FSID_INT
     448                        st->f_fsid =
     449                                (unsigned long) fs_identifier;
     450#endif
     451                }
     452        }
     453
     454        /* See if the share is case sensitive */
     455        if (!cli_get_fs_attr_info(cli, &fs_attrs)) {
     456                /*
     457                 * We can't determine the case sensitivity of
     458                 * the share. We have no choice but to use the
     459                 * user-specified case sensitivity setting.
     460                 */
     461                if (! smbc_getOptionCaseSensitive(context)) {
     462                        flags |= SMBC_VFS_FEATURE_CASE_INSENSITIVE;
     463                }
     464        } else {
     465                if (! (fs_attrs & FILE_CASE_SENSITIVE_SEARCH)) {
     466                        flags |= SMBC_VFS_FEATURE_CASE_INSENSITIVE;
     467                }
     468        }
     469
     470        /* See if DFS is supported */
     471        if ((cli->capabilities & CAP_DFS) &&  cli->dfsroot) {
     472                flags |= SMBC_VFS_FEATURE_DFS;
     473        }
     474
     475#if HAVE_STATVFS_F_FLAG
     476        st->f_flag = flags;
     477#elif HAVE_STATVFS_F_FLAGS
     478        st->f_flags = flags;
     479#endif
     480
     481        return 0;
     482}
  • branches/samba-3.3.x/source/libsmb/libsmb_xattr.c

    r206 r221  
    12741274                                                            ",%s:%lu",
    12751275                                                            attr_strings.create_time_attr,
    1276                                                             create_time);
     1276                                                            (unsigned long) create_time);
    12771277                                        if (!p) {
    12781278                                                errno = ENOMEM;
     
    12841284                                                     ",%s:%lu",
    12851285                                                     attr_strings.create_time_attr,
    1286                                                      create_time);
     1286                                                     (unsigned long) create_time);
    12871287                                }
    12881288                        } else if (StrCaseCmp(name, attr_strings.create_time_attr) == 0) {
    12891289                                if (determine_size) {
    1290                                         p = talloc_asprintf(ctx, "%lu", create_time);
     1290                                        p = talloc_asprintf(ctx, "%lu", (unsigned long) create_time);
    12911291                                        if (!p) {
    12921292                                                errno = ENOMEM;
     
    12961296                                } else {
    12971297                                        n = snprintf(buf, bufsize,
    1298                                                      "%lu", create_time);
     1298                                                     "%lu", (unsigned long) create_time);
    12991299                                }
    13001300                        }
     
    13161316                                                            ",%s:%lu",
    13171317                                                            attr_strings.access_time_attr,
    1318                                                             access_time);
     1318                                                            (unsigned long) access_time);
    13191319                                        if (!p) {
    13201320                                                errno = ENOMEM;
     
    13261326                                                     ",%s:%lu",
    13271327                                                     attr_strings.access_time_attr,
    1328                                                      access_time);
     1328                                                     (unsigned long) access_time);
    13291329                                }
    13301330                        } else if (StrCaseCmp(name, attr_strings.access_time_attr) == 0) {
    13311331                                if (determine_size) {
    1332                                         p = talloc_asprintf(ctx, "%lu", access_time);
     1332                                        p = talloc_asprintf(ctx, "%lu", (unsigned long) access_time);
    13331333                                        if (!p) {
    13341334                                                errno = ENOMEM;
     
    13381338                                } else {
    13391339                                        n = snprintf(buf, bufsize,
    1340                                                      "%lu", access_time);
     1340                                                     "%lu", (unsigned long) access_time);
    13411341                                }
    13421342                        }
     
    13581358                                                            ",%s:%lu",
    13591359                                                            attr_strings.write_time_attr,
    1360                                                             write_time);
     1360                                                            (unsigned long) write_time);
    13611361                                        if (!p) {
    13621362                                                errno = ENOMEM;
     
    13681368                                                     ",%s:%lu",
    13691369                                                     attr_strings.write_time_attr,
    1370                                                      write_time);
     1370                                                     (unsigned long) write_time);
    13711371                                }
    13721372                        } else if (StrCaseCmp(name, attr_strings.write_time_attr) == 0) {
    13731373                                if (determine_size) {
    1374                                         p = talloc_asprintf(ctx, "%lu", write_time);
     1374                                        p = talloc_asprintf(ctx, "%lu", (unsigned long) write_time);
    13751375                                        if (!p) {
    13761376                                                errno = ENOMEM;
     
    13801380                                } else {
    13811381                                        n = snprintf(buf, bufsize,
    1382                                                      "%lu", write_time);
     1382                                                     "%lu", (unsigned long) write_time);
    13831383                                }
    13841384                        }
     
    14001400                                                            ",%s:%lu",
    14011401                                                            attr_strings.change_time_attr,
    1402                                                             change_time);
     1402                                                            (unsigned long) change_time);
    14031403                                        if (!p) {
    14041404                                                errno = ENOMEM;
     
    14101410                                                     ",%s:%lu",
    14111411                                                     attr_strings.change_time_attr,
    1412                                                      change_time);
     1412                                                     (unsigned long) change_time);
    14131413                                }
    14141414                        } else if (StrCaseCmp(name, attr_strings.change_time_attr) == 0) {
    14151415                                if (determine_size) {
    1416                                         p = talloc_asprintf(ctx, "%lu", change_time);
     1416                                        p = talloc_asprintf(ctx, "%lu", (unsigned long) change_time);
    14171417                                        if (!p) {
    14181418                                                errno = ENOMEM;
     
    14221422                                } else {
    14231423                                        n = snprintf(buf, bufsize,
    1424                                                      "%lu", change_time);
     1424                                                     "%lu", (unsigned long) change_time);
    14251425                                }
    14261426                        }
     
    15021502         POLICY_HND *pol,
    15031503         const char *filename,
    1504          const char *the_acl,
     1504         char *the_acl,
    15051505         int mode,
    15061506         int flags)
     
    15321532                }
    15331533               
    1534                 sd = sec_desc_parse(ctx, ipc_cli, pol, numeric,
    1535                                     CONST_DISCARD(char *, the_acl));
     1534                sd = sec_desc_parse(ctx, ipc_cli, pol, numeric, the_acl);
    15361535               
    15371536                if (!sd) {
     
    21152114               
    21162115                /* Yup. */
     2116                char *filename = (char *) name;
    21172117                ret = cacl_get(context, talloc_tos(), srv,
    21182118                               ipc_srv == NULL ? NULL : ipc_srv->cli,
    21192119                               &ipc_srv->pol, path,
    2120                                CONST_DISCARD(char *, name),
    2121                                CONST_DISCARD(char *, value), size);
     2120                               filename,
     2121                               CONST_DISCARD(char *, value),
     2122                               size);
    21222123                if (ret < 0 && errno == 0) {
    21232124                        errno = SMBC_errno(context, srv->cli);
     
    22382239                ret = cacl_set(talloc_tos(), srv->cli,
    22392240                               ipc_srv->cli, &ipc_srv->pol, path,
    2240                                name + 19, SMBC_XATTR_MODE_REMOVE, 0);
     2241                               CONST_DISCARD(char *, name) + 19,
     2242                               SMBC_XATTR_MODE_REMOVE, 0);
    22412243                TALLOC_FREE(frame);
    22422244                return ret;
  • branches/samba-3.3.x/source/libsmb/namequery.c

    r206 r221  
    15031503
    15041504        DEBUG(10, ("internal_resolve_name: looking up %s#%x (sitename %s)\n",
    1505                         name, name_type, sitename ? sitename : NULL));
     1505                        name, name_type, sitename ? sitename : "(null)"));
    15061506
    15071507        if (is_ipaddress(name)) {
     
    21422142                        bool ads_only )
    21432143{
    2144         bool ordered;
     2144        bool ordered = false;
    21452145        NTSTATUS status;
    21462146        enum dc_lookup_type lookup_type = DC_NORMAL_LOOKUP;
Note: See TracChangeset for help on using the changeset viewer.