The following patch enable coredump after setuid.

    diff -r ead18326c13b osaf/libs/core/common/daemon.c
    --- a/osaf/libs/core/common/daemon.c        Fri Sep 26 08:53:42 2014 +0200
    +++ b/osaf/libs/core/common/daemon.c        Wed Oct 01 23:14:08 2014 +0000
    @@ -31,6 +31,7 @@
     #include <limits.h>
     #include <sys/stat.h>
     #include <sys/file.h>
    +#include <sys/prctl.h>
     
     #include <configmake.h>
     
    @@ -324,6 +325,7 @@
                                syslog(LOG_ERR, "setuid failed, uid=%d (%s)", 
pw->pw_uid, strerror(errno));
                                exit(EXIT_FAILURE);
                        }
    +                        prctl(PR_SET_DUMPABLE, 1,0,0,0);
                } else {
                        syslog(LOG_ERR, "invalid user name %s", 
__runas_username);
                        exit(EXIT_FAILURE);
    diff -r ead18326c13b osaf/services/infrastructure/nid/scripts/opensafd.in
    --- a/osaf/services/infrastructure/nid/scripts/opensafd.in  Fri Sep 26 
08:53:42 2014 +0200
    +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in  Wed Oct 01 
23:14:08 2014 +0000
    @@ -98,12 +98,19 @@
     }
     
     enable_coredump() {
    +        core_destination="/var/crash/opensaf"
        core_size="unlimited"
        core_pattern="/var/crash/opensaf/core_%t.%e.%p"
     
    -   if [ ! -d /var/crash/opensaf ]; then
    -           mkdir -p /var/crash/opensaf
    -   fi
    +        if [ ! -d ${core_destination} ]; then
    +                mkdir -p ${core_destination}
    +                if [ -n "$OPENSAF_GROUP" ]; then
    +                        getent group $OPENSAF_GROUP > /dev/null && chgrp 
$OPENSAF_GROUP ${core_destination}
    +                fi
    +                if [ -n "$OPENSAF_USER" ]; then
    +                        getent passwd $OPENSAF_USER > /dev/null && chown 
$OPENSAF_USER ${core_destination}
    +                fi
    +        fi
     
        if [ `ulimit -c` = 0 ]; then
                ulimit -c $core_size


---

** [tickets:#1106] Coredumps are not generated when running as non root**

**Status:** unassigned
**Milestone:** 4.6.FC
**Created:** Wed Sep 17, 2014 11:43 PM UTC by Adrian Szwej
**Last Updated:** Thu Sep 18, 2014 04:42 AM UTC
**Owner:** nobody

When running opensaf as non root; there are no coredumps generated during crash.
I have enabled coredumps in opensafd script.
Running kill -4 on any process running as opensaf does not generate coredump 
under /var/crash/opensaf 
Checking running opensaf process limit

    root@SC-1:/tmp# cat /proc/3657/limits 
    Limit                     Soft Limit           Hard Limit           Units   
  
    Max core file size        unlimited            unlimited            bytes   
 

Running kill -4 on amfnd or smfnd which are running as root generates coredumps 
in correct way.




---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to