rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Alan Watson <alan@oldp.nmsu.edu>
To: rc@hawkwind.utcs.toronto.edu
Subject: umask SECURITY HOLE with rc on Solaris
Date: Fri, 25 Aug 1995 16:02:59 -0400	[thread overview]
Message-ID: <9508252002.AA00384@oldp.nmsu.edu> (raw)

By default in Solaris, shells inherit a umask of 0; this is Really
Bad.

The real fix is to change the system (edit /etc/default/login and set
the umask before before starting inetd -- credit to John Denune for the
latter fix) so that shells start with a umask of 022, but I still
suggest applying the following patch to rc to set umask to 022 iff
umask is initially 0.  I know this is undeniably hand-holding, but do
you really want to trust every overworked sysadmin trying to deal with
the pain of Solaris to catch this one?

Alan Watson

*** main.c.orig Fri Aug 25 10:24:34 1995
--- main.c      Fri Aug 25 10:22:09 1995
***************
*** 14,19 ****
--- 14,20 ----
  extern void main(int argc, char *argv[], char *envp[]) {
        char *dashsee[2], *dollarzero, *null[1];
        int c;
+       int oldumask;
        initprint();
        dashsee[0] = dashsee[1] = NULL;
        dollarzero = argv[0];
***************
*** 64,69 ****
--- 65,75 ----
                checkfd(1, rCreate);
                checkfd(2, rCreate);
        }
+       oldumask = umask(0);
+       if (oldumask == 0)
+               umask(022);
+       else
+               umask(oldumask);
        initsignal();
        inithash();
        initparse();


                 reply	other threads:[~1995-08-25 20:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9508252002.AA00384@oldp.nmsu.edu \
    --to=alan@oldp.nmsu.edu \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).