Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwsetup-ng.git;a=commitdiff;h=791cb985a9a3184f48038e72e047ad993264f40f

commit 791cb985a9a3184f48038e72e047ad993264f40f
Author: James Buren <[email protected]>
Date:   Fri Sep 7 04:11:58 2012 -0500

add sanity check to user_action

diff --git a/src/postconfig.c b/src/postconfig.c
index a8f4fcc..b7e3d8a 100644
--- a/src/postconfig.c
+++ b/src/postconfig.c
@@ -99,6 +99,13 @@ static bool user_action(struct account *account)
{
char command[_POSIX_ARG_MAX] = {0};

+  if(account == 0 || account->user == 0 || account->password == 0 || 
account->group == 0 || account->groups == 0 || account->home == 0 || 
account->shell == 0)
+  {
+    errno = EINVAL;
+    fprintf(logfile,"%s: %s\n",__func__,strerror(errno));
+    return false;
+  }
+
snprintf(command,_POSIX_ARG_MAX,"useradd -D -m -c '%s' -g '%s' -G '%s' -d '%s' 
-s '%s' '%s'",(account->name != 0) ? account->name : 
"",account->group,account->groups,account->home,account->shell,account->user);

if(!execute(command,INSTALL_ROOT,0))
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to