Summary: LOG: ownership of directories and files should be configurable [#1181] Review request for Trac Ticket(s): 1181 Peer Reviewer(s): Lennart, Mathi Pull request to: Affected branch(es): default Development branch: default
-------------------------------- Impacted area Impact y/n -------------------------------- Docs y Build system n RPM/packaging n Configuration files y Startup scripts n SAF services n OpenSAF services y Core libraries y Samples n Tests y Other n Comments (indicate scope for each "y" above): --------------------------------------------- LOG: ownership of directories and files should be configurable [#1181] changeset 258707866f09278fbc475b72f21c2b81b1eea2e8 Author: Tai Dinh <tai.d...@dektech.com.au> Date: Fri, 13 Feb 2015 13:38:17 +0700 LOG: ownership of directories and files should be configurable [#1181] Explicitly treats ENOENT as no error for setgrent() since it always failed on UML changeset 1d743a32b27f06ff9251cf32fe9bbbc1914de490 Author: Tai Dinh <tai.d...@dektech.com.au> Date: Fri, 13 Feb 2015 13:38:18 +0700 LOG: ownership of directories and files should be configurable [#1181] New attribute has been added to log configuration object. logDataGroupname <Empty> Groupname used to share log data. This attribute if set will be used to own log files. Users who want to read log data need to become member of this group. This attribute can be changed in runtime. All log files will be reowned accordingly to this new group. Also new environment variable has been added to log configuration file: LOGSV_DATA_GROUPNAME This variable will be ignored if configured in IMM object. changeset 187e2f098d175bac8785d93e24ed1ce7d1e54182 Author: Tai Dinh <tai.d...@dektech.com.au> Date: Fri, 13 Feb 2015 13:38:18 +0700 LOG: ownership of directories and files should be configurable [#1181] 3 new TCs have been added to LOG OI test suite: - CCB Object Modify, data group. Group does not exist. Not allowed - CCB Object Modify, data group. Group exists. OK - CCB Object Modify, delete data group. OK Added Files: ------------ osaf/services/saf/logsv/lgs/lgs_mbcsv_v3.c osaf/services/saf/logsv/lgs/lgs_mbcsv_v3.h tests/logsv/README Complete diffstat: ------------------ osaf/libs/core/common/osaf_secutil.c | 4 +- osaf/services/saf/logsv/README | 31 +++++++++- osaf/services/saf/logsv/config/logd.conf | 6 ++ osaf/services/saf/logsv/config/logsv_classes.xml | 8 ++- osaf/services/saf/logsv/lgs/Makefile.am | 6 +- osaf/services/saf/logsv/lgs/lgs.h | 3 + osaf/services/saf/logsv/lgs/lgs_cb.h | 1 + osaf/services/saf/logsv/lgs/lgs_file.c | 5 + osaf/services/saf/logsv/lgs/lgs_file.h | 1 + osaf/services/saf/logsv/lgs/lgs_filehdl.c | 93 ++++++++++++++++++++++++++++++++++- osaf/services/saf/logsv/lgs/lgs_filehdl.h | 6 ++ osaf/services/saf/logsv/lgs/lgs_imm.c | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- osaf/services/saf/logsv/lgs/lgs_main.c | 9 ++- osaf/services/saf/logsv/lgs/lgs_mbcsv.c | 83 ++++++++++++++++++++++------- osaf/services/saf/logsv/lgs/lgs_mbcsv.h | 5 +- osaf/services/saf/logsv/lgs/lgs_mbcsv_v3.c | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ osaf/services/saf/logsv/lgs/lgs_mbcsv_v3.h | 64 +++++++++++++++++++++++ osaf/services/saf/logsv/lgs/lgs_util.c | 86 +++++++++++++++++++++++++++++++ osaf/services/saf/logsv/lgs/lgs_util.h | 2 + tests/logsv/README | 11 ++++ tests/logsv/tet_LogOiOps.c | 47 +++++++++++++++++ tools/cluster_sim_uml/uml/root_template/etc/group | 1 + 22 files changed, 866 insertions(+), 55 deletions(-) Testing Commands: ----------------- Below steps have been successfully executed with UML environment: 1. Setup environment: - Build OpenSAF - Build UML - At the host machine, add another group with name log-data and id 1006. - Add this group into the supplementary group list of yourself. The reason of this step is because UML mount the repl-opensaf of the host as its replicated storage. Inside the UML, OpenSAF will be started under opensaf (root) user and having log-data (1006) as its supplementary group. If this group does not exist in the host and does not contain yourself (the one who start the UML), then OpenSAF could not reown the log files (even if it will be run as root). - Start the UML (./opensaf start 2) # id opensaf uid=1000(opensaf) gid=1000(opensaf) groups=1000(opensaf),1006(log-data) 2. Execute the test scenario: a. Backward compatible test: - By default, the logDataGroupname will be left Empty. This means that the behaviour of LOGSV will be the same. Log files created will be owned by opensaf:opensaf. b. Negative test - set a not-existing group to data group: - Set data group to a non-existing group or a group not contain opensaf user. - Make sure that the modification is ignore. # immcfg -a logDataGroupname=dummyGroup logConfig=1,safApp=safLogService error - saImmOmCcbApply FAILED: SA_AIS_ERR_FAILED_OPERATION (21) OI reports: groupname: dummyGroup is NOT accepted c. Modification test - change the data group to log-data: - Set data group to log-data - Make sure that the modification is allowed and log configuration is updated. - Check that log files is now owned by log-data group. # immcfg -a logDataGroupname=log-data logConfig=1,safApp=safLogService # immlist logConfig=1,safApp=safLogService Name Type Value(s) ======================================================================== logStreamSystemLowLimit SA_UINT32_T 0 (0x0) logStreamSystemHighLimit SA_UINT32_T 0 (0x0) logStreamAppLowLimit SA_UINT32_T 0 (0x0) logStreamAppHighLimit SA_UINT32_T 0 (0x0) logRootDirectory SA_STRING_T /repl_opensaf/saflog logMaxLogrecsize SA_UINT32_T 1024 (0x400) logMaxApplicationStreams SA_UINT32_T 64 (0x40) logFileSysConfig SA_UINT32_T 1 (0x1) logFileIoTimeout SA_UINT32_T 500 (0x1f4) logDataGroupname SA_STRING_T log-data logConfig SA_STRING_T logConfig=1 SaImmAttrImplementerName SA_STRING_T safLogService SaImmAttrClassName SA_STRING_T OpenSafLogConfig SaImmAttrAdminOwnerName SA_STRING_T <Empty> d. Deletion test - delete the data group: - Delete the data group configuration. This will make the log data won't be shared anymore. - Make sure that the deletion is allowed and configuration is updated accordingly. # immcfg -a logDataGroupname= logConfig=1,safApp=safLogService # immlist logConfig=1,safApp=safLogService Name Type Value(s) ======================================================================== logStreamSystemLowLimit SA_UINT32_T 0 (0x0) logStreamSystemHighLimit SA_UINT32_T 0 (0x0) logStreamAppLowLimit SA_UINT32_T 0 (0x0) logStreamAppHighLimit SA_UINT32_T 0 (0x0) logRootDirectory SA_STRING_T /repl_opensaf/saflog logMaxLogrecsize SA_UINT32_T 1024 (0x400) logMaxApplicationStreams SA_UINT32_T 64 (0x40) logFileSysConfig SA_UINT32_T 1 (0x1) logFileIoTimeout SA_UINT32_T 500 (0x1f4) logDataGroupname SA_STRING_T <Empty> logConfig SA_STRING_T logConfig=1 SaImmAttrImplementerName SA_STRING_T safLogService SaImmAttrClassName SA_STRING_T OpenSafLogConfig SaImmAttrAdminOwnerName SA_STRING_T <Empty> Testing, Expected Results: -------------------------- - Expected result is the same as what described above Conditions of Submission: ------------------------- - Ack from reviewers Arch Built Started Linux distro ------------------------------------------- mips n n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: ------------------- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel