From owner-freebsd-ports@FreeBSD.ORG Sun Sep 13 20:04:40 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E4FA1065672 for ; Sun, 13 Sep 2009 20:04:40 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id F1ACF8FC12 for ; Sun, 13 Sep 2009 20:04:39 +0000 (UTC) Received: from r55.edvax.de (port-92-195-23-67.dynamic.qsc.de [92.195.23.67]) by mx01.qsc.de (Postfix) with ESMTP id 8AF823CAC9; Sun, 13 Sep 2009 21:49:37 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n8DJnZ5Y022832; Sun, 13 Sep 2009 21:49:35 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 13 Sep 2009 21:49:35 +0200 From: Polytropon To: Stefan Miklosovic Message-Id: <20090913214935.57a33015.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org, freebsd-ports@freebsd.org Subject: Re: add own program to ports + help with port / program X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 20:04:40 -0000 On Sun, 13 Sep 2009 21:38:00 +0200, Stefan Miklosovic 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, ...