Date: Sun, 13 Sep 2009 21:49:35 +0200 From: Polytropon <freebsd@edvax.de> To: Stefan Miklosovic <miklosovic.freebsd@gmail.com> Cc: freebsd-questions@freebsd.org, freebsd-ports@freebsd.org Subject: Re: add own program to ports + help with port / program Message-ID: <20090913214935.57a33015.freebsd@edvax.de> In-Reply-To: <f99a79ec0909131238n671f2d92t274fc45189a92768@mail.gmail.com> References: <f99a79ec0909131238n671f2d92t274fc45189a92768@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 13 Sep 2009 21:38:00 +0200, Stefan Miklosovic <miklosovic.freebsd@gmail.com> wrote: > I am about writing shell script which adds system account > by tens (even hundreds). Interesting and useful tool. I'm sure many sysadmins have created such tools for their own needs, but it wouldn't be bad to have one publically available from the ports collection. > Password are generated by apg program In order to employ an alternate password generation program (e. g. pwgen), you could even add an entry to your configuration file. > I want to write this program but I do not know if I do it correct and I need > some > feedback about programming style or just some info what do you think about > it. Style is highly debatable and is discussed ocassionally on this list. But finally, YOU are the programmer and YOU are the one who decides about style. Programming tips to mainly rely on which programming language you use. For example, if you're using C, I would suggest you to only use "safe functions" (e. g. no strcpy() function) and always check return values (e. g. fopen(), fputs() and fclose() functions, if you use them for accessing files). In case you are using threads, check that your program is "thread safe". Testing as much as possible is important because you're writing a program that is acting on system level (root) when it does "simply" create user accounts. > At this time, there is absence of manual, but if you track code, I think > you understand it. In order to comply to FreeBSD's philosophy of quality, you should, if your program is complete, take the time to write a manpage. As a developer, I always loved FreeBSD for its excellent documentation. Don't do it "the Linux way" - leave documentation to the Web, a Wiki, or the users. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090913214935.57a33015.freebsd>