Ticket #594: patch-594.diff
| File patch-594.diff, 16.7 KB (added by nahuel, 7 years ago) |
|---|
-
debian/prerm
16 16 rmdir -p /var/alternc/bureau 2> /dev/null || true 17 17 rm -f /var/alternc/dns/bureau 18 18 rm -f /var/alternc/dns/$FQDN_LETTER/$FQDN 19 rmdir -p /var/alternc/html/ r/root2> /dev/null || true19 rmdir -p /var/alternc/html/a/admin 2> /dev/null || true 20 20 rm -f /var/alternc/apacheconf/override_php.conf 21 rmdir -p /var/alternc/htm/ r/root2> /dev/null || true21 rmdir -p /var/alternc/htm/a/admin 2> /dev/null || true 22 22 ;; 23 23 24 24 upgrade) -
src/mem_del.c
45 45 46 46 setuid(geteuid()); 47 47 /*************************/ 48 /* WARNING : ROOTZONE ! */48 /* WARNING : ADMIN ZONE ! */ 49 49 /*************************/ 50 50 system(s); 51 51 exit(0); -
src/mail_del.c
46 46 47 47 setuid(geteuid()); 48 48 /*************************/ 49 /* WARNING : ROOTZONE ! */49 /* WARNING : ADMIN ZONE ! */ 50 50 /*************************/ 51 51 system(s); 52 52 exit(0); -
src/db_create.c
50 50 51 51 setuid(geteuid()); 52 52 /*************************/ 53 /* WARNING : ROOTZONE ! */53 /* WARNING : ADMIN ZONE ! */ 54 54 /*************************/ 55 55 chown(argv[2],-1,uid); 56 56 chmod(argv[2],02770); -
src/mem_add.c
48 48 49 49 setuid(geteuid()); 50 50 /*************************/ 51 /* WARNING : ROOTZONE ! */51 /* WARNING : ADMIN ZONE ! */ 52 52 /*************************/ 53 53 sprintf(s,"/var/alternc/html/%c/%s",mail[0],mail); 54 54 mkdir(s); -
src/mail_add.c
51 51 52 52 setuid(geteuid()); 53 53 /*************************/ 54 /* WARNING : ROOTZONE ! */54 /* WARNING : ADMIN ZONE ! */ 55 55 /*************************/ 56 56 sprintf(s,"/var/alternc/mail/%c/%s",mail[0],mail); 57 57 mkdir(s); -
tools/get_domains_by_account
56 56 HELP=$($gettext "Gives domains and sub-domains attached to an account.") 57 57 USAGE=`$printf "$($gettext "Usage: %s account.")" $PROG_NAME` 58 58 NOT_FOUND_MSG=$($gettext "does not exist.") 59 NON_ ROOT_MSG=$($gettext "You have to be root(uid 0) to execute this program.")59 NON_ADMIN_MSG=$($gettext "You have to be admin (uid 0) to execute this program.") 60 60 MISSING_PROG=$($gettext "Unable to execute") 61 61 MISSING_CONF_FILE=`$printf "$($gettext "Can't find %s. Are you sure AlterncC is properly installed?")" $ALTERNC_CONF_FILE` 62 62 MYSQL_UNREACHABLE_DATABASE=`$printf "$($gettext "Cannot access accounts database. Please check either %s or Mysql state.")" $ALTERNC_CONF_FILE` … … 65 65 #------------------------- 66 66 # Main 67 67 #------------------------- 68 # Must be root69 [ "`$id -u`" != "0" ] && { echo $NON_ ROOT_MSG ; exit 1 ; }68 # Must be admin 69 [ "`$id -u`" != "0" ] && { echo $NON_ADMIN_MSG ; exit 1 ; } 70 70 # Must have minimum 1 parameter 71 71 [ -z "$1" ] && { echo $USAGE ; exit 1 ; } 72 72 # Handle -h and --help flags -
tools/top_http_users
88 88 NON_COMPATIBLE_MSG=$($gettext "The -n and -z options are not compatible.") 89 89 NON_NUM_MSG_FOR_N=$($gettext "The -n option requieres a number as argument.") 90 90 LOCKFILE_CREATION_FAILED=`$printf "$($gettext "%s is allready beeing executed.")" $PROG_NAME` 91 NON_ ROOT_MSG=$($gettext "You have to be root(uid 0) to execute this program.")91 NON_ADMIN_MSG=$($gettext "You have to be admin (uid 0) to execute this program.") 92 92 MISSING_PROG=$($gettext "Unable to execute") 93 93 HIT_RES_MSG=`$printf "$($gettext "Top %s domains served by apache, sorted by number of lines in log (using gzipped logs: %s):")" $NB_USERS $($gettext "$USE_GZ_LOGS")` 94 94 SIZE_RES_MSG=`$printf "$($gettext "Top %s domains served by apache, sorted by size (using gzipped logs: %s):")" $NB_USERS $($gettext "$USE_GZ_LOGS")` … … 123 123 # Main 124 124 #------------------------- 125 125 set_messages 126 # Must be root127 [ "`$id -u`" -ne 0 ] && { echo $NON_ ROOT_MSG ; exit 1 ; }126 # Must be admin 127 [ "`$id -u`" -ne 0 ] && { echo $NON_ADMIN_MSG ; exit 1 ; } 128 128 129 129 # Parse args 130 130 IS_N_PARAM=false -
tools/top_mysql_users
86 86 NON_COMPATIBLE_MSG=$($gettext "The -n and -z options are not compatible.") 87 87 NON_NUM_MSG_FOR_N=$($gettext "The -n option requieres a number as argument.") 88 88 LOCKFILE_CREATION_FAILED=`$printf "$($gettext "%s is allready beeing executed.")" $PROG_NAME` 89 NON_ ROOT_MSG=$($gettext "You have to be root(uid 0) to execute this program.")89 NON_ADMIN_MSG=$($gettext "You have to be admin (uid 0) to execute this program.") 90 90 HIT_RES_MSG=`$printf "$($gettext "Top %s mysql users, sorted by connexion number (using gzipped logs: %s):")" $NB_USERS $($gettext "$USE_GZ_LOGS")` 91 91 MISSING_CONF_FILE=`$printf "$($gettext "Can't find %s. Are you sure AlterncC is properly installed?")" $ALTERNC_CONF_FILE` 92 92 UNKNOWN_OPTION=$($gettext "Unknown %s option.") … … 109 109 # Main 110 110 #------------------------- 111 111 set_messages 112 # Must be root113 [ "`$id -u`" != "0" ] && { echo $NON_ ROOT_MSG ; exit 1 ; }112 # Must be admin 113 [ "`$id -u`" != "0" ] && { echo $NON_ADMIN_MSG ; exit 1 ; } 114 114 115 115 # Parse args 116 116 IS_N_PARAM=false -
tools/get_account_by_domain
58 58 HELP=$($gettext "Gives account hosting domain or sub-domain.") 59 59 USAGE=`$printf "$($gettext "Usage: %s [domain|sub-domain].")" $PROG_NAME` 60 60 NOT_FOUND_MSG=$($gettext "does not exist.") 61 NON_ ROOT_MSG=$($gettext "You have to be root(uid 0) to execute this program.")61 NON_ADMIN_MSG=$($gettext "You have to be admin (uid 0) to execute this program.") 62 62 MISSING_PROG=$($gettext "Unable to execute") 63 63 MISSING_CONF_FILE=`$printf "$($gettext "Can't find %s. Are you sure AlterncC is properly installed?")" $ALTERNC_CONF_FILE` 64 64 MYSQL_UNREACHABLE_DATABASE=`$printf "$($gettext "Cannot access accounts database. Please check either %s or Mysql state.")" $ALTERNC_CONF_FILE` … … 67 67 #------------------------- 68 68 # Main 69 69 #------------------------- 70 # Must be root71 [ "`$id -u`" != "0" ] && { echo $NON_ ROOT_MSG ; exit 1 ; }70 # Must be admin 71 [ "`$id -u`" != "0" ] && { echo $NON_ADMIN_MSG ; exit 1 ; } 72 72 # Must have minimum 1 parameter 73 73 [ -z "$1" ] && { echo $USAGE ; exit 1 ; } 74 74 # Handle -h and --help flags -
tools/top_ftp_users
87 87 NON_COMPATIBLE_MSG=$($gettext "The -n and -z options are not compatible.") 88 88 NON_NUM_MSG_FOR_N=$($gettext "The -n option requieres a number as argument.") 89 89 LOCKFILE_CREATION_FAILED=`$printf "$($gettext "%s is allready beeing executed.")" $PROG_NAME` 90 NON_ ROOT_MSG=$($gettext "You have to be root(uid 0) to execute this program.")90 NON_ADMIN_MSG=$($gettext "You have to be admin (uid 0) to execute this program.") 91 91 HIT_RES_MSG=`$printf "$($gettext "Top %s ftp users, sorted by connection number (using gzipped logs: %s):")" $NB_USERS $($gettext "$USE_GZ_LOGS")` 92 92 SIZE_RES_MSG=`$printf "$($gettext "Top %s ftp users, sorted by size (using gzipped logs: %s):")" $NB_USERS $($gettext "$USE_GZ_LOGS")` 93 93 MISSING_CONF_FILE=`$printf "$($gettext "Can't find %s. Are you sure AlterncC is properly installed?")" $ALTERNC_CONF_FILE` … … 112 112 # Main 113 113 #------------------------- 114 114 set_messages 115 # Must be root116 [ "`$id -u`" != "0" ] && { echo $NON_ ROOT_MSG ; exit 1 ; }115 # Must be admin 116 [ "`$id -u`" != "0" ] && { echo $NON_ADMIN_MSG ; exit 1 ; } 117 117 118 118 # Parse args 119 119 IS_N_PARAM=false -
TODO
22 22 23 23 ** Utilisation d'AlternC : (sans développement) 24 24 - Documentation utilisateur d'AlternC (pour ceux qui utilisent bêtement la bête en tant qu'utilisateur sans privilege) 25 - Documentation Administrateur AlternC (pour ceux qui utilisent bêtement un compte rootd'AlternC)26 - Documentation du mainteneur de serveur (pour ceux qui sont rootsur le serveur)25 - Documentation Administrateur AlternC (pour ceux qui utilisent bêtement un compte admin d'AlternC) 26 - Documentation du mainteneur de serveur (pour ceux qui sont admin sur le serveur) 27 27 - Documentation de l'API (pour ceux qui veulent pouvoir personnaliser leur bureau, le piloter à distance etc.) 28 28 29 29 ** Développement d'AlternC : -
install/newone.php
37 37 $admin->enabled=1; 38 38 39 39 // On crée le compte admin : 40 if (!$admin->add_mem(" root","root","Administrateur", "Admin", "root@".$L_FQDN)) {40 if (!$admin->add_mem("admin","admin","Administrateur", "Admin", "postmaster@".$L_FQDN)) { 41 41 echo $err->errstr()."\n"; 42 42 exit(); 43 43 } 44 44 45 $db->query("update membres set su=1 where login=' root';");45 $db->query("update membres set su=1 where login='admin';"); 46 46 47 47 // On lui attribue des quotas par defaut 48 48 // 10 domains, 10 stats, 10 bases mysql, 20 ftp et 100 emails 49 $db->query("update quotas,membres set quotas.total=10 where (quotas.name='stats' or quotas.name='sta2' or quotas.name='mysql' or quotas.name='dom') and quotas.uid=membres.uid and membres.login=' root' ;");50 $db->query("update quotas,membres set quotas.total=20 where quotas.name='ftp' and quotas.uid=membres.uid and membres.login=' root' ;");51 $db->query("update quotas,membres set quotas.total=100 where quotas.name='mail' and quotas.uid=membres.uid and membres.login=' root' ;");49 $db->query("update quotas,membres set quotas.total=10 where (quotas.name='stats' or quotas.name='sta2' or quotas.name='mysql' or quotas.name='dom') and quotas.uid=membres.uid and membres.login='admin' ;"); 50 $db->query("update quotas,membres set quotas.total=20 where quotas.name='ftp' and quotas.uid=membres.uid and membres.login='admin' ;"); 51 $db->query("update quotas,membres set quotas.total=100 where quotas.name='mail' and quotas.uid=membres.uid and membres.login='admin' ;"); 52 52 53 53 ?> -
install/reset_root.php
36 36 // On passe super-admin 37 37 $admin->enabled=1; 38 38 39 // On remet le pass roota zero40 if (!$admin->update_mem(2000," root@".$L_FQDN,"Administrateur", "Admin", 'root', 1, 1)) {39 // On remet le pass admin a zero 40 if (!$admin->update_mem(2000,"postmaster@".$L_FQDN,"Administrateur", "Admin", 'admin', 1, 1)) { 41 41 echo "erreur : ".$err->errstr()."<br>\n"; 42 42 exit(); 43 43 } -
install/alternc.install
209 209 # Add basedir protection 210 210 /usr/lib/alternc/basedir_prot.sh 211 211 212 # Creating rootuser if needed213 HAS_ROOT="`mysql -h"$MYSQL_HOST" -u"$MYSQL_USER" -p"$MYSQL_PASS" "$MYSQL_DATABASE" -e "SELECT COUNT(*) FROM membres WHERE login = ' root'" | tail -1`"212 # Creating admin user if needed 213 HAS_ROOT="`mysql -h"$MYSQL_HOST" -u"$MYSQL_USER" -p"$MYSQL_PASS" "$MYSQL_DATABASE" -e "SELECT COUNT(*) FROM membres WHERE login = 'admin'" | tail -1`" 214 214 if [ "$HAS_ROOT" != "1" ]; then 215 echo "Creating rootuser..."215 echo "Creating admin user..." 216 216 su - www-data -c /usr/share/alternc/install/newone.php 217 217 echo "" 218 218 echo "*******************************************" 219 219 echo "* *" 220 echo "* Root account*"220 echo "* Admin account *" 221 221 echo "* ------------ *" 222 222 echo "* *" 223 echo "* user: root password: root*"223 echo "* user: admin password: admin *" 224 224 echo "* *" 225 225 echo "* Please change this as soon as possible! *" 226 226 echo "* *" -
man/top_ftp_users.8
18 18 .PP 19 19 As parsing large log files can be time and cpu consuming, use the -n option, with low values, to have results more quickly (but less accurate). 20 20 .PP 21 \fBtop_ftp_users\fP has to be run as root.21 \fBtop_ftp_users\fP has to be run as admin. 22 22 .SH OPTIONS 23 23 This program follow the usual GNU command line syntax, with long 24 24 options starting with two dashes (`-'). -
man/top_mysql_users.fr.8
15 15 .PP 16 16 Dans la mesure où le fait de parcourir des logs, si ils sont de grande taille, peut emmener à une consomation de ressources importante, il est conseillé d'utiliser l'option -n avec une valeur faible, et ce de manière à avoir des résultats plus rapidement, mais moins précis. 17 17 .PP 18 \fBtop_mysql_users\fP doit être lancé en tant que root.18 \fBtop_mysql_users\fP doit être lancé en tant que admin. 19 19 .SH OPTIONS 20 20 Ce programme suit la syntaxe des lignes de commande GNU, avec des options longues commencant par deux tirets (`-'). Un résumé de ces options est inclut ci-dessous. 21 21 .TP -
man/top_ftp_users.fr.8
17 17 .PP 18 18 Dans la mesure où le fait de parcourir des logs, si ils sont de grande taille, peut emmener à une consomation de ressources importante, il est conseillé d'utiliser l'option -n avec une valeur faible, et ce de manière à avoir des résultats plus rapidement, mais moins précis. 19 19 .PP 20 \fBtop_ftp_users\fP doit être lancé en tant que root.20 \fBtop_ftp_users\fP doit être lancé en tant que admin. 21 21 .SH OPTIONS 22 22 Ce programme suit la syntaxe des lignes de commande GNU, avec des options longues commencant par deux tirets (`-'). Un résumé de ces options est inclut ci-dessous. 23 23 .TP -
man/top_http_users.8
26 26 .PP 27 27 As parsing large log files can be time and cpu consuming, use the -n option, with low values, to have results more quickly (but less accurate). 28 28 .PP 29 \fBtop_http_users\fP has to be run as root.29 \fBtop_http_users\fP has to be run as admin. 30 30 .SH OPTIONS 31 31 This program follow the usual GNU command line syntax, with long 32 32 options starting with two dashes (`-'). -
man/top_http_users.fr.8
25 25 .PP 26 26 Dans la mesure où le fait de parcourir des logs, si ils sont de grande taille, peut emmener à une consomation de ressources importante, il est conseillé d'utiliser l'option -n avec une valeur faible, et ce de manière à avoir des résultats plus rapidement, mais moins précis. 27 27 .PP 28 \fBtop_http_users\fP doit être lancé en tant que root.28 \fBtop_http_users\fP doit être lancé en tant que admin. 29 29 .SH OPTIONS 30 30 Ce programme suit la syntaxe des lignes de commande GNU, avec des options longues commencant par deux tirets (`-'). Un résumé de ces options est inclut ci-dessous. 31 31 .TP -
man/top_mysql_users.8
16 16 .PP 17 17 As parsing large log files can be time and cpu consuming, use the -n option, with low values, to have results more quickly (but less accurate). 18 18 .PP 19 \fBtop_mysql_users\fP has to be run as root.19 \fBtop_mysql_users\fP has to be run as admin. 20 20 .SH OPTIONS 21 21 This program follow the usual GNU command line syntax, with long 22 22 options starting with two dashes (`-').
