umask help [SOLVED]
Woodchuck
djv at bedford.net
Sat Aug 26 00:02:12 PDT 2006
On Sat, 26 Aug 2006, George Goodman wrote:
> > Note that it is *NOT*
> > "beginning of line, zero or more spaces..."
> >
> > In other words it matches comments like
> >
> > # any text at all umask
>
> Right, but my entry definitely had only white space at the beginning
> of the line. It was either space(s) or tab.
Ah, so. I hadn't tried that deliberately.
What happens then might be within awk. (maybe).
umask 022 will assign to $1 and $2 within awk, but
<sp>umask 022 might go to $2 and $3
Nope, that's not it. With spaces or tabs, it works, for me.
printing $1 and $2 from within the awk scripts works.
Well, I got a bash 3.1.1 and have checked it slightly, and it
doesn't *seem* to be at fault. But I won't install it -- untrusted
software, blah blah. Untrusted as in "does unexpected things".
For example, fire up bash, and enter these two lines
# echo "\nfoo"
and
# /bin/echo "\nfoo"
You'd think they'd be the same, eh?
Nope, bash implements "echo" internally, using what I assume is
SysV or Solaris or some non-BSD system's semantics, and we ain't
doin' no SysV in this woodchuck's burrow. We see immediately the
problem, eh? A BSD system will come with scripts that expect echo
(and a few more utilities) to be separate programs, not shell
internal commands. Those scripts will want BSD semantics, which
the manpages will reflect. Scripts may depend on documented exit
statuses of those utilities, or even that the utilities are simply
standalone programs.
Now comes bash with Stallman's "better" ideas of Unix semantics,
(better than Korn's ideas, of course; Stallman's are "freedom ideas")
and forces them down your throat, breaking your system in difficult
to predicts way and places. They will appear mysterious. This
becomes a problem if you go "whole bash" and install bash in /bin,
and then, deleting the righteous sh, hardlink /bin/sh to bash. This
way lies madness. FSF might assert that bash behaves as BSD's sh
when invoked as sh, but I don't *trust* them. I don't trust anybody
who wants to make me a better person according to their notion of
"better". (End bash bashing.)
Did you simply install bash from a port or a package or did you
build and configure it manually? (We're starting to play "20 questions"
now, the thing that drives them mad on misc at open.)
The root of the problem is the somewhat fast & loose job in /etc/security,
but now I'm getting curious if bash is contributing a little to what's
left. This is adding new mystery. I wish I didn't have this problem.
Could you make ksh root's login shell for a few minutes and try
a "known problem" .profile with it and the /etc/security script?
That editor you're using/were using... it wouldn't have slipped in
something other than a righteous space or tab (0x20 or 0x09) in the
" umask 022" line? That would cause problems. (I'm thinking
of an editor that might have gotten "friendly", used a proportional
font, and maybe inserted some sort of "small space" or some other
goofy word processing character where God, man, beast and machine
want 0x09 or 0x20. (another reason to use vi(1)). Check with
hexdump(1) or "cat -v".
I'm scraping bottom now. Maybe just deleting the leading whitespace
would be enough? I *do* hate to put a problem away with a bug
still alive in it, though.
> Thanks,
It's good sport!
Dave
--
Experience runs an expensive school, but fools will learn in no other.
-- Benjamin Franklin
More information about the Openbsd-newbies
mailing list