Ack
/Hans

> -----Original Message-----
> From: Anders Bjornerstedt [mailto:[email protected]]
> Sent: den 5 september 2014 16:32
> To: [email protected]; Zoran Milinkovic
> Cc: [email protected]
> Subject: [devel] [PATCH 2 of 2]
> 
>  osaf/services/saf/immsv/immnd/immnd_evt.c |  40 
> ++++++++++++++++--------------
>  1 files changed, 21 insertions(+), 19 deletions(-)
> 
> 
> Access controll for the imm service has been generalized to cover
> any modifications of the two imm service objects:
> 
>     opensafImm=opensafImm,safApp=safImmService
>     safRdn=immManagement,safApp=safImmService
> 
> Only root users are allowed to modify these objects.
> 
> diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c 
> b/osaf/services/saf/immsv/immnd/immnd_evt.c
> --- a/osaf/services/saf/immsv/immnd/immnd_evt.c
> +++ b/osaf/services/saf/immsv/immnd/immnd_evt.c
> @@ -3103,26 +3103,28 @@ static SaAisErrorT immnd_fevs_local_chec
>       }
> 
>       switch (frwrd_evt.info.immnd.type) {
> +
> +     case IMMND_EVT_A2ND_OBJ_MODIFY:
> +             if ((strcmp(frwrd_evt.info.immnd.info.objModify.objectName.buf, 
> OPENSAF_IMM_OBJECT_DN) == 0) ||
> +                 (strcmp(frwrd_evt.info.immnd.info.objModify.objectName.buf,
> "safRdn=immManagement,safApp=safImmService") == 0))
> +             {
> +                     /* Modifications to:
> +                              opensafImm=opensafImm,safApp=safImmService
> +                        or:
> +                             safRdn=immManagement,safApp=safImmService
> +                        are only allowed for root users.
> +                     */
> +                     if (sinfo->uid != 0) {
> +                             struct passwd *pwd = getpwuid(sinfo->uid);
> +                             if (pwd != NULL)
> +                                     syslog(LOG_AUTH, "Modifications to imm 
> service objects denied for %s(uid=%d)",
> +                                             pwd->pw_name, sinfo->uid);
> +                             error = SA_AIS_ERR_ACCESS_DENIED;
> +                             goto done;
> +                     }
> +             }
> +             /* intentional fall through. */
>       case IMMND_EVT_A2ND_OBJ_CREATE:
> -     case IMMND_EVT_A2ND_OBJ_MODIFY:
> -             if ((frwrd_evt.info.immnd.type == IMMND_EVT_A2ND_OBJ_MODIFY) &&
> -                             
> (strcmp(frwrd_evt.info.immnd.info.objModify.objectName.buf,
> -                                             OPENSAF_IMM_OBJECT_DN) == 0)) {
> -                     IMMSV_ATTR_MODS_LIST *attrMod = 
> frwrd_evt.info.immnd.info.objModify.attrMods;
> -                     while (attrMod != NULL) {
> -                             if (strcmp(attrMod->attrValue.attrName.buf, 
> OPENSAF_IMM_ACCESS_CONTROL_MODE) == 0) {
> -                                     if (sinfo->uid != 0) {
> -                                             struct passwd *pwd = 
> getpwuid(sinfo->uid);
> -                                             if (pwd != NULL)
> -                                                     syslog(LOG_AUTH, 
> "change of access control mode denied for %s(uid=%d)",
> -                                                             pwd->pw_name, 
> sinfo->uid);
> -                                             error = 
> SA_AIS_ERR_ACCESS_DENIED;
> -                                             goto done;
> -                                     }
> -                             }
> -                             attrMod = attrMod->next;
> -                     }
> -             }
>       case IMMND_EVT_A2ND_OBJ_DELETE:
>       case IMMND_EVT_A2ND_CCB_FINALIZE:
>       case IMMND_EVT_A2ND_OI_CCB_AUG_INIT:
> 
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to