mirror of
https://github.com/samba-team/samba.git
synced 2025-08-26 01:49:31 +03:00
r8189: commit vampire ldif patch, mostly from Don Watson (dwatson@us.ibm.com). Yes,
that's my copyright...that's just how we have to do things at big blue.
Adds subcommand to vampire to allow data to be put into an ldif file instead
of actually writing to the passdb. See "net rpc help vampire" for usage
info. This should be added to docs as well.
(This used to be commit cb5634a305
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
c379e33da6
commit
e0ffbfc558
@ -2194,3 +2194,30 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
|
||||
*len = -1;
|
||||
*string = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the substring from src between the first occurrence of
|
||||
the char "front" and the first occurence of the char "back".
|
||||
Mallocs the return string which must be freed. Not for use
|
||||
with wide character strings.
|
||||
*/
|
||||
char *sstring_sub(const char *src, char front, char back)
|
||||
{
|
||||
char *temp1, *temp2, *temp3;
|
||||
ptrdiff_t len;
|
||||
|
||||
temp1 = strchr(src, front);
|
||||
if (temp1 == NULL) return NULL;
|
||||
temp2 = strchr(src, back);
|
||||
if (temp2 == NULL) return NULL;
|
||||
len = temp2 - temp1;
|
||||
if (len <= 0) return NULL;
|
||||
temp3 = (char*)SMB_MALLOC(len);
|
||||
if (temp3 == NULL) {
|
||||
DEBUG(1,("Malloc failure in sstring_sub\n"));
|
||||
return NULL;
|
||||
}
|
||||
memcpy(temp3, temp1+1, len-1);
|
||||
temp3[len-1] = '\0';
|
||||
return temp3;
|
||||
}
|
||||
|
@ -97,3 +97,16 @@ extern struct in_addr opt_dest_ip;
|
||||
|
||||
extern const char *share_type[];
|
||||
|
||||
/* Structure for mapping accounts to groups */
|
||||
/* Array element is the group rid */
|
||||
typedef struct _groupmap {
|
||||
uint32 rid;
|
||||
uint32 gidNumber;
|
||||
fstring sambaSID;
|
||||
fstring group_dn;
|
||||
} GROUPMAP;
|
||||
|
||||
typedef struct _accountmap {
|
||||
uint32 rid;
|
||||
fstring cn;
|
||||
} ACCOUNTMAP;
|
||||
|
@ -5989,6 +5989,7 @@ int net_rpc_help(int argc, const char **argv)
|
||||
{"trustdom", rpc_trustdom_usage},
|
||||
/*{"abortshutdown", rpc_shutdown_abort_usage},*/
|
||||
/*{"shutdown", rpc_shutdown_usage}, */
|
||||
{"vampire", rpc_vampire_usage},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user