SUMMARY: patches change directory permissions & break sendmail

From: Chad Price (cprice@molbio.unmc.edu)
Date: Wed Sep 15 1999 - 07:55:49 CDT


Initttiial Question: (spelling altered because listproc refuses to send
messages with the word correctly spelled and located on the first line.)

At 12:11 PM 9/13/1999 -0500, Chad Price wrote:
>I'm running Sol 7 and have a (apparently bad) habit of installing patches
>as they come out. I'm also running majordomo to support some mailing lists.
>
>Lately, it seems that every time I install a set of patches, it breaks
>sendmail by changing permissions of one or more directories to be group
>writeable. Then I have to go and search out which ones got buggered up and
>fix them
>
>Does anyone know who at Sun to complain to in order to get them to fix
>their (broken) patch install routine so that it either leaves the
>permissions alone, or asks you if you want them "fixed"/changed?

Thanks to:
mwang@tech.cicg.ml.com (Michael Wang)
Greg Obremski <obremski@alpha.fdu.edu>
Christian Pinheiro <pinheiro@veritel.com.br>
brw@jazz.njit.edu
eric <eric@outlook.net>
Harry Levinson <levinson@ll.mit.edu>

Sun's patch routine is indeed broken in that it changes permissions without
asking or telling you. No one knew who to complain to at Sun.

Christian, however, provided a script to fix the permissions for sendmail.
Localize and fix as appropriate.

---------------------- cut here ---------------------
#!/bin/perl

# Checa-permissions
# Fix permissions in /usr /usr/local /usr/local/majordomo and
/usr/local/majordomo/lists
# It often happens when we install some patch
#
# Run in root crontab (we run in 2/2 minutes)
#
# Christian Pinheiro - Brazil

$erro = 0;
$listamail = "support\@domain.com.br";

@dirs =
("/usr","/usr/local","/usr/local/majordomo","/usr/local/majordomo/lists");

@usr1 = split(/\s+/,`ls -ld $dirs[0]`);
@usr2 = split(/\s+/,`ls -ld $dirs[1]`);
@usr3 = split(/\s+/,`ls -ld $dirs[2]`);
@usr4 = split(/\s+/,`ls -ld $dirs[3]`);

$erro = 1 unless $usr1[0] =~ "drwxr-xr-x";
$erro = 1 unless $usr2[0] =~ "drwxr-xr-x";
$erro = 1 unless $usr3[0] =~ "drwxr-xr-x";
$erro = 1 unless $usr4[0] =~ "drwxr-xr-x";

if ($erro)
{
     for ($i=0;$i<4;$i++)
     {
       system("chmod","755",$dirs[$i]);
     }

@usr5 = split(/\s+/,`ls -ld $dirs[0]`);
@usr6 = split(/\s+/,`ls -ld $dirs[1]`);
@usr7 = split(/\s+/,`ls -ld $dirs[2]`);
@usr8 = split(/\s+/,`ls -ld $dirs[3]`);

       &envia_email;
}

sub envia_email
{
    open(IN,"|/usr/lib/sendmail $listamail");
    select(IN);
    print << "EMAIL";
from: postmaster\@domain.com.br
To: $listamail
Subject: [WARNING] Fixed permissions on XXXXX Server - TESTING

DIRECTORY HOW IT WAS HOW IT IS
/usr -> $usr1[0] $usr5[0]
/usr/local -> $usr2[0] $usr6[0]
/usr/local/majordomo -> $usr3[0] $usr7[0]
/usr/local/majordomo/lists -> $usr4[0] $usr8[0]

This email was sent by: /usr/local/adm/checkall/check-permissions.pl -
Server XXXXX
EMAIL
}

---------------------- cut here ---------------------

Chad Price
Systems Manager
Genetic Sequence Analysis Facility
University of Nebraska Medical Center
600 S 42nd St
Omaha, NE 68506-6495
cprice@molbio.unmc.edu
(402) 559-9527
(402) 559-4077 (FAX)



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:26 CDT