mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +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 commit is contained in:
parent
65cfa2a950
commit
cb5634a305
@ -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
Loading…
Reference in New Issue
Block a user