[prev in list] [next in list] [prev in thread] [next in thread]
List: ipcop-svn
Subject: [Ipcop-svn] SF.net SVN: ipcop: [478] ipcop/trunk/src/installer
From: owes () users ! sourceforge ! net
Date: 2007-08-18 16:55:13
Message-ID: E1IMRZx-000435-HD () sc8-pr-svn4 ! sourceforge ! net
[Download RAW message or body]
Revision: 478
http://ipcop.svn.sourceforge.net/ipcop/?rev=478&view=rev
Author: owes
Date: 2007-08-18 09:55:13 -0700 (Sat, 18 Aug 2007)
Log Message:
-----------
password dialog in seperate module
Modified Paths:
--------------
ipcop/trunk/src/installer/Makefile
Added Paths:
-----------
ipcop/trunk/src/installer/passwords.c
Modified: ipcop/trunk/src/installer/Makefile
===================================================================
--- ipcop/trunk/src/installer/Makefile 2007-08-18 16:53:34 UTC (rev 477)
+++ ipcop/trunk/src/installer/Makefile 2007-08-18 16:55:13 UTC (rev 478)
@@ -4,7 +4,7 @@
LIBS = -lhd_tiny -lsysfs -lnewt -lslang
HEADERS = common.h
-OBJS = main.o helper.o hardware.o language.o partition.o
+OBJS = main.o helper.o hardware.o language.o partition.o passwords.c
all: installer
strip installer
Added: ipcop/trunk/src/installer/passwords.c
===================================================================
--- ipcop/trunk/src/installer/passwords.c (rev 0)
+++ ipcop/trunk/src/installer/passwords.c 2007-08-18 16:55:13 UTC (rev 478)
@@ -0,0 +1,66 @@
+/*
+ * passwords.c: Set root, backup and admin passwords
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence. See the file COPYING for details.
+ *
+ * (c) 2007, the IPCop team
+ *
+ * $Id$
+ *
+ */
+
+
+#include <libintl.h>
+#include <newt.h>
+#include <stdlib.h>
+#include <string.h>
+#include "common.h"
+
+
+int password(char *user)
+{
+ char message[STRING_SIZE];
+ char password[STRING_SIZE];
+ char commandstring[STRING_SIZE];
+
+ if ( !strcmp(user, "root") )
+ {
+ strcpy(message, "TR_ENTER_ROOT_PASSWORD");
+ }
+ else if ( !strcmp(user, "admin") )
+ {
+ strcpy(message, "TR_ENTER_ADMIN_PASSWORD");
+ }
+ else if ( !strcmp(user, "backup") )
+ {
+ strcpy(message, "TR_ENTER_BACKUP_PASSWORD");
+ }
+ else
+ {
+ return 0;
+ }
+
+ newtWinMessage(TITLE, gettext("TR_OK"), message);
+
+/* */
+ strcpy(password, "ipcop");
+
+ if ( !strcmp(user, "admin") )
+ {
+ snprintf(commandstring, STRING_SIZE, "/usr/bin/htpasswd -c -m -b " CONFIG_ROOT \
"/auth/users admin '%s'", password); + }
+ else
+ {
+ snprintf(commandstring, STRING_SIZE, "/bin/echo '%s:%s' | /usr/sbin/chpasswd", \
user, password); + }
+
+ if (mysystem(commandstring))
+ {
+ snprintf(message, STRING_SIZE, "%s %s", \
gettext("TR_PROBLEM_SETTING_PASSWORD_FOR"), user); + newtWinMessage(TITLE, \
gettext("TR_OK"), message); + return 0;
+ }
+
+ return 1;
+}
Property changes on: ipcop/trunk/src/installer/passwords.c
___________________________________________________________________
Name: svn:keywords
+ Id
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic