Exploit databaseDownload repository ZIP
GH-ea821316336f01071e5d83d15c2dd13b
opsxcq/exploit-cve-2017-7494
Sources for CVE-2017-7494
38 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files110
opsxcq/exploit-cve-2017-7494Revision 4d0bde4f1a7d
- ↑..Parent directory
- idmap_hash/
- idmap.c
- idmap_ad.c
- idmap_ad_nss.c
- idmap_autorid.c
- idmap_autorid_tdb.c
- idmap_ldap.c
- idmap_nss.c
- idmap_passdb.c
- idmap_proto.h
- idmap_rfc2307.c
- idmap_rid.c
- idmap_rw.c
- idmap_rw.h
- idmap_script.c
- idmap_tdb.c
- idmap_tdb2.c
- idmap_tdb_common.c
- idmap_tdb_common.h
- idmap_util.c
- nss_info.c
- nss_info_template.c
- wb_dsgetdcname.c
- wb_fill_pwent.c
- wb_getgrsid.c
- wb_getpwsid.c
- wb_gettoken.c
- wb_group_members.c
- wb_lookupname.c
- wb_lookupsid.c
- wb_lookupsids.c
- wb_lookupuseraliases.c
- wb_lookupusergroups.c
- wb_next_grent.c
- wb_next_pwent.c
- wb_ping.c
- wb_query_group_list.c
- wb_query_user_list.c
- wb_queryuser.c
- wb_seqnum.c
- wb_seqnums.c
- wb_sids2xids.c
- wb_xids2sids.c
- winbindd.c
- winbindd.h
- winbindd_ads.c
- winbindd_allocate_gid.c
- winbindd_allocate_uid.c
- winbindd_async.c
- winbindd_cache.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/source3/winbindd/idmap_rw.c
C · 2,126 bytes/*
* Unix SMB/CIFS implementation.
*
* ID mapping: abstract r/w new-mapping mechanism
*
* Copyright (C) Michael Adam 2010
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "winbindd.h"
#include "idmap.h"
#include "idmap_rw.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
NTSTATUS idmap_rw_new_mapping(struct idmap_domain *dom,
struct idmap_rw_ops *ops,
struct id_map *map)
{
NTSTATUS status;
if (map == NULL) {
return NT_STATUS_INVALID_PARAMETER;
}
if ((map->xid.type != ID_TYPE_UID) && (map->xid.type != ID_TYPE_GID)) {
return NT_STATUS_INVALID_PARAMETER;
}
if (map->sid == NULL) {
return NT_STATUS_INVALID_PARAMETER;
}
status = ops->get_new_id(dom, &map->xid);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Could not allocate id: %s\n", nt_errstr(status)));
return status;
}
DEBUG(10, ("Setting mapping: %s <-> %s %lu\n",
sid_string_dbg(map->sid),
(map->xid.type == ID_TYPE_UID) ? "UID" : "GID",
(unsigned long)map->xid.id));
map->status = ID_MAPPED;
status = ops->set_mapping(dom, map);
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
struct id_map *ids[2];
DEBUG(5, ("Mapping for %s exists - retrying to map sid\n",
sid_string_dbg(map->sid)));
ids[0] = map;
ids[1] = NULL;
status = dom->methods->sids_to_unixids(dom, ids);
}
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Could not store the new mapping: %s\n",
nt_errstr(status)));
return status;
}
return NT_STATUS_OK;
}