[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
umask problem with processes: for HP-UX 10.20
From: |
David Bianco |
Subject: |
umask problem with processes: for HP-UX 10.20 |
Date: |
24 Apr 2002 14:59:03 -0400 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
I had a process line like:
processes:
"myserv" umask=022 restart "/etc/init.d/myserv restart"
This failed to parse, complaining that it couldn't read a valid
umask:
cf:hostname:/path/to/cf/cf.hpux:45: umask value must be an octal number >= zero
cfengine:cnode4::Execution terminated after parsing due to errors in program
I didn't have this problem under Linux (RedHat 7.2) or Solaris 2.6. I
found that the code for install.c uses a variable of type "mode_t" as
though it were an "int", but on HP-UX they aren't the same size so the
code wasn't reading the value from the config file properly. Here's a
simple patch to be a little more portable, I think. I have tried it
with HP-UX 10.20, RH 7.2 and Solaris 2.6, and it seems to do the right
thing on all platforms.
*** install.c.orig Wed Apr 24 13:51:52 2002
--- install.c Wed Apr 24 13:52:15 2002
***************
*** 3135,3141 ****
char *value;
! { mode_t num = -1;
Debug("HandleUmask(%s)",value);
--- 3135,3141 ----
char *value;
! { int num = -1;
Debug("HandleUmask(%s)",value);
***************
*** 3146,3152 ****
yyerror("umask value must be an octal number >= zero");
}
! UMASK = num;
}
/*******************************************************************/
--- 3146,3152 ----
yyerror("umask value must be an octal number >= zero");
}
! UMASK = (mode_t) num;
}
/*******************************************************************/
--
David J. Bianco, GSEC <address@hidden>
Thomas Jefferson National Accelerator Facility
The views expressed herein are soley those of the author and
not those of SURA/Jefferson Lab or the US DOE.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- umask problem with processes: for HP-UX 10.20,
David Bianco <=