Changeset 860 for vendor/current/source3/lib
- Timestamp:
- May 12, 2014, 8:58:38 PM (11 years ago)
- Location:
- vendor/current/source3/lib
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/dummysmbd.c
r740 r860 45 45 } 46 46 47 NTSTATUS can_delete_directory(struct connection_struct *conn, 48 const char *dirname) 47 NTSTATUS can_delete_directory_fsp(files_struct *fsp) 49 48 { 50 49 return NT_STATUS_OK; -
vendor/current/source3/lib/netapi/group.c
r740 r860 310 310 } 311 311 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 312 321 if (types.ids[0] != SID_NAME_DOM_GRP) { 313 322 werr = WERR_INVALID_DATATYPE; … … 385 394 if (!NT_STATUS_IS_OK(result)) { 386 395 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; 387 404 goto done; 388 405 } … … 510 527 if (!NT_STATUS_IS_OK(result)) { 511 528 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; 512 537 goto done; 513 538 } … … 782 807 goto done; 783 808 } 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 } 784 817 785 818 if (types.ids[0] != SID_NAME_DOM_GRP) { … … 922 955 goto done; 923 956 } 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 } 924 965 925 966 if (types.ids[0] != SID_NAME_DOM_GRP) { … … 958 999 if (!NT_STATUS_IS_OK(result)) { 959 1000 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; 960 1009 goto done; 961 1010 } … … 1066 1115 goto done; 1067 1116 } 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 } 1068 1125 1069 1126 if (types.ids[0] != SID_NAME_DOM_GRP) { … … 1103 1160 if (!NT_STATUS_IS_OK(result)) { 1104 1161 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; 1105 1170 goto done; 1106 1171 } … … 1515 1580 goto done; 1516 1581 } 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 } 1517 1590 1518 1591 status = dcerpc_samr_OpenGroup(b, talloc_tos(), … … 1557 1630 if (!NT_STATUS_IS_OK(result)) { 1558 1631 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; 1559 1640 goto done; 1560 1641 } … … 1690 1771 goto done; 1691 1772 } 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 } 1692 1781 1693 1782 status = dcerpc_samr_OpenGroup(b, talloc_tos(), … … 1765 1854 if (!NT_STATUS_IS_OK(result)) { 1766 1855 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; 1767 1865 goto done; 1768 1866 } -
vendor/current/source3/lib/netapi/localgroup.c
r740 r860 59 59 return result; 60 60 } 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 } 61 67 62 68 switch (name_types.ids[0]) { … … 1042 1048 1043 1049 if (count != 1 || sids.count != 1) { 1044 return NT_STATUS_ NONE_MAPPED;1050 return NT_STATUS_INVALID_NETWORK_RESPONSE; 1045 1051 } 1046 1052 -
vendor/current/source3/lib/netapi/user.c
r740 r860 605 605 goto done; 606 606 } 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 } 607 615 608 616 status = dcerpc_samr_OpenUser(b, talloc_tos(), … … 1804 1812 goto done; 1805 1813 } 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 } 1806 1822 1807 1823 status = libnetapi_samr_lookup_user_map_USER_INFO(ctx, pipe_cli, … … 1966 1982 if (!NT_STATUS_IS_OK(result)) { 1967 1983 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; 1968 1992 goto done; 1969 1993 } … … 3027 3051 goto done; 3028 3052 } 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 } 3029 3061 3030 3062 status = dcerpc_samr_OpenUser(b, talloc_tos(), … … 3080 3112 !NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED)) { 3081 3113 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; 3082 3122 goto done; 3083 3123 } … … 3202 3242 goto done; 3203 3243 } 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 } 3204 3252 3205 3253 status = dcerpc_samr_OpenUser(b, talloc_tos(), … … 3260 3308 if (!NT_STATUS_IS_OK(result)) { 3261 3309 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; 3262 3318 goto done; 3263 3319 } … … 3540 3596 goto done; 3541 3597 } 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 } 3542 3606 3543 3607 status = dcerpc_samr_OpenUser(b, talloc_tos(), … … 3659 3723 if (!NT_STATUS_IS_OK(result)) { 3660 3724 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; 3661 3733 goto done; 3662 3734 } -
vendor/current/source3/lib/secdesc.c
r746 r860 603 603 new_flags = 0; 604 604 } else { 605 new_flags &= ~SEC_ACE_FLAG_INHERIT_ONLY; 605 new_flags &= ~(SEC_ACE_FLAG_INHERIT_ONLY| 606 SEC_ACE_FLAG_INHERITED_ACE); 606 607 607 608 if (!(new_flags & SEC_ACE_FLAG_CONTAINER_INHERIT)) { -
vendor/current/source3/lib/serverid.c
r746 r860 35 35 }; 36 36 37 static struct db_context *db_ptr = NULL; 38 39 static 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 37 49 bool serverid_parent_init(TALLOC_CTX *mem_ctx) 38 50 { 39 struct tdb_wrap *db;40 41 51 /* 42 52 * Open the tdb in the parent process (smbd) so that our … … 45 55 */ 46 56 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) { 51 58 DEBUG(1, ("could not open serverid.tdb: %s\n", 52 59 strerror(errno))); 53 60 return false; 54 61 } 62 55 63 return true; 56 64 } 57 65 66 bool 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 58 77 static struct db_context *serverid_db(void) 59 78 { 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); 68 84 } 69 85 -
vendor/current/source3/lib/sessionid_tdb.c
r740 r860 24 24 #include "util_tdb.h" 25 25 26 static struct db_context *session_db_ctx_ptr = NULL; 27 26 28 static struct db_context *session_db_ctx(void) 27 29 { 28 static struct db_context *session_db_ctx_ptr; 30 return session_db_ctx_ptr; 31 } 29 32 30 if (session_db_ctx_ptr != NULL) { 31 return session_db_ctx_ptr; 32 } 33 33 static struct db_context *session_db_ctx_init(bool readonly) 34 { 34 35 session_db_ctx_ptr = db_open(NULL, lock_path("sessionid.tdb"), 0, 35 36 TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, 36 O_RDWR | O_CREAT, 0644);37 readonly ? O_RDONLY : O_RDWR | O_CREAT, 0644); 37 38 return session_db_ctx_ptr; 38 39 } … … 40 41 bool sessionid_init(void) 41 42 { 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 51 bool sessionid_init_readonly(void) 52 { 53 if (session_db_ctx_init(true) == NULL) { 43 54 DEBUG(1,("session_init: failed to open sessionid tdb\n")); 44 55 return False; -
vendor/current/source3/lib/system.c
r746 r860 883 883 884 884 /******************************************************************* 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. 888 886 ********************************************************************/ 889 887 890 888 SMB_STRUCT_DIR *sys_fdopendir(int fd) 891 889 { 892 #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64) && defined(HAVE_DIRFD)890 #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64) 893 891 return fdopendir64(fd); 894 #elif defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD)892 #elif defined(HAVE_FDOPENDIR) 895 893 return fdopendir(fd); 896 894 #else … … 1804 1802 /* Iterate through extattr(2) namespaces */ 1805 1803 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 } 1806 1808 switch(type) { 1807 1809 #if defined(HAVE_EXTATTR_LIST_FILE) -
vendor/current/source3/lib/util.c
r746 r860 384 384 void smb_setlen(char *buf,int len) 385 385 { 386 _smb_setlen (buf,len);386 _smb_setlen_large(buf,len); 387 387 388 388 SCVAL(buf,4,0xFF); -
vendor/current/source3/lib/util_file.c
r414 r860 39 39 total = 0; 40 40 41 while ((n = read(fd, buf, sizeof(buf))) > 0) {41 while ((n = sys_read(fd, buf, sizeof(buf))) > 0) { 42 42 p = talloc_realloc(NULL, p, char, total + n + 1); 43 43 if (!p) { -
vendor/current/source3/lib/util_tsock.c
r740 r860 111 111 } 112 112 113 if (total + more < total) { 114 tevent_req_error(req, EMSGSIZE); 115 return; 116 } 117 113 118 tmp = talloc_realloc(state, state->buf, uint8_t, total+more); 114 119 if (tevent_req_nomem(tmp, req)) {
Note:
See TracChangeset
for help on using the changeset viewer.