add user to router

Dear friends,

i decide to develop an ISP billing system.
i have a linux server that communicate with a cisco router.
how can i add user and config them with programming?

in advanced thank you for your kindness.
I think if your soft is not portable then you can use system function.

something like that:
1
2
3
std::string cmd = "adduser ";
cmd += "username ";
system(cmd.c_str());
Last edited on
Gee. system() is not considered evil around here because of the fact that it usually produces system dependent code. system() is evil because of the overhead and the ridiculous security flaws.

http://www.cplusplus.com/forum/articles/11153/

-Albatross
Albatros, What is your variant?

And if you saw on my post I say about portability. But I think in this case it's not matter.
man 3 exec

is a good variant
@Denis: system() is not evil due to its portability issues. If it were, then use of .NET would be evil. Read the article, and I actually don't have a variant that I'd use.

However, check what RedX suggested. It looks like it might be a better solution than system().

-Albatross
As long as your filter the username for special characters, you should be OK. Just don't allow usernames like "foo; rm -rf /".

Linksys routers used to have a bug in their "ping" web page that would accept all kinds of junk in the hostname form field and then just called system("ping " + hostname). It was a nice way for people to hack their own routers and do stuff like increase the power output of the wireless system.

http://www.seattlewireless.net/LinksysWrt54g#ExecutearbitrarycodethroughthePing.aspinterface
Topic archived. No new replies allowed.