OpenCSW Bug Tracker


Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003685 [cswclassutils] packaging tweak always 2009-05-23 11:39 2009-07-06 15:22
Reporter ja View Status public  
Assigned To bonivart
Priority normal Resolution fixed  
Status closed  
Summary 0003685: cswpreserveconf
Description Config files handled with the class cswpreserveconf have always the ownerships root:other and not the desired ownership, which is specified for the .CSW file.

Example:

In CSWnagios.prototype

f cswpreserveconf /opt/csw/nagios/etc/cgi.cfg.CSW 0664 nagios nagios

results in

-rw-r--r-- 1 root other 10695 May 22 22:19 cgi.cfg
-rw-rw-r-- 1 nagios nagios 10695 Mar 20 22:26 cgi.cfg.CSW

and not as expected in

-rw-r--r-- 1 nagios nagios 10695 May 22 22:19 cgi.cfg
Additional Information
Tags No tags attached.
Attached Files

- Relationships
related to 0003959closedbonivart sampleconf fails sometimes 

-  Notes
(0006184)
bonivart (developer)
2009-05-23 12:25

Also the permissions are from umask, not from .CSW file.
(0006185)
bonivart (developer)
2009-05-23 12:26

Phil is looking into this, I'm pretty sure it concerns cswcpsampleconf as well.
(0006216)
bonivart (developer)
2009-05-28 15:25

The problem is that the copy operation occurs before proper ownership/permissions are set (verification stage for each class), thus even a preserve copy only yields a file with default ownership/permissions.

One possible solution (not verified) is to locate the pkgmap during install and grep it for the correct ownership/permissions and apply them to the copy.
(0006376)
bonivart (developer)
2009-07-01 16:47

Patch for cswcpsampleconf:

--- i.cswcpsampleconf.090701 Wed Jul 1 13:59:09 2009
+++ i.cswcpsampleconf Wed Jul 1 16:47:10 2009
@@ -31,7 +31,13 @@
                echo $confdest already exists. Not overwriting
        else
                echo Copying sample config to $confdest
- cp -p $dest $confdest
+ contents=`grep "^$dest" /var/sadm/install/contents`
+ mode=`echo $contents | awk '{print $4}'`
+ user=`echo $contents | awk '{print $5}'`
+ group=`echo $contents | awk '{print $6}'`
+ cp $dest $confdest
+ chmod $mode $confdest
+ chown $user:$group $confdest
        fi
 done
(0006380)
bonivart (developer)
2009-07-02 14:36

1.17 in testing with the above patch.

http://mirror.opencsw.org/testing/cswclassutils-1.17,REV=2009.07.02-SunOS5.8-all-CSW.pkg.gz [^]
(0006398)
bonivart (developer)
2009-07-05 21:13

No response...I will install nagios myself and it sets ownership/permissions correctly I will release 1.17.
(0006401)
ja (developer)
2009-07-06 12:09

Sorry for the late feedback. Works great! I tested it with Nagios and another package, which is still under development and not published.
(0006402)
bonivart (developer)
2009-07-06 14:46

Ok, great, I have tested it as well and it seems to work so I will release it.

By the way, couldn't you have used the usergroup class to add users and groups?

http://wiki.opencsw.org/cswclassutils-package#toc5 [^]
(0006403)
bonivart (developer)
2009-07-06 15:22

cswclassutils 1.17 released which fixes the issue in both cpsampleconf and preserveconf.


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker