Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

Location:
vendor/current/source3/lib
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/ctdbd_conn.c

    r740 r746  
    12011201        struct ctdbd_traverse_state state;
    12021202
     1203        become_root();
    12031204        status = ctdbd_init_connection(NULL, &conn);
     1205        unbecome_root();
    12041206        if (!NT_STATUS_IS_OK(status)) {
    12051207                DEBUG(0, ("ctdbd_init_connection failed: %s\n",
  • vendor/current/source3/lib/dbwrap_ctdb.c

    r740 r746  
    2323#include "lib/util/tdb_wrap.h"
    2424#include "util_tdb.h"
     25
    2526#ifdef CLUSTER_SUPPORT
    2627#include "ctdb.h"
     
    12471248}
    12481249
     1250/* wrapper to use traverse_persistent_callback with dbwrap */
     1251static int traverse_persistent_callback_dbwrap(struct db_record *rec, void* data)
     1252{
     1253        return traverse_persistent_callback(NULL, rec->key, rec->value, data);
     1254}
     1255
     1256
    12491257static int db_ctdb_traverse(struct db_context *db,
    12501258                            int (*fn)(struct db_record *rec,
     
    12611269
    12621270        if (db->persistent) {
     1271                struct tdb_context *ltdb = ctx->wtdb->tdb;
     1272                int ret;
     1273
    12631274                /* for persistent databases we don't need to do a ctdb traverse,
    12641275                   we can do a faster local traverse */
    1265                 return tdb_traverse(ctx->wtdb->tdb, traverse_persistent_callback, &state);
     1276                ret = tdb_traverse(ltdb, traverse_persistent_callback, &state);
     1277                if (ret < 0) {
     1278                        return ret;
     1279                }
     1280                if (ctx->transaction && ctx->transaction->m_write) {
     1281                        /*
     1282                         * we now have to handle keys not yet
     1283                         * present at transaction start
     1284                         */
     1285                        struct db_context *newkeys = db_open_rbt(talloc_tos());
     1286                        struct ctdb_marshall_buffer *mbuf = ctx->transaction->m_write;
     1287                        struct ctdb_rec_data *rec=NULL;
     1288                        NTSTATUS status;
     1289                        int i;
     1290                        int count = 0;
     1291
     1292                        if (newkeys == NULL) {
     1293                                return -1;
     1294                        }
     1295
     1296                        for (i=0; i<mbuf->count; i++) {
     1297                                TDB_DATA key;
     1298                                rec =db_ctdb_marshall_loop_next(mbuf, rec,
     1299                                                                NULL, NULL,
     1300                                                                &key, NULL);
     1301                                SMB_ASSERT(rec != NULL);
     1302
     1303                                if (!tdb_exists(ltdb, key)) {
     1304                                        dbwrap_store(newkeys, key, tdb_null, 0);
     1305                                }
     1306                        }
     1307                        status = dbwrap_traverse(newkeys,
     1308                                                 traverse_persistent_callback_dbwrap,
     1309                                                 &state,
     1310                                                 &count);
     1311                        talloc_free(newkeys);
     1312                        if (!NT_STATUS_IS_OK(status)) {
     1313                                return -1;
     1314                        }
     1315                        ret += count;
     1316                }
     1317                return ret;
    12661318        }
    12671319
  • vendor/current/source3/lib/dbwrap_util.c

    r740 r746  
    447447NTSTATUS dbwrap_traverse(struct db_context *db,
    448448                         int (*f)(struct db_record*, void*),
    449                          void *private_data)
     449                         void *private_data,
     450                         int *count)
    450451{
    451452        int ret = db->traverse(db, f, private_data);
    452         return (ret == -1) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK;
    453 }
    454 
    455 
    456 
     453
     454        if (ret < 0) {
     455                return NT_STATUS_INTERNAL_DB_CORRUPTION;
     456        }
     457
     458        if (count != NULL) {
     459                *count = ret;
     460        }
     461
     462        return NT_STATUS_OK;
     463}
    457464
    458465NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key)
  • vendor/current/source3/lib/filename_util.c

    r740 r746  
    4848/**
    4949 * There are actually legitimate callers of this such as functions that
    50  * enumerate streams using the SMB_VFS_STREAMINFO interface and then want to
     50 * enumerate streams using the vfs_streaminfo interface and then want to
    5151 * operate on each stream.
    5252 */
  • vendor/current/source3/lib/fncall.c

    r740 r746  
    281281        int job_id;
    282282
    283         job_id = pthreadpool_finished_job(ctx->pool);
    284         if (job_id <= 0) {
     283        if (pthreadpool_finished_job(ctx->pool, &job_id) != 0) {
    285284                return;
    286285        }
  • vendor/current/source3/lib/ldb_compat.c

    r740 r746  
    8585}
    8686
    87 
    88 
     87static bool need_encode(unsigned char cval)
     88{
     89        if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) {
     90                return true;
     91        }
     92        return false;
     93}
    8994
    9095/*
     
    100105
    101106        for (i=0;i<val.length;i++) {
    102                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     107                if (need_encode(buf[i])) {
    103108                        len += 2;
    104109                }
     
    109114        len = 0;
    110115        for (i=0;i<val.length;i++) {
    111                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     116                if (need_encode(buf[i])) {
    112117                        snprintf(ret+len, 4, "\\%02X", buf[i]);
    113118                        len += 3;
  • vendor/current/source3/lib/netapi/netapi.c

    r740 r746  
    104104        NET_API_STATUS status;
    105105        struct libnetapi_ctx *ctx = NULL;
    106         char *krb5_cc_env = NULL;
    107106
    108107        frame = talloc_stackframe();
     
    115114
    116115        BlockSignals(True, SIGPIPE);
    117 
    118         krb5_cc_env = getenv(KRB5_ENV_CCNAME);
    119         if (!krb5_cc_env || (strlen(krb5_cc_env) == 0)) {
    120                 ctx->krb5_cc_env = talloc_strdup(frame, "MEMORY:libnetapi");
    121                 setenv(KRB5_ENV_CCNAME, ctx->krb5_cc_env, 1);
    122         }
    123116
    124117        if (getenv("USER")) {
     
    267260}
    268261
     262/****************************************************************
     263****************************************************************/
     264
    269265NET_API_STATUS libnetapi_set_use_ccache(struct libnetapi_ctx *ctx)
    270266{
  • vendor/current/source3/lib/pidfile.c

    r740 r746  
    3131/* return the pid in a pidfile. return 0 if the process (or pidfile)
    3232   does not exist */
    33 pid_t pidfile_pid(const char *name)
     33pid_t pidfile_pid(const char *program_name)
    3434{
    3535        int fd;
     
    3737        pid_t pid;
    3838        unsigned int ret;
     39        char *name;
     40        const char *short_configfile;
    3941        char * pidFile;
    4042
     43        /* Add a suffix to the program name if this is a process with a
     44         * none default configuration file name. */
     45        if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) {
     46                name = SMB_STRDUP(program_name);
     47        } else {
     48                short_configfile = strrchr( get_dyn_CONFIGFILE(), '/');
     49                if (short_configfile == NULL) {
     50                        /* conf file in current directory */
     51                        short_configfile = get_dyn_CONFIGFILE();
     52                } else {
     53                        /* full/relative path provided */
     54                        short_configfile++;
     55                }
     56                if (asprintf(&name, "%s-%s", program_name,
     57                                short_configfile) == -1) {
     58                        smb_panic("asprintf failed");
     59                }
     60        }
     61
    4162        if (asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name) == -1) {
     63                SAFE_FREE(name);
    4264                return 0;
    4365        }
     66
     67        SAFE_FREE(name);
    4468
    4569        fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
  • vendor/current/source3/lib/pthreadpool/pthreadpool.c

    r740 r746  
    285285 */
    286286
    287 int pthreadpool_finished_job(struct pthreadpool *pool)
    288 {
    289         int result;
     287int pthreadpool_finished_job(struct pthreadpool *pool, int *jobid)
     288{
     289        int ret_jobid;
    290290        ssize_t nread;
    291291
     
    294294
    295295        while ((nread == -1) && (errno == EINTR)) {
    296                 nread = read(pool->sig_pipe[0], &result, sizeof(int));
     296                nread = read(pool->sig_pipe[0], &ret_jobid, sizeof(int));
    297297        }
    298298        if (nread == -1) {
     
    302302                return EINVAL;
    303303        }
    304         return result;
     304        *jobid = ret_jobid;
     305        return 0;
    305306}
    306307
  • vendor/current/source3/lib/pthreadpool/pthreadpool.h

    r740 r746  
    9191 *
    9292 * @param[in]   pool            The pool to query for finished jobs
    93  * @return                      The job_id of the finished job
     93 * @param[out]  pjobid          The job_id of the finished job
     94 * @return                      success: 0, failure: errno
    9495 */
    95 int pthreadpool_finished_job(struct pthreadpool *pool);
     96int pthreadpool_finished_job(struct pthreadpool *pool, int *jobid);
    9697
    9798#endif
  • vendor/current/source3/lib/pthreadpool/tests.c

    r740 r746  
    6969
    7070        for (i=0; i<num_jobs; i++) {
    71                 ret = pthreadpool_finished_job(p);
    72                 if ((ret < 0) || (ret >= num_jobs)) {
    73                         fprintf(stderr, "invalid job number %d\n", ret);
    74                         return -1;
    75                 }
    76                 finished[ret] += 1;
     71                int jobid = -1;
     72                ret = pthreadpool_finished_job(p, &jobid);
     73                if ((ret != 0) || (jobid >= num_jobs)) {
     74                        fprintf(stderr, "invalid job number %d\n", jobid);
     75                        return -1;
     76                }
     77                finished[jobid] += 1;
    7778        }
    7879
     
    276277
    277278                for (j=0; j<num_pools; j++) {
     279                        int jobid = -1;
    278280
    279281                        if ((pfds[j].revents & (POLLIN|POLLHUP)) == 0) {
     
    281283                        }
    282284
    283                         ret = pthreadpool_finished_job(pools[j]);
    284                         if ((ret < 0) || (ret >= num_jobs * num_threads)) {
     285                        ret = pthreadpool_finished_job(pools[j], &jobid);
     286                        if ((ret != 0) || (jobid >= num_jobs * num_threads)) {
    285287                                fprintf(stderr, "invalid job number %d\n",
    286                                         ret);
     288                                        jobid);
    287289                                return -1;
    288290                        }
    289                         finished[ret] += 1;
     291                        finished[jobid] += 1;
    290292                        received += 1;
    291293                }
  • vendor/current/source3/lib/recvfile.c

    r740 r746  
    3131 * as we're below the Samba vfs layer.
    3232 *
    33  * If tofd is -1 we just drain the incoming socket of count
    34  * bytes without writing to the outgoing fd.
    35  * If a write fails we do the same (to cope with disk full)
    36  * errors.
    37  *
    3833 * Returns -1 on short reads from fromfd (read error)
    3934 * and sets errno.
    4035 *
    4136 * Returns number of bytes written to 'tofd'
    42  * or thrown away if 'tofd == -1'.
    4337 * return != count then sets errno.
    4438 * Returns count if complete success.
     
    9791                num_written = 0;
    9892
    99                 while (num_written < read_ret) {
     93                /* Don't write any more after a write error. */
     94                while (tofd != -1 && (num_written < read_ret)) {
    10095                        ssize_t write_ret;
    10196
    102                         if (tofd == -1) {
    103                                 write_ret = read_ret;
    104                         } else {
    105                                 /* Write to file - ignore EINTR. */
    106                                 write_ret = sys_write(tofd,
    107                                                 buffer + num_written,
    108                                                 read_ret - num_written);
    109 
    110                                 if (write_ret <= 0) {
    111                                         /* write error - stop writing. */
    112                                         tofd = -1;
    113                                         saved_errno = errno;
    114                                         continue;
    115                                 }
     97                        /* Write to file - ignore EINTR. */
     98                        write_ret = sys_write(tofd,
     99                                        buffer + num_written,
     100                                        read_ret - num_written);
     101
     102                        if (write_ret <= 0) {
     103                                /* write error - stop writing. */
     104                                tofd = -1;
     105                                if (total_written == 0) {
     106                                        /* Ensure we return
     107                                           -1 if the first
     108                                           write failed. */
     109                                        total_written = -1;
     110                                }
     111                                saved_errno = errno;
     112                                break;
    116113                        }
    117114
     
    215212
    216213 done:
    217         if (total_written < count) {
     214        if (count) {
    218215                int saved_errno = errno;
    219                 if (drain_socket(fromfd, count-total_written) !=
    220                                 count-total_written) {
     216                if (drain_socket(fromfd, count) != count) {
    221217                        /* socket is dead. */
    222218                        return -1;
     
    244240/*****************************************************************
    245241 Throw away "count" bytes from the client socket.
     242 Returns count or -1 on error.
    246243*****************************************************************/
    247244
    248245ssize_t drain_socket(int sockfd, size_t count)
    249246{
    250         return default_sys_recvfile(sockfd, -1, (SMB_OFF_T)-1, count);
    251 }
     247        size_t total = 0;
     248        size_t bufsize = MIN(TRANSFER_BUF_SIZE,count);
     249        char *buffer = NULL;
     250
     251        if (count == 0) {
     252                return 0;
     253        }
     254
     255        buffer = SMB_MALLOC_ARRAY(char, bufsize);
     256        if (buffer == NULL) {
     257                return -1;
     258        }
     259
     260        while (total < count) {
     261                ssize_t read_ret;
     262                size_t toread = MIN(bufsize,count - total);
     263
     264                /* Read from socket - ignore EINTR. */
     265                read_ret = sys_read(sockfd, buffer, toread);
     266                if (read_ret <= 0) {
     267                        /* EOF or socket error. */
     268                        free(buffer);
     269                        return -1;
     270                }
     271                total += read_ret;
     272        }
     273
     274        free(buffer);
     275        return count;
     276}
  • vendor/current/source3/lib/secdesc.c

    r740 r746  
    535535        const struct security_acl *the_acl = parent_ctr->dacl;
    536536
     537        if (the_acl == NULL) {
     538                return false;
     539        }
     540
    537541        for (i = 0; i < the_acl->num_aces; i++) {
    538542                const struct security_ace *ace = &the_acl->aces[i];
     
    560564        struct security_ace *new_ace_list = NULL;
    561565        unsigned int new_ace_list_ndx = 0, i;
     566        bool set_inherited_flags = (parent_ctr->type & SEC_DESC_DACL_AUTO_INHERITED);
    562567
    563568        *ppsd = NULL;
     
    622627                        /* First add the regular ACE entry. */
    623628                        init_sec_ace(new_ace, ptrustee, ace->type,
    624                                 ace->access_mask, 0);
     629                                ace->access_mask,
     630                                set_inherited_flags ? SEC_ACE_FLAG_INHERITED_ACE : 0);
    625631
    626632                        DEBUG(5,("se_create_child_secdesc(): %s:%d/0x%02x/0x%08x"
     
    645651
    646652                init_sec_ace(new_ace, ptrustee, ace->type,
    647                              ace->access_mask, new_flags);
     653                                ace->access_mask, new_flags |
     654                                (set_inherited_flags ? SEC_ACE_FLAG_INHERITED_ACE : 0));
    648655
    649656                DEBUG(5, ("se_create_child_secdesc(): %s:%d/0x%02x/0x%08x "
     
    672679        *ppsd = make_sec_desc(ctx,
    673680                        SECURITY_DESCRIPTOR_REVISION_1,
    674                         SEC_DESC_SELF_RELATIVE|SEC_DESC_DACL_PRESENT,
     681                        SEC_DESC_SELF_RELATIVE|SEC_DESC_DACL_PRESENT|
     682                        (set_inherited_flags ? SEC_DESC_DACL_AUTO_INHERITED : 0),
    675683                        owner_sid,
    676684                        group_sid,
  • vendor/current/source3/lib/serverid.c

    r740 r746  
    234234        TDB_DATA tdbkey;
    235235
    236         if (lp_clustering() && !process_exists(*id)) {
    237                 return false;
     236        if (procid_is_me(id)) {
     237                return true;
     238        }
     239
     240        if (!process_exists(*id)) {
     241                return false;
     242        }
     243
     244        if (id->unique_id == SERVERID_UNIQUE_ID_NOT_TO_VERIFY) {
     245                return true;
    238246        }
    239247
     
    352360        return db->traverse(db, serverid_traverse_fn, &state);
    353361}
     362
     363uint64_t serverid_get_random_unique_id(void)
     364{
     365        uint64_t unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY;
     366
     367        while (unique_id == SERVERID_UNIQUE_ID_NOT_TO_VERIFY) {
     368                generate_random_buffer((uint8_t *)&unique_id,
     369                                        sizeof(unique_id));
     370        }
     371
     372        return unique_id;
     373}
  • vendor/current/source3/lib/substitute.c

    r740 r746  
    196196
    197197static char sub_peeraddr[INET6_ADDRSTRLEN];
    198 static const char *sub_peername = "";
     198static const char *sub_peername = NULL;
    199199static char sub_sockaddr[INET6_ADDRSTRLEN];
    200200
     
    209209        strlcpy(sub_peeraddr, addr, sizeof(sub_peeraddr));
    210210
     211        if (sub_peername != NULL &&
     212                        sub_peername != sub_peeraddr) {
     213                free(discard_const_p(char,sub_peername));
     214                sub_peername = NULL;
     215        }
    211216        sub_peername = SMB_STRDUP(peername);
    212217        if (sub_peername == NULL) {
     
    647652                case 'M' :
    648653                        a_string = realloc_string_sub(a_string, "%M",
    649                                                       sub_peername);
     654                                                      sub_peername ? sub_peername : "");
    650655                        break;
    651656                case 'R' :
  • vendor/current/source3/lib/sysquotas.c

    r740 r746  
    177177#ifdef HAVE_XFS_QUOTAS
    178178        {"xfs", sys_get_xfs_quota,      sys_set_xfs_quota},
     179        {"gfs", sys_get_xfs_quota,      sys_set_xfs_quota},
     180        {"gfs2", sys_get_xfs_quota,     sys_set_xfs_quota},
    179181#endif /* HAVE_XFS_QUOTAS */
    180182#ifdef HAVE_NFS_QUOTAS
    181183        {"nfs", sys_get_nfs_quota,      sys_set_nfs_quota},
     184        {"nfs4", sys_get_nfs_quota,     sys_set_nfs_quota},
    182185#endif /* HAVE_NFS_QUOTAS */
    183186        {NULL,  NULL,                   NULL}
  • vendor/current/source3/lib/system.c

    r740 r746  
    770770#elif defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(LARGE_SMB_OFF_T) && defined(HAVE_FSEEKO64)
    771771        return fseeko64(fp, offset, whence);
     772#elif defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(LARGE_SMB_OFF_T) && defined(HAVE_FSEEKO)
     773        return fseeko(fp, offset, whence);
    772774#else
    773775        return fseek(fp, offset, whence);
  • vendor/current/source3/lib/util.c

    r740 r746  
    2929#include "../lib/util/util_pw.h"
    3030#include "messages.h"
     31#include "libcli/security/security.h"
    3132
    3233extern char *global_clobber_region_function;
     
    27232724        return ptr;
    27242725}
     2726
     2727/*******************************************************************
     2728 Return True if the filename is one of the special executable types.
     2729********************************************************************/
     2730
     2731bool is_executable(const char *fname)
     2732{
     2733        if ((fname = strrchr_m(fname,'.'))) {
     2734                if (strequal(fname,".com") ||
     2735                    strequal(fname,".dll") ||
     2736                    strequal(fname,".exe") ||
     2737                    strequal(fname,".sym")) {
     2738                        return True;
     2739                }
     2740        }
     2741        return False;
     2742}
     2743
     2744/****************************************************************************
     2745 Open a file with a share mode - old openX method - map into NTCreate.
     2746****************************************************************************/
     2747
     2748bool map_open_params_to_ntcreate(const char *smb_base_fname,
     2749                                 int deny_mode, int open_func,
     2750                                 uint32 *paccess_mask,
     2751                                 uint32 *pshare_mode,
     2752                                 uint32 *pcreate_disposition,
     2753                                 uint32 *pcreate_options,
     2754                                 uint32_t *pprivate_flags)
     2755{
     2756        uint32 access_mask;
     2757        uint32 share_mode;
     2758        uint32 create_disposition;
     2759        uint32 create_options = FILE_NON_DIRECTORY_FILE;
     2760        uint32_t private_flags = 0;
     2761
     2762        DEBUG(10,("map_open_params_to_ntcreate: fname = %s, deny_mode = 0x%x, "
     2763                  "open_func = 0x%x\n",
     2764                  smb_base_fname, (unsigned int)deny_mode,
     2765                  (unsigned int)open_func ));
     2766
     2767        /* Create the NT compatible access_mask. */
     2768        switch (GET_OPENX_MODE(deny_mode)) {
     2769                case DOS_OPEN_EXEC: /* Implies read-only - used to be FILE_READ_DATA */
     2770                case DOS_OPEN_RDONLY:
     2771                        access_mask = FILE_GENERIC_READ;
     2772                        break;
     2773                case DOS_OPEN_WRONLY:
     2774                        access_mask = FILE_GENERIC_WRITE;
     2775                        break;
     2776                case DOS_OPEN_RDWR:
     2777                case DOS_OPEN_FCB:
     2778                        access_mask = FILE_GENERIC_READ|FILE_GENERIC_WRITE;
     2779                        break;
     2780                default:
     2781                        DEBUG(10,("map_open_params_to_ntcreate: bad open mode = 0x%x\n",
     2782                                  (unsigned int)GET_OPENX_MODE(deny_mode)));
     2783                        return False;
     2784        }
     2785
     2786        /* Create the NT compatible create_disposition. */
     2787        switch (open_func) {
     2788                case OPENX_FILE_EXISTS_FAIL|OPENX_FILE_CREATE_IF_NOT_EXIST:
     2789                        create_disposition = FILE_CREATE;
     2790                        break;
     2791
     2792                case OPENX_FILE_EXISTS_OPEN:
     2793                        create_disposition = FILE_OPEN;
     2794                        break;
     2795
     2796                case OPENX_FILE_EXISTS_OPEN|OPENX_FILE_CREATE_IF_NOT_EXIST:
     2797                        create_disposition = FILE_OPEN_IF;
     2798                        break;
     2799
     2800                case OPENX_FILE_EXISTS_TRUNCATE:
     2801                        create_disposition = FILE_OVERWRITE;
     2802                        break;
     2803
     2804                case OPENX_FILE_EXISTS_TRUNCATE|OPENX_FILE_CREATE_IF_NOT_EXIST:
     2805                        create_disposition = FILE_OVERWRITE_IF;
     2806                        break;
     2807
     2808                default:
     2809                        /* From samba4 - to be confirmed. */
     2810                        if (GET_OPENX_MODE(deny_mode) == DOS_OPEN_EXEC) {
     2811                                create_disposition = FILE_CREATE;
     2812                                break;
     2813                        }
     2814                        DEBUG(10,("map_open_params_to_ntcreate: bad "
     2815                                  "open_func 0x%x\n", (unsigned int)open_func));
     2816                        return False;
     2817        }
     2818
     2819        /* Create the NT compatible share modes. */
     2820        switch (GET_DENY_MODE(deny_mode)) {
     2821                case DENY_ALL:
     2822                        share_mode = FILE_SHARE_NONE;
     2823                        break;
     2824
     2825                case DENY_WRITE:
     2826                        share_mode = FILE_SHARE_READ;
     2827                        break;
     2828
     2829                case DENY_READ:
     2830                        share_mode = FILE_SHARE_WRITE;
     2831                        break;
     2832
     2833                case DENY_NONE:
     2834                        share_mode = FILE_SHARE_READ|FILE_SHARE_WRITE;
     2835                        break;
     2836
     2837                case DENY_DOS:
     2838                        private_flags |= NTCREATEX_OPTIONS_PRIVATE_DENY_DOS;
     2839                        if (is_executable(smb_base_fname)) {
     2840                                share_mode = FILE_SHARE_READ|FILE_SHARE_WRITE;
     2841                        } else {
     2842                                if (GET_OPENX_MODE(deny_mode) == DOS_OPEN_RDONLY) {
     2843                                        share_mode = FILE_SHARE_READ;
     2844                                } else {
     2845                                        share_mode = FILE_SHARE_NONE;
     2846                                }
     2847                        }
     2848                        break;
     2849
     2850                case DENY_FCB:
     2851                        private_flags |= NTCREATEX_OPTIONS_PRIVATE_DENY_FCB;
     2852                        share_mode = FILE_SHARE_NONE;
     2853                        break;
     2854
     2855                default:
     2856                        DEBUG(10,("map_open_params_to_ntcreate: bad deny_mode 0x%x\n",
     2857                                (unsigned int)GET_DENY_MODE(deny_mode) ));
     2858                        return False;
     2859        }
     2860
     2861        DEBUG(10,("map_open_params_to_ntcreate: file %s, access_mask = 0x%x, "
     2862                  "share_mode = 0x%x, create_disposition = 0x%x, "
     2863                  "create_options = 0x%x private_flags = 0x%x\n",
     2864                  smb_base_fname,
     2865                  (unsigned int)access_mask,
     2866                  (unsigned int)share_mode,
     2867                  (unsigned int)create_disposition,
     2868                  (unsigned int)create_options,
     2869                  (unsigned int)private_flags));
     2870
     2871        if (paccess_mask) {
     2872                *paccess_mask = access_mask;
     2873        }
     2874        if (pshare_mode) {
     2875                *pshare_mode = share_mode;
     2876        }
     2877        if (pcreate_disposition) {
     2878                *pcreate_disposition = create_disposition;
     2879        }
     2880        if (pcreate_options) {
     2881                *pcreate_options = create_options;
     2882        }
     2883        if (pprivate_flags) {
     2884                *pprivate_flags = private_flags;
     2885        }
     2886
     2887        return True;
     2888
     2889}
  • vendor/current/source3/lib/util_sec.c

    r414 r746  
    335335
    336336#if USE_SETRESUID
    337         setresuid(geteuid(), -1, -1);
     337        setresuid(uid, uid, -1);
    338338#endif
    339339
  • vendor/current/source3/lib/util_sid.c

    r740 r746  
    131131                              struct dom_sid **user_sids,
    132132                              uint32_t *num_user_sids,
    133                               bool include_user_group_rid,
    134                               bool skip_ressource_groups)
     133                              bool include_user_group_rid)
    135134{
    136135        NTSTATUS status;
     
    192191
    193192        for (i = 0; i < info3->sidcount; i++) {
    194 
    195                 if (skip_ressource_groups &&
    196                     (info3->sids[i].attributes & SE_GROUP_RESOURCE)) {
    197                         continue;
    198                 }
    199 
    200193                status = add_sid_to_array(mem_ctx, info3->sids[i].sid,
    201194                                      &sid_array, &num_sids);
  • vendor/current/source3/lib/util_sock.c

    r740 r746  
    137137#ifdef TCP_QUICKACK
    138138  {"TCP_QUICKACK", IPPROTO_TCP, TCP_QUICKACK, 0, OPT_BOOL},
     139#endif
     140#ifdef TCP_NODELAYACK
     141  {"TCP_NODELAYACK", IPPROTO_TCP, TCP_NODELAYACK, 0, OPT_BOOL},
    139142#endif
    140143#ifdef TCP_KEEPALIVE_THRESHOLD
Note: See TracChangeset for help on using the changeset viewer.