diff options
author | Jean-François Micouleau <jfm@samba.org> | 2001-08-28 16:05:55 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2001-08-28 16:05:55 +0000 |
commit | b03a2011bb5a038cf9f3fd20351516420c6fc88a (patch) | |
tree | 48f11222190a9d295ae7af94e5ccfd9669da94f1 | |
parent | c22ecf6cfc8779d4ed1df30534bb241e0204d957 (diff) | |
download | samba-b03a2011bb5a038cf9f3fd20351516420c6fc88a.tar.gz samba-b03a2011bb5a038cf9f3fd20351516420c6fc88a.tar.bz2 samba-b03a2011bb5a038cf9f3fd20351516420c6fc88a.zip |
Ouch ! I didn't think I would have to do that: add 2 new rap calls !
It's a quick and ugly hack as a proof of concept: the dell powervault 705
works with a samba PDC.
I'll do a correct user enumeration later.
J.F.
(This used to be commit 9ec6a8735682c7dfe9f8573f063da7625d425d8a)
-rw-r--r-- | source3/smbd/lanman.c | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 6408bbff9e..f971bf1e35 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -1660,6 +1660,131 @@ static BOOL api_RNetShareEnum(connection_struct *conn,uint16 vuid, char *param,c } +/**************************************************************************** + view list of groups available + ****************************************************************************/ +static BOOL api_RNetGroupEnum(connection_struct *conn,uint16 vuid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len) +{ + char *str1 = param+2; + char *str2 = skip_string(str1,1); + char *p = skip_string(str2,1); + int uLevel = SVAL(p,0); + int buf_len = SVAL(p,2); + char *p2; + int count=0; + int total=0,counted=0; + BOOL missed = False; + int i; + int data_len, fixed_len, string_len; + int f_len = 0, s_len = 0; + + if (!prefix_ok(str1,"WrLeh")) return False; + + /* check it's a supported variant */ + switch( uLevel ) + { + case 0: + p2 = "B21"; + break; + default: + return False; + } + + if (strcmp(p2,str2) != 0) return False; + + *rdata_len = mdrcnt + 1024; + *rdata = REALLOC(*rdata,*rdata_len); + + SSVAL(*rparam,0,NERR_Success); + SSVAL(*rparam,2,0); /* converter word */ + + p = *rdata; + + /* XXXX we need a real SAM database some day */ + pstrcpy(p,"Users"); p += 21; count++; + pstrcpy(p,"Domain Users"); p += 21; count++; + pstrcpy(p,"Guests"); p += 21; count++; + pstrcpy(p,"Domain Guests"); p += 21; count++; + + *rdata_len = PTR_DIFF(p,*rdata); + + *rparam_len = 8; + *rparam = REALLOC(*rparam,*rparam_len); + + SSVAL(*rparam,4,count); /* is this right?? */ + SSVAL(*rparam,6,count); /* is this right?? */ + + DEBUG(3,("api_RNetGroupEnum gave %d entries\n", count)); + + return(True); +} + +/**************************************************************************** + view list of groups available + ****************************************************************************/ +static BOOL api_RNetUserEnum(connection_struct *conn,uint16 vuid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len) +{ + char *str1 = param+2; + char *str2 = skip_string(str1,1); + char *p = skip_string(str2,1); + int uLevel = SVAL(p,0); + int buf_len = SVAL(p,2); + char *p2; + int count=0; + int total=0,counted=0; + BOOL missed = False; + int i; + int data_len, fixed_len, string_len; + int f_len = 0, s_len = 0; + + if (!prefix_ok(str1,"WrLeh")) return False; + + /* check it's a supported variant */ + switch( uLevel ) + { + case 0: + p2 = "B21"; + break; + default: + return False; + } + + if (strcmp(p2,str2) != 0) return False; + + *rdata_len = mdrcnt + 1024; + *rdata = REALLOC(*rdata,*rdata_len); + + SSVAL(*rparam,0,NERR_Success); + SSVAL(*rparam,2,0); /* converter word */ + + p = *rdata; + + /* XXXX we need a real SAM database some day */ + pstrcpy(p,"Users"); p += 21; count++; + pstrcpy(p,"Domain Users"); p += 21; count++; + pstrcpy(p,"Guests"); p += 21; count++; + pstrcpy(p,"Domain Guests"); p += 21; count++; + + *rdata_len = PTR_DIFF(p,*rdata); + + *rparam_len = 8; + *rparam = REALLOC(*rparam,*rparam_len); + + SSVAL(*rparam,4,count); /* is this right?? */ + SSVAL(*rparam,6,count); /* is this right?? */ + + DEBUG(3,("api_RNetUserEnum gave %d entries\n", count)); + + return(True); +} + + /**************************************************************************** get the time of day info @@ -3262,7 +3387,9 @@ struct {"RNetShareEnum", 0, api_RNetShareEnum,0}, {"RNetShareGetInfo", 1, api_RNetShareGetInfo,0}, {"RNetServerGetInfo", 13, api_RNetServerGetInfo,0}, + {"RNetGroupEnum", 47, api_RNetGroupEnum,0}, {"RNetGroupGetUsers", 52, api_RNetGroupGetUsers,0}, + {"RNetUserEnum", 53, api_RNetUserEnum,0}, {"RNetUserGetInfo", 56, api_RNetUserGetInfo,0}, {"NetUserGetGroups", 59, api_NetUserGetGroups,0}, {"NetWkstaGetInfo", 63, api_NetWkstaGetInfo,0}, |