Fixing Lintian reported bugs: debhelper-but-no-misc-depends, script-not-executable

This commit is contained in:
Benjamin Sonntag 2013-02-03 13:22:24 +00:00
parent 5ff0619615
commit 4aded69a06
6 changed files with 44 additions and 133 deletions

1
.gitattributes vendored
View File

@ -364,7 +364,6 @@ bureau/class/config.php -text
bureau/class/config_nochk.php -text
bureau/class/config_real.php -text
bureau/class/db_mysql.php -text
bureau/class/export_account.php -text
bureau/class/functions.php -text
bureau/class/lang_env.php -text
bureau/class/local.php -text

View File

@ -1,9 +1,14 @@
2013: We are now trying to make AlternC enter Debian repositories and follow Debian rules :)
********************************************************************************************
* 2013: We are trying to make AlternC enter Debian repositories and follow Debian rules :) *
********************************************************************************************
The main issues we know as of today are:
- the static UID/GID of AlternC-panel (uid/gid 1999) need to be dynamic and allocated when needed.
launching :
# grep -l adduser /var/lib/dpkg/info/*postinst /var/lib/dpkg/info/*preinst
in a debian server could help finding the right way to do it (eg: bind9 ) ;)
- the control panel is located in /var/alternc/bureau => move it to /usr/lib/alternc/www ?
@ -29,20 +34,12 @@ Easy to fix NOW :
E: alternc: dir-or-file-in-var-run var/run/alternc/
W: alternc: binary-without-manpage usr/bin/alternc_get_path
W: alternc: binary-without-manpage usr/bin/alternc_reload
W: alternc: script-not-executable usr/lib/alternc/functions.sh
W: alternc: script-not-executable usr/lib/alternc/functions_dns.sh
W: alternc: script-not-executable usr/lib/alternc/functions_hosting.sh
W: alternc: script-not-executable var/alternc/bureau/class/export_account.php
W: alternc: command-with-path-in-maintainer-script config:205 /usr/bin/awk
W: alternc: maintainer-script-ignores-errors prerm
E: alternc-upnp: php-script-but-no-phpX-cli-dep usr/lib/alternc/update_upnp.sh
W: alternc-upnp: executable-not-elf-or-script usr/lib/alternc/install.d/upnp-install
W: alternc-awstats: possible-debconf-note-abuse preinst:13 alternc-awstats/errorinstall
W: executable-is-not-world-readable /usr/lib/alternc/update_quota_mail.sh 0750
W: alternc-slave: debian-news-entry-has-unknown-version 0.9.10
W: alternc-slave: debian-changelog-line-too-long line 4
W: alternc-slave: debian-changelog-line-too-long line 8
W: alternc-slave: debian-changelog-line-too-long line 25
E: alternc: duplicate-conffile etc/cron.d/alternc
E: alternc: duplicate-conffile etc/logrotate.d/alternc
@ -58,13 +55,28 @@ W: alternc source: dh-clean-k-is-deprecated
W: alternc source: maintainer-script-lacks-debhelper-token debian/alternc-roundcube.postinst
W: alternc source: maintainer-script-lacks-debhelper-token debian/alternc-squirrelmail.postinst
********************************************************************************
FIXED:
W: alternc-slave: debian-news-entry-has-unknown-version 0.9.10
W: alternc-slave: debian-changelog-line-too-long line 4
W: alternc-slave: debian-changelog-line-too-long line 8
W: alternc-slave: debian-changelog-line-too-long line 25
W: alternc source: obsolete-relation-form-in-source in alternc conflicts: alternc-awstats (< 1.0)
W: alternc source: obsolete-relation-form-in-source in alternc conflicts: alternc-mailman (< 2.0)
W: alternc source: obsolete-relation-form-in-source in alternc-roundcube conflicts: alternc (< 1.1)
W: alternc: script-not-executable usr/lib/alternc/functions.sh
W: alternc: script-not-executable usr/lib/alternc/functions_dns.sh
W: alternc: script-not-executable usr/lib/alternc/functions_hosting.sh
W: alternc: script-not-executable var/alternc/bureau/class/export_account.php
W: alternc source: debhelper-but-no-misc-depends alternc-upnp
W: alternc source: debhelper-but-no-misc-depends alternc-slave
W: alternc source: debhelper-but-no-misc-depends alternc-roundcube
W: alternc source: debhelper-but-no-misc-depends alternc-squirrelmail
W: alternc source: debhelper-but-no-misc-depends alternc
W: alternc source: debhelper-but-no-misc-depends alternc-awstats
W: alternc source: obsolete-relation-form-in-source in alternc conflicts: alternc-awstats (< 1.0)
W: alternc source: obsolete-relation-form-in-source in alternc conflicts: alternc-mailman (< 2.0)
W: alternc source: obsolete-relation-form-in-source in alternc-roundcube conflicts: alternc (< 1.1)

View File

@ -1,29 +0,0 @@
#!/usr/bin/php
<?php
// EXPERIMENTAL : user data export.
die('Proof of concept');
include("config.php");
sem_release($alternc_sem);
$mem->su($id);
$dom->lock();
/*
foreach($classes as $c) {
if (method_exists($GLOBALS[$c],"alternc_export")) {
$GLOBALS[$c]->alternc_export("/tmp");
}
}
*/
$hooks->invoke("alternc_export",array("/tmp"));
$dom->unlock();
$mem->unsu();
?>

12
debian/control vendored
View File

@ -10,7 +10,7 @@ Standards-Version: 3.9.1
Package: alternc
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0, bash (>= 4)
Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, bind9, wget, rsync, ca-certificates, locales, perl-suid | perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), sudo, adduser, mysql-client, dnsutils, acl, dovecot-imapd (>= 1:1.2.15), dovecot-pop3d (>= 1:1.2.15), vlogger, mailx, incron
Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, bind9, wget, rsync, ca-certificates, locales, perl-suid | perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), sudo, adduser, mysql-client, dnsutils, acl, dovecot-imapd (>= 1:1.2.15), dovecot-pop3d (>= 1:1.2.15), vlogger, mailx, incron, ${misc:depends}
Recommends: mysql-server(>= 5.0), ntp, quota
Conflicts: alternc-admintools, alternc-awstats (<< 1.0), alternc-webalizer (<= 0.9.4), alternc-mailman (<< 2.0)
Provides: alternc-admintools
@ -39,7 +39,7 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
Package: alternc-slave
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, postfix-tls, bind9, wget, rsync, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), adduser, mysql-client, sudo, acl, dovecot-common (>= 1:1.2.15), dovecot-imapd, dovecot-pop3d
Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, postfix-tls, bind9, wget, rsync, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), adduser, mysql-client, sudo, acl, dovecot-common (>= 1:1.2.15), dovecot-imapd, dovecot-pop3d, ${misc:depends}
Recommends: dovecot-managesieved, dovecot-sieve, dovecot-mysql, quota
Conflicts: alternc-admintools, alternc-awstats (<= 0.3.2), alternc-webalizer (<= 0.9.4), alternc
Provides: alternc
@ -75,7 +75,7 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
Package: alternc-squirrelmail
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), squirrelmail, squirrelmail-locales, avelsieve
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), squirrelmail, squirrelmail-locales, avelsieve, ${misc:depends}
Conflicts: alternc (<= 1.0.3), alternc-changepass
Provides: alternc-webmail
Suggests:
@ -106,7 +106,7 @@ Description-fr.UTF-8: Webmail Squirrelmail pour AlternC
Package: alternc-roundcube
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), roundcube (>= 0.7.1), roundcube-mysql (>= 0.7.1), roundcube-plugins (>= 0.7.1), imagemagick
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), roundcube (>= 0.7.1), roundcube-mysql (>= 0.7.1), roundcube-plugins (>= 0.7.1), imagemagick, ${misc:depends}
Conflicts: alternc (<< 1.1)
Provides: alternc-webmail
Suggests:
@ -139,7 +139,7 @@ Priority: optional
Section: admin
Architecture: all
Pre-depends: debconf
Depends: alternc (>= 3.0~rc1), awstats (>=6.1-1), php5-cli
Depends: alternc (>= 3.0~rc1), awstats (>=6.1-1), php5-cli, ${misc:depends}
Suggests: apachemerge
Description: Awstats statistics module for AlternC
AlternC is a mutualized hosting software manager for Linux.
@ -154,7 +154,7 @@ Description: Awstats statistics module for AlternC
Package: alternc-upnp
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), miniupnpc
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), miniupnpc, php5-cli, ${misc:depends}
Description: UPnP client for AlternC
AlternC is a mutualized hosting software manager for Linux.
It allows you to manage your websites, domains, ftp, emails, aliases,

View File

@ -19,13 +19,13 @@
# ----------------------------------------------------------------------
# Purpose of file: Makefile des binaires de /usr/lib/alternc
# ----------------------------------------------------------------------
SCRIPTS=sqlbackup.sh quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-dboptimize export_account.php cron_users_doit.sh cron_users.sh compress_logs.sh delete_logs.sh quota-warning.sh update_mails.sh alternc_add_policy_dovecot rebuild_all_webconf.sh courier-dovecot-migrate.pl popimap-log-login.sh mem_add mem_del quota_edit quota_get du.pl update_quota_mail.sh inotify_update_domains.sh
LIBS=functions.sh functions_hosting.sh functions_dns.sh
SCRIPTS=sqlbackup.sh quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-dboptimize export_account.php cron_users_doit.sh cron_users.sh compress_logs.sh delete_logs.sh quota-warning.sh update_mails.sh alternc_add_policy_dovecot rebuild_all_webconf.sh courier-dovecot-migrate.pl popimap-log-login.sh mem_add mem_del quota_edit quota_get du.pl update_quota_mail.sh inotify_update_domains.sh functions.sh functions_hosting.sh functions_dns.sh
BIN=$(DESTDIR)/usr/lib/alternc/
install:
# FIXME: change it to root:root AND do the chgrp alterncpanel AT POSTINST
# Group 1999 references alterncpanel
chown root:1999 $(BIN)
chmod 755 $(BIN)
install -o root -g 1999 -m0750 $(SCRIPTS) $(BIN)
install -o root -g 1999 -m0644 $(LIBS) $(BIN)
install -o root -g 1999 -m0755 $(SCRIPTS) $(BIN)
install -o root -g 1999 -m0644 $(BIN)

89
src/export_account.php Executable file → Normal file
View File

@ -1,92 +1,21 @@
#!/usr/bin/php -q
#!/usr/bin/php
<?php
/**
* Script permettant d'exporter la configuration d'un compte Alternc ainsi que les données associé
* A lancer par exemple avant une suppression de compte.
* Les seuls arguments necessaires sont l'iud du compte à exporter, ainsi que le repertoire ou le dump sera effectué.
* l'export ce fait sous l'arborescence <dir>/<login>/date/ ou les dumps de configuration sont déposées.
* Deux sous dossier sont ensuite crée : html ( dump des fichiers web et de la configuration du compte )
* et un dossier sql contenant toutes les bases de données de l'utilisateur.
*/
// EXPERIMENTAL : user data export.
die('Proof of concept');
require("/var/alternc/bureau/class/config_nochk.php");
include("config.php");
global $L_VERSION;
sem_release($alternc_sem);
if(!chdir("/var/alternc/bureau")){
exit(1);
}
if($argc != 3 ){
echo "usage : export.php <uid> <directory>\n";
exit (1);
}
$mem->su($id);
$my_id=$argv[1];
# TODO here test $my_id is numeric
if((intval($my_id))==0 || (intval($myid)==1)){
echo "bad argument: expecting a 4 digit IUD";
exit (1);
}
$dom->lock();
$dir=$argv[2];
echo "\n === Export of account $my_id === to $dir\n\n";
$hooks->invoke("alternc_export",array("/tmp"));
$dom->unlock();
# Connect in this user
$admin->enabled=1;
$mem->su($my_id);
if(!is_dir($dir)){
if(!mkdir($dir)){
echo "creating dir : ".$dir." failed";
exit(1);
}
}
$dir.=$mem->user["login"]."/";
if(!is_dir($dir)){
if(!mkdir($dir)){
echo "creating dir : ".$dir." failed";
exit(1);
}
}
$timestamp=date("Y:m:d");
$dir.=$timestamp."/";
if(!is_dir($dir)){
if(!mkdir($dir)){
echo "creating dir : ".$dir." failed";
exit(1);
}
}
# Get the conf
$conf_user=Array();
$conf_user=$export->export_conf();
$file_conf=$dir."dump_conf_".date("H:i:s");
echo $file_conf;
$file=fopen($file_conf."dump","ab");
fputs($file,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?\> \n");
fputs($file,"<version>:".$L_VERSION."</version>\n");
fputs($file,"<user>".$mem->user["login"]."</user>\n");
foreach($conf_user as $string){
fputs($file,$string);
}
//fputs($file,"</html></body>");
fclose($file);
# Get the data
$export->export_data($dir);
$mem->unsu();
exit(0);
?>