Ignore:
Timestamp:
May 12, 2014, 8:58:38 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.6: updated vendor to latest version

Location:
vendor/current/source3/lib
Files:
1 deleted
11 edited

Legend:

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

    r740 r860  
    4545}
    4646
    47 NTSTATUS can_delete_directory(struct connection_struct *conn,
    48                                 const char *dirname)
     47NTSTATUS can_delete_directory_fsp(files_struct *fsp)
    4948{
    5049        return NT_STATUS_OK;
  • vendor/current/source3/lib/netapi/group.c

    r740 r860  
    310310        }
    311311
     312        if (rids.count != 1) {
     313                werr = WERR_BAD_NET_RESP;
     314                goto done;
     315        }
     316        if (types.count != 1) {
     317                werr = WERR_BAD_NET_RESP;
     318                goto done;
     319        }
     320
    312321        if (types.ids[0] != SID_NAME_DOM_GRP) {
    313322                werr = WERR_INVALID_DATATYPE;
     
    385394        if (!NT_STATUS_IS_OK(result)) {
    386395                werr = ntstatus_to_werror(result);
     396                goto done;
     397        }
     398        if (names.count != rid_array->count) {
     399                werr = WERR_BAD_NET_RESP;
     400                goto done;
     401        }
     402        if (member_types.count != rid_array->count) {
     403                werr = WERR_BAD_NET_RESP;
    387404                goto done;
    388405        }
     
    510527        if (!NT_STATUS_IS_OK(result)) {
    511528                werr = ntstatus_to_werror(result);
     529                goto done;
     530        }
     531        if (rids.count != 1) {
     532                werr = WERR_BAD_NET_RESP;
     533                goto done;
     534        }
     535        if (types.count != 1) {
     536                werr = WERR_BAD_NET_RESP;
    512537                goto done;
    513538        }
     
    782807                goto done;
    783808        }
     809        if (rids.count != 1) {
     810                werr = WERR_BAD_NET_RESP;
     811                goto done;
     812        }
     813        if (types.count != 1) {
     814                werr = WERR_BAD_NET_RESP;
     815                goto done;
     816        }
    784817
    785818        if (types.ids[0] != SID_NAME_DOM_GRP) {
     
    922955                goto done;
    923956        }
     957        if (rids.count != 1) {
     958                werr = WERR_BAD_NET_RESP;
     959                goto done;
     960        }
     961        if (types.count != 1) {
     962                werr = WERR_BAD_NET_RESP;
     963                goto done;
     964        }
    924965
    925966        if (types.ids[0] != SID_NAME_DOM_GRP) {
     
    958999        if (!NT_STATUS_IS_OK(result)) {
    9591000                werr = WERR_USER_NOT_FOUND;
     1001                goto done;
     1002        }
     1003        if (rids.count != 1) {
     1004                werr = WERR_BAD_NET_RESP;
     1005                goto done;
     1006        }
     1007        if (types.count != 1) {
     1008                werr = WERR_BAD_NET_RESP;
    9601009                goto done;
    9611010        }
     
    10661115                goto done;
    10671116        }
     1117        if (rids.count != 1) {
     1118                werr = WERR_BAD_NET_RESP;
     1119                goto done;
     1120        }
     1121        if (types.count != 1) {
     1122                werr = WERR_BAD_NET_RESP;
     1123                goto done;
     1124        }
    10681125
    10691126        if (types.ids[0] != SID_NAME_DOM_GRP) {
     
    11031160        if (!NT_STATUS_IS_OK(result)) {
    11041161                werr = WERR_USER_NOT_FOUND;
     1162                goto done;
     1163        }
     1164        if (rids.count != 1) {
     1165                werr = WERR_BAD_NET_RESP;
     1166                goto done;
     1167        }
     1168        if (types.count != 1) {
     1169                werr = WERR_BAD_NET_RESP;
    11051170                goto done;
    11061171        }
     
    15151580                goto done;
    15161581        }
     1582        if (group_rids.count != 1) {
     1583                werr = WERR_BAD_NET_RESP;
     1584                goto done;
     1585        }
     1586        if (name_types.count != 1) {
     1587                werr = WERR_BAD_NET_RESP;
     1588                goto done;
     1589        }
    15171590
    15181591        status = dcerpc_samr_OpenGroup(b, talloc_tos(),
     
    15571630        if (!NT_STATUS_IS_OK(result)) {
    15581631                werr = ntstatus_to_werror(result);
     1632                goto done;
     1633        }
     1634        if (names.count != rid_array->count) {
     1635                werr = WERR_BAD_NET_RESP;
     1636                goto done;
     1637        }
     1638        if (member_types.count != rid_array->count) {
     1639                werr = WERR_BAD_NET_RESP;
    15591640                goto done;
    15601641        }
     
    16901771                goto done;
    16911772        }
     1773        if (group_rids.count != 1) {
     1774                werr = WERR_BAD_NET_RESP;
     1775                goto done;
     1776        }
     1777        if (group_types.count != 1) {
     1778                werr = WERR_BAD_NET_RESP;
     1779                goto done;
     1780        }
    16921781
    16931782        status = dcerpc_samr_OpenGroup(b, talloc_tos(),
     
    17651854        if (!NT_STATUS_IS_OK(result)) {
    17661855                werr = ntstatus_to_werror(result);
     1856                goto done;
     1857        }
     1858
     1859        if (r->in.num_entries != user_rids.count) {
     1860                werr = WERR_BAD_NET_RESP;
     1861                goto done;
     1862        }
     1863        if (r->in.num_entries != name_types.count) {
     1864                werr = WERR_BAD_NET_RESP;
    17671865                goto done;
    17681866        }
  • vendor/current/source3/lib/netapi/localgroup.c

    r740 r860  
    5959                return result;
    6060        }
     61        if (user_rids.count != 1) {
     62                return NT_STATUS_INVALID_NETWORK_RESPONSE;
     63        }
     64        if (name_types.count != 1) {
     65                return NT_STATUS_INVALID_NETWORK_RESPONSE;
     66        }
    6167
    6268        switch (name_types.ids[0]) {
     
    10421048
    10431049        if (count != 1 || sids.count != 1) {
    1044                 return NT_STATUS_NONE_MAPPED;
     1050                return NT_STATUS_INVALID_NETWORK_RESPONSE;
    10451051        }
    10461052
  • vendor/current/source3/lib/netapi/user.c

    r740 r860  
    605605                goto done;
    606606        }
     607        if (user_rids.count != 1) {
     608                werr = WERR_BAD_NET_RESP;
     609                goto done;
     610        }
     611        if (name_types.count != 1) {
     612                werr = WERR_BAD_NET_RESP;
     613                goto done;
     614        }
    607615
    608616        status = dcerpc_samr_OpenUser(b, talloc_tos(),
     
    18041812                goto done;
    18051813        }
     1814        if (user_rids.count != 1) {
     1815                werr = WERR_BAD_NET_RESP;
     1816                goto done;
     1817        }
     1818        if (name_types.count != 1) {
     1819                werr = WERR_BAD_NET_RESP;
     1820                goto done;
     1821        }
    18061822
    18071823        status = libnetapi_samr_lookup_user_map_USER_INFO(ctx, pipe_cli,
     
    19661982        if (!NT_STATUS_IS_OK(result)) {
    19671983                werr = ntstatus_to_werror(result);
     1984                goto done;
     1985        }
     1986        if (user_rids.count != 1) {
     1987                werr = WERR_BAD_NET_RESP;
     1988                goto done;
     1989        }
     1990        if (name_types.count != 1) {
     1991                werr = WERR_BAD_NET_RESP;
    19681992                goto done;
    19691993        }
     
    30273051                goto done;
    30283052        }
     3053        if (user_rids.count != 1) {
     3054                werr = WERR_BAD_NET_RESP;
     3055                goto done;
     3056        }
     3057        if (name_types.count != 1) {
     3058                werr = WERR_BAD_NET_RESP;
     3059                goto done;
     3060        }
    30293061
    30303062        status = dcerpc_samr_OpenUser(b, talloc_tos(),
     
    30803112            !NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED)) {
    30813113                werr = ntstatus_to_werror(result);
     3114                goto done;
     3115        }
     3116        if (names.count != rid_array->count) {
     3117                werr = WERR_BAD_NET_RESP;
     3118                goto done;
     3119        }
     3120        if (types.count != rid_array->count) {
     3121                werr = WERR_BAD_NET_RESP;
    30823122                goto done;
    30833123        }
     
    32023242                goto done;
    32033243        }
     3244        if (user_rids.count != 1) {
     3245                werr = WERR_BAD_NET_RESP;
     3246                goto done;
     3247        }
     3248        if (name_types.count != 1) {
     3249                werr = WERR_BAD_NET_RESP;
     3250                goto done;
     3251        }
    32043252
    32053253        status = dcerpc_samr_OpenUser(b, talloc_tos(),
     
    32603308        if (!NT_STATUS_IS_OK(result)) {
    32613309                werr = ntstatus_to_werror(result);
     3310                goto done;
     3311        }
     3312        if (group_rids.count != r->in.num_entries) {
     3313                werr = WERR_BAD_NET_RESP;
     3314                goto done;
     3315        }
     3316        if (name_types.count != r->in.num_entries) {
     3317                werr = WERR_BAD_NET_RESP;
    32623318                goto done;
    32633319        }
     
    35403596                goto done;
    35413597        }
     3598        if (user_rids.count != 1) {
     3599                werr = WERR_BAD_NET_RESP;
     3600                goto done;
     3601        }
     3602        if (name_types.count != 1) {
     3603                werr = WERR_BAD_NET_RESP;
     3604                goto done;
     3605        }
    35423606
    35433607        status = dcerpc_samr_OpenUser(b, talloc_tos(),
     
    36593723        if (!NT_STATUS_IS_OK(result)) {
    36603724                werr = ntstatus_to_werror(result);
     3725                goto done;
     3726        }
     3727        if (names.count != num_rids) {
     3728                werr = WERR_BAD_NET_RESP;
     3729                goto done;
     3730        }
     3731        if (types.count != num_rids) {
     3732                werr = WERR_BAD_NET_RESP;
    36613733                goto done;
    36623734        }
  • vendor/current/source3/lib/secdesc.c

    r746 r860  
    603603                        new_flags = 0;
    604604                } else {
    605                         new_flags &= ~SEC_ACE_FLAG_INHERIT_ONLY;
     605                        new_flags &= ~(SEC_ACE_FLAG_INHERIT_ONLY|
     606                                        SEC_ACE_FLAG_INHERITED_ACE);
    606607
    607608                        if (!(new_flags & SEC_ACE_FLAG_CONTAINER_INHERIT)) {
  • vendor/current/source3/lib/serverid.c

    r746 r860  
    3535};
    3636
     37static struct db_context *db_ptr = NULL;
     38
     39static struct db_context *serverid_init(TALLOC_CTX *mem_ctx,
     40                                        bool readonly)
     41{
     42        db_ptr = db_open(mem_ctx, lock_path("serverid.tdb"),
     43                         0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
     44                         readonly ? O_RDONLY : O_RDWR | O_CREAT,
     45                         0644);
     46        return db_ptr;
     47}
     48
    3749bool serverid_parent_init(TALLOC_CTX *mem_ctx)
    3850{
    39         struct tdb_wrap *db;
    40 
    4151        /*
    4252         * Open the tdb in the parent process (smbd) so that our
     
    4555         */
    4656
    47         db = tdb_wrap_open(mem_ctx, lock_path("serverid.tdb"),
    48                            0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT,
    49                            0644);
    50         if (db == NULL) {
     57        if (serverid_init(mem_ctx, false) == NULL) {
    5158                DEBUG(1, ("could not open serverid.tdb: %s\n",
    5259                          strerror(errno)));
    5360                return false;
    5461        }
     62
    5563        return true;
    5664}
    5765
     66bool serverid_init_readonly(TALLOC_CTX *mem_ctx)
     67{
     68        if (serverid_init(mem_ctx, true) == NULL) {
     69                DEBUG(1, ("could not open serverid.tdb: %s\n",
     70                          strerror(errno)));
     71                return false;
     72        }
     73
     74        return true;
     75}
     76
    5877static struct db_context *serverid_db(void)
    5978{
    60         static struct db_context *db;
    61 
    62         if (db != NULL) {
    63                 return db;
    64         }
    65         db = db_open(NULL, lock_path("serverid.tdb"), 0,
    66                      TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644);
    67         return db;
     79        if (db_ptr != NULL) {
     80                return db_ptr;
     81        }
     82
     83        return serverid_init(NULL, false);
    6884}
    6985
  • vendor/current/source3/lib/sessionid_tdb.c

    r740 r860  
    2424#include "util_tdb.h"
    2525
     26static struct db_context *session_db_ctx_ptr = NULL;
     27
    2628static struct db_context *session_db_ctx(void)
    2729{
    28         static struct db_context *session_db_ctx_ptr;
     30        return session_db_ctx_ptr;
     31}
    2932
    30         if (session_db_ctx_ptr != NULL) {
    31                 return session_db_ctx_ptr;
    32         }
    33 
     33static struct db_context *session_db_ctx_init(bool readonly)
     34{
    3435        session_db_ctx_ptr = db_open(NULL, lock_path("sessionid.tdb"), 0,
    3536                                     TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_INCOMPATIBLE_HASH,
    36                                      O_RDWR | O_CREAT, 0644);
     37                                     readonly ? O_RDONLY : O_RDWR | O_CREAT, 0644);
    3738        return session_db_ctx_ptr;
    3839}
     
    4041bool sessionid_init(void)
    4142{
    42         if (session_db_ctx() == NULL) {
     43        if (session_db_ctx_init(false) == NULL) {
     44                DEBUG(1,("session_init: failed to open sessionid tdb\n"));
     45                return False;
     46        }
     47
     48        return True;
     49}
     50
     51bool sessionid_init_readonly(void)
     52{
     53        if (session_db_ctx_init(true) == NULL) {
    4354                DEBUG(1,("session_init: failed to open sessionid tdb\n"));
    4455                return False;
  • vendor/current/source3/lib/system.c

    r746 r860  
    883883
    884884/*******************************************************************
    885  An fdopendir wrapper that will deal with 64 bit filesizes.
    886  Ugly hack - we need dirfd for this to work correctly in the
    887  calling code.. JRA.
     885 An fdopendir wrapper.
    888886********************************************************************/
    889887
    890888SMB_STRUCT_DIR *sys_fdopendir(int fd)
    891889{
    892 #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64) && defined(HAVE_DIRFD)
     890#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64)
    893891        return fdopendir64(fd);
    894 #elif defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD)
     892#elif defined(HAVE_FDOPENDIR)
    895893        return fdopendir(fd);
    896894#else
     
    18041802        /* Iterate through extattr(2) namespaces */
    18051803        for(t = 0; t < (sizeof(extattr)/sizeof(extattr[0])); t++) {
     1804                if (t != EXTATTR_NAMESPACE_USER && geteuid() != 0) {
     1805                        /* ignore all but user namespace when we are not root, see bug 10247 */
     1806                        continue;
     1807                }
    18061808                switch(type) {
    18071809#if defined(HAVE_EXTATTR_LIST_FILE)
  • vendor/current/source3/lib/util.c

    r746 r860  
    384384void smb_setlen(char *buf,int len)
    385385{
    386         _smb_setlen(buf,len);
     386        _smb_setlen_large(buf,len);
    387387
    388388        SCVAL(buf,4,0xFF);
  • vendor/current/source3/lib/util_file.c

    r414 r860  
    3939        total = 0;
    4040
    41         while ((n = read(fd, buf, sizeof(buf))) > 0) {
     41        while ((n = sys_read(fd, buf, sizeof(buf))) > 0) {
    4242                p = talloc_realloc(NULL, p, char, total + n + 1);
    4343                if (!p) {
  • vendor/current/source3/lib/util_tsock.c

    r740 r860  
    111111        }
    112112
     113        if (total + more < total) {
     114                tevent_req_error(req, EMSGSIZE);
     115                return;
     116        }
     117
    113118        tmp = talloc_realloc(state, state->buf, uint8_t, total+more);
    114119        if (tevent_req_nomem(tmp, req)) {
Note: See TracChangeset for help on using the changeset viewer.