PDA

View Full Version : help needed.. little code snippet in cpp


ProlyX
05-22-2003, 06:25 PM
hi,

can someone write little cpp snippet for me that following do..

user exec a command.. like site ginfo <group>.. (i know Mouten does already nice one.. but i want little changes and need that for that)

so the script should do following..

get uid from uid flags.. check if user has +G and is in grp arg1..
if yea.. <insert code here..> if not return You Dont have access.. etc

i hope someone understand it.. i would build it in in the cpp of ginfo that i can coutinue that.

tnx

neXus
05-22-2003, 07:44 PM
fot better understand ..
only users with group flag G should have acces to grpnfo command ?

FTPServerTools
05-22-2003, 08:19 PM
void main(int argc,char *argv[])
{
if (strstr(getenv("GROUPS"),argv[1]) && strchr(getenv("FLAGS"),"+") && strchr(getenv("FLAGS"),"G")){
<insert code here>
}
}

Just use the environment vars it is the easy way.
Example env vars:
200-ACCSPEED=0.0000
200-COMSPEC=C:\WINDOWS\System32\cmd.exe
200-FLAGS=1MTH
200-GID=0
200-GROUP=ioftpd
200-GROUPS=ioftpd
200-PATH=d:\ioFTPD\site
200-PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS
200-PROMPT=$P$G
200-PWD=/
200-SECTION=0
200-SPEED=0
200-TAGLINE=Speed of light
200-UID=0
200-USER=ioFTPD
200 Command Successful.


Put your own checking code in

ProlyX
05-23-2003, 04:47 AM
Thank You (and cala, dasop etc from chat, too ;) )