# New port



## Free (Aug 20, 2009)

Hi every one,
I have writen program and I want to port it.
But I have alote of questions.
1. Program is small, only 2 pages of c++ code. Could small program like that be ported in to FreeBSD ports ?
2. If yes, can I put program code in port it self, with out have to download it from internet ?

Thats all for now 

Thanks, Free.


----------



## SirDice (Aug 20, 2009)

Free said:
			
		

> 1. Program is small, only 2 pages of c++ code. Could small program like that be ported in to FreeBSD ports ?


Size doesn't matter



> 2. If yes, can I put program code in port it self, with out have to download it from internet ?


It's probably a little bit to big for that. That said there are ports that have this (portmaster comes to mind).


----------



## rghq (Aug 20, 2009)

If the 2nd question is a problem, maybe try hosting it at Sourceforge


----------



## Free (Aug 20, 2009)

> SirDice


Thanks, here is one more question:

3. Program made to shutdown win clients in domain, but it needs admin's password & login. In my program, when you compile program, you set up login & password, so is there any way to do so using ports ?


----------



## Free (Aug 20, 2009)

> If the 2nd question is a problem, maybe try hosting it at Sourceforge


It's not a problem, my question if I can, if not, i'll just upload it to my server


----------



## rghq (Aug 20, 2009)

Free said:
			
		

> Thanks, here is one more question:
> 
> 3. Program made to shutdown win clients in domain, but it needs admin's password & login. In my program, when you compile program, you set up login & password, so is there any way to do so using ports ?



Yes - that's possible. Either via a dialog interface or via make options.
Problem might just be that saving the port preferences or the make options in the shell history will save the plaintext password.


----------



## aragon (Aug 20, 2009)

For that last question, I'd say rather put that into your configure script so that it securely prompts the user before compilation and writes the setting to a header file.


----------



## SirDice (Aug 21, 2009)

Even better, don't hardcode the username/password. Use options so a user can supply them on the commandline.


----------



## john_doe (Aug 21, 2009)

There are certain percent of users that install programs via packages. Hardcoding authentication data in source files will make package of your program useless.


----------



## CodeBlock (Aug 21, 2009)

SirDice said:
			
		

> Even better, don't hardcode the username/password. Use options so a user can supply them on the commandline.



Then they're saved in ~/.${shell}_history.


----------



## SirDice (Aug 21, 2009)

CodeBlock said:
			
		

> Then they're saved in ~/.${shell}_history.



Or, in the absence of a -p or --password option on the command line ask for it. The -p or --password would make it easier to script


----------



## CodeBlock (Aug 28, 2009)

SirDice said:
			
		

> Or, in the absence of a -p or --password option on the command line ask for it. The -p or --password would make it easier to script



Ah yes, like mysql does it.. That could work


----------

