SOURCES: gallery-PLD.patch - update .sh scripts from debian. odd, ...

glen glen at pld-linux.org
Fri Jan 27 01:20:23 CET 2006


Author: glen                         Date: Fri Jan 27 00:20:23 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- update .sh scripts from debian. odd, their princible is same as here

---- Files affected:
SOURCES:
   gallery-PLD.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/gallery-PLD.patch
diff -u SOURCES/gallery-PLD.patch:1.1 SOURCES/gallery-PLD.patch:1.2
--- SOURCES/gallery-PLD.patch:1.1	Fri Jan 27 00:26:38 2006
+++ SOURCES/gallery-PLD.patch	Fri Jan 27 01:20:18 2006
@@ -5,7 +5,7 @@
  	if ( $currentFile == '/usr/share/gallery/lib/url.php') {
  		/* We assum Gallery runs on as Debian Package */
 -		define ("GALLERY_CONFDIR", "/etc/gallery");
-+		define ("GALLERY_CONFDIR", "/etc/webapps/gallery");
++		define ("GALLERY_CONFDIR", "/usr/share/gallery");
  		define ("GALLERY_SETUPDIR", "/var/lib/gallery/setup");
  	} else {
  		define ("GALLERY_CONFDIR", dirname(dirname(__FILE__)));
@@ -29,3 +29,121 @@
  		'filename' => 1,
  		'require-write-dir' => 1,
  		'type' => 'text',
+--- gallery/setup/config_data.inc	2006-01-27 01:22:22.000000000 +0200
++++ /tmp/config_data.inc	2006-01-27 01:38:25.000000000 +0200
+@@ -354,7 +354,7 @@
+ 		'desc' => '(<span class="attention">' . gTranslate('config',"REQUIRED") . '</span>) ' .
+ 		  sprintf(gTranslate('config',"The full URL to your album directory on your web server.  (e.g. %s) Gallery can operate with relative URLs, however some features, such as printing, may not function correctly."),
+ 		  '<i>http://www.example.com/albums</i>'),
+-		'value' => 'http://' . getenv('SERVER_NAME') . '/albums',
++		'value' => 'http://' . getenv('SERVER_NAME') . $GALLERY_URL . '/albums',
+ 		'no-trailing-slash' => 1,
+ 		'type' => 'text',
+ 		'attrs' => array('size' => 50),
+--- gallery-1.5.2.orig/configure.sh
++++ gallery-1.5.2/configure.sh
+@@ -1,20 +1,28 @@
+ #!/bin/sh
+-# $Id$
+ 
+-chmod 755 setup
++set -e
+ 
+-if [ ! -f config.php ]; then
+-    touch config.php
+-fi
++ROOT=/usr/share/gallery
++CONFDIR=/etc/webapps/gallery
+ 
+-if [ ! -f .htaccess ]; then
+-    touch .htaccess
++if [ `whoami` != "root" ] ; then
++    echo "You must be root to run this script" 2>&1
++    exit 1
+ fi
+ 
+-chmod 666 config.php .htaccess
++for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
++    if [ ! -f $file ]; then
++        touch $file
++    fi
++    chown root:http $file
++    chmod 660 $file
++done
++
++chmod 755 $ROOT/setup
++
+ 
+ echo ""
+-echo "You are now in setup mode. Your Gallery installation"
++echo "You are now in setup mode.  Your Gallery installation"
+ echo "can be configured by pointing your web browser"
+-echo "to the URL to 'setup' in this directory."
++echo "to the setup wizard (e.g. http://www.example.com/gallery/setup/index.php) "
+ echo ""
+--- gallery-1.5.2.orig/secure.sh
++++ gallery-1.5.2/secure.sh
+@@ -1,21 +1,31 @@
+ #!/bin/sh
+-# $Id$
++# $Id$
+ 
+-if [ -f config.php ]; then
+-    chmod 644 config.php 
+-fi
+ 
+-if [ -f .htaccess ]; then
+-    chmod 644 .htaccess
++set -e
++
++ROOT=/usr/share/gallery
++CONFDIR=/etc/webapps/gallery
++
++if [ `whoami` != "root" ] ; then
++    echo "You must be root to run this script" 2>&1
++    exit 1
+ fi
+ 
+-if [ -f setup/resetadmin ]; then
+-    rm -f setup/resetadmin
++for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
++    if [  -f $file ]; then
++    	chown root:http $file
++        chmod 640  $file
++    fi
++done
++
++if [ -f $ROOT/setup/resetadmin ]; then
++    rm -f $ROOT/setup/resetadmin
+ fi
+ 
+ echo ""
+ echo "Your Gallery is now secure and cannot be configured.  If"
+-echo "you wish to reconfigure it, run:"
++echo "you wish to reconfigure it, run configure.sh as root:"
+ echo ""
+-echo "    % ./configure.sh"
++echo "    # $ROOT/configure.sh"
+ echo ""
+--- gallery-1.5.2.orig/setup/confirm.inc
++++ gallery-1.5.2/setup/confirm.inc
+@@ -53,7 +53,7 @@
+ 		${str_replace('.', '', $outfile) . '_file'} = 0;
+ 	} else {
+ 		$error++;
+-		$viewheader .= '<br>'. gallery_error(sprintf(_("File %s is not writable by the webserver - chmod it 777 before proceeding.  See %s for more details."), "<i><b>$outfile</b></i>", $docs)) . "</p>\n";
++		$viewheader .= gallery_error(sprintf(_("File %s is not writable by the webserver - run %s before proceeding.  See %s for more details."), "<i><b>$outfile</b></i>", "<tt>/usr/share/gallery/configure.sh</tt>", $docs)) . "</p>\n";
+ 		${str_replace('.', '', $outfile) . '_file'} = 1;
+ 	}
+ }
+--- gallery-1.5.2.orig/setup/write.inc
++++ gallery-1.5.2/setup/write.inc
+@@ -193,7 +193,7 @@
+ 		$message .= "<br><br>";
+ 	else
+ 		$message = "";
+-	$message .= _("We highly suggest that you run 'secure.sh', or chmod your .htaccess and config.php to 644 for increased security.");
++	$message .= _("We highly suggest that you run '/usr/share/gallery/secure.sh' for increased security.");
+ }
+ 
+ // Inform the user that their gallery is not secure until they remove the 'resetadmin' file
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/gallery-PLD.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list