* Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
@ 1992-07-06 7:52 Mark Prior
1992-07-06 10:22 ` Wieland Eckert
0 siblings, 1 reply; 7+ messages in thread
From: Mark Prior @ 1992-07-06 7:52 UTC (permalink / raw)
SCCS seems to be seriously broken under Ultrix 4.2x. Most commands I
try (including sccs create) fail with the "very useful" diagnostic
"cannot create lock file (cm4)".
What is broken and can it be fixed?
Please e-mail me, I hardly ever have the time to keep up with this
group (also I will be away for 2 weeks from Wednesday and anything you
post will expire before I get back to read it :-)
Thanks,
Mark.
--
Mark Prior Phone : +61 8 228 5680
Information Technology Division Telex : UNIVAD AA89141
University of Adelaide Fax : +61 8 223 6245
GPO Box 498 Adelaide S.AUSTRALIA 5001 E-mail: mrp@ITD.Adelaide.EDU.AU
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
1992-07-06 7:52 Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix? Mark Prior
@ 1992-07-06 10:22 ` Wieland Eckert
1992-07-06 12:07 ` Michel Fingerhut
0 siblings, 1 reply; 7+ messages in thread
From: Wieland Eckert @ 1992-07-06 10:22 UTC (permalink / raw)
mrp@ITD.Adelaide.EDU.AU (Mark Prior) writes:
>SCCS seems to be seriously broken under Ultrix 4.2x. Most commands I
>try (including sccs create) fail with the "very useful" diagnostic
>"cannot create lock file (cm4)".
Sounds like wrong permission for the SCCS directory. Have a look
at the man which has the example:
To create all the source files in a given directory in SCCS format, run
the following shell script from csh:
mkdir SCCS save
-> chown sccs SCCS
foreach i (*.[.ch])
sccs admin -i$i $i
mv $i save/$i
end
Note that to run the chown command, you must be the superuser.
>What is broken and can it be fixed?
But I have a real problem with SCCS:
when updating a file with some weird entry SCCS eats all space of the
file system (over 20MB) until process terminates with 'disk full'.
SCCS with the same files on a SUN gives 'line too long error' which
is fine. Ultrix 4.2 SCCS is just crashing.
>Please e-mail me,
Do you want that files ??
>Thanks,
>Mark.
Hope this will help
Wieland
-----
Wieland Eckert, Universitaet Erlangen-Nuernberg, Mustererkennung
e-mail: wieland.eckert@informatik.uni-erlangen.de
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
1992-07-06 10:22 ` Wieland Eckert
@ 1992-07-06 12:07 ` Michel Fingerhut
1992-07-06 14:55 ` Lance Juno
1992-07-07 15:31 ` Peter Holzer
0 siblings, 2 replies; 7+ messages in thread
From: Michel Fingerhut @ 1992-07-06 12:07 UTC (permalink / raw)
mrp@ITD.Adelaide.EDU.AU (Mark Prior) writes:
>SCCS seems to be seriously broken under Ultrix 4.2x. Most commands I
>try (including sccs create) fail with the "very useful" diagnostic
>"cannot create lock file (cm4)".
wieckert@immd5.informatik.uni-erlangen.de (Wieland Eckert) replies:
>Sounds like wrong permission for the SCCS directory. Have a look
>at the man which has the example:
>
> To create all the source files in a given directory in SCCS format, run
> the following shell script from csh:
>
> mkdir SCCS save
>-> chown sccs SCCS
> ...
Indeed, but how does a vanilla non superuser do this? I know that the
suggestion somewhere in the manuals is that each "group" have its sccs
etc... but if you don't want it that way, but just the plain ole unix
way? Remove the suid bit? Use RCS?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
1992-07-06 12:07 ` Michel Fingerhut
@ 1992-07-06 14:55 ` Lance Juno
1992-07-06 18:41 ` Marcus J. "will do TCP/IP for food" Ranum
1992-07-06 19:19 ` Chris Petrilli
1992-07-07 15:31 ` Peter Holzer
1 sibling, 2 replies; 7+ messages in thread
From: Lance Juno @ 1992-07-06 14:55 UTC (permalink / raw)
In article <1992Jul6.120717.1341@ircam.fr>, fingerhu@ircam.fr (Michel Fingerhut) writes:
>
>mrp@ITD.Adelaide.EDU.AU (Mark Prior) writes:
>>SCCS seems to be seriously broken under Ultrix 4.2x. Most commands I
>>try (including sccs create) fail with the "very useful" diagnostic
>>"cannot create lock file (cm4)".
>
>wieckert@immd5.informatik.uni-erlangen.de (Wieland Eckert) replies:
>>Sounds like wrong permission for the SCCS directory. Have a look
>>at the man which has the example:
>>
>> To create all the source files in a given directory in SCCS format, run
>> the following shell script from csh:
>>
>> mkdir SCCS save
>>-> chown sccs SCCS
>> ...
>
>Indeed, but how does a vanilla non superuser do this? I know that the
>suggestion somewhere in the manuals is that each "group" have its sccs
>etc... but if you don't want it that way, but just the plain ole unix
>way? Remove the suid bit? Use RCS?
>
Alternatively, you could copy the sccs image into your 'bin' directory. In doing
this, the problem with the effective id is removed and the lock files will be created
without problems.
Lance
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
1992-07-06 14:55 ` Lance Juno
@ 1992-07-06 18:41 ` Marcus J. "will do TCP/IP for food" Ranum
1992-07-06 19:19 ` Chris Petrilli
1 sibling, 0 replies; 7+ messages in thread
From: Marcus J. "will do TCP/IP for food" Ranum @ 1992-07-06 18:41 UTC (permalink / raw)
I hadn't realized sccs installs setuid root. That makes me kind of
unhappy in general. Yet another reason to use RCS.
mjr.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
1992-07-06 14:55 ` Lance Juno
1992-07-06 18:41 ` Marcus J. "will do TCP/IP for food" Ranum
@ 1992-07-06 19:19 ` Chris Petrilli
1 sibling, 0 replies; 7+ messages in thread
From: Chris Petrilli @ 1992-07-06 19:19 UTC (permalink / raw)
In article <1992Jul6.145518.20659@dnbf01.bram.cdx.mot.com> ljuno@zeus.bram.cdx.mot.com (Lance Juno) writes:
>
>Alternatively, you could copy the sccs image into your 'bin'
>directory. In doing this, the problem with the effective id is
>removed and the lock files will be created without problems.
Seems to me that this is entirely the wrong approach to the problem.
Personally I use RCS and CVS for all my software development, mainly
because 1) it's simpler, 2) it's free 3) it's in source and I can fix
the bugs that might crop up.
Unless you HAVE to use SCCS, I would suggest trying RCS or CVS (which
is a program designed to work with large projects and is built over
RCS), both of which are distributed by the FSF and are available on
prep.ai.mit.edu and any other mirror site.
Chris
--
| Chris Petrilli ____
| petrilli@gnu.ai.mit.edu \ /
| I don't even speak for myself. \/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix?
1992-07-06 12:07 ` Michel Fingerhut
1992-07-06 14:55 ` Lance Juno
@ 1992-07-07 15:31 ` Peter Holzer
1 sibling, 0 replies; 7+ messages in thread
From: Peter Holzer @ 1992-07-07 15:31 UTC (permalink / raw)
fingerhu@ircam.fr (Michel Fingerhut) writes:
>>-> chown sccs SCCS
>Indeed, but how does a vanilla non superuser do this? I know that the
>suggestion somewhere in the manuals is that each "group" have its sccs
>etc... but if you don't want it that way, but just the plain ole unix
>way? Remove the suid bit? Use RCS?
Each is probably a good idea. But if you can't do either for some reason
(too many existing projects on SCCS basis with too many users in
different groups, ...)
I wrote a suid program `mkSCCS' to create an SCCS directory with the
proper permissions. Unfortunately it grew longer and longer as people
discovered security flaws in it. It has now been stable for more than
half a year, so I dare to send it out.
(Code is public domain. If you find bugs or improve the program I'd
like to know)
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: Makefile mkSCCS.c mkSCCS.1
# Wrapped by hp@miles.vmars.tuwien.ac.at on Tue Jul 7 17:26:39 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(280 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# Makefile for mkSCCS
X#
X# @(#) Makefile 1.4 10/10/91 hp@vmars.tuwien.ac.at
X
CFLAGS = -Wall -g
CC = gcc
X
mkSCCS: mkSCCS.o
X $(CC) mkSCCS.o -o mkSCCS
X
install: mkSCCS mkSCCS.1
X install -s -o root -m 4711 mkSCCS /usr/local/bin/mkSCCS
X install -c mkSCCS.1 /usr/local/man/man1/mkSCCS.1
END_OF_FILE
if test 280 -ne `wc -c <'Makefile'`; then
echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'mkSCCS.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mkSCCS.c'\"
else
echo shar: Extracting \"'mkSCCS.c'\" \(4110 characters\)
sed "s/^X//" >'mkSCCS.c' <<'END_OF_FILE'
X/*
X * mkSCCS -- create a SCCS directory with proper owner
X *
X * I hope this cannot be used to breach system security.
X * Hackers, have a go on it :-)
X */
X
char mkSCCS_sid [] = "@(#) mkSCCS.c 1.3 10/10/91 hp@vmars.tuwien.ac.at";
X
X#include <errno.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <stdarg.h>
X
X#include <pwd.h>
X#include <unistd.h>
X#include <sys/types.h>
X#include <sys/file.h>
X#include <sys/stat.h>
X
extern int getopt (int argc, char ** argv, char * options);
X
X#define SCCS "SCCS" /* name of SCCS directory */
X#define PERM 0755 /* perms for " " */
X#define SCCSACC "sccs" /* name of SCCS account */
X
char buffer [BUFSIZ]; /* should be big enough for a filename :-) */
char * scratchdir;
X
X void
error (
X int status,
X char const * fmt, ...
X){
X va_list ap;
X va_start (ap, fmt);
X vfprintf (stderr, fmt, ap);
X va_end (ap);
X perror ("");
X switch (status) {
X case 3:
X rename (SCCS, "../" SCCS);
X case 2:
X chdir ("..");
X case 1:
X rmdir (scratchdir) ;
X case 0:
X break;
X }
X exit (1);
X}
X
X
X int
main (
X int argc,
X char ** argv
X){
X int user; /* who called me ? */
X int euser; /* effective uid of program (should be root) */
X int sccs; /* uid of sccs */
X struct stat sb;
X struct passwd * pwe;
X int fd;
X int renflag = 0;
X int paranoid = 0;
X int oldumask;
X int c, m;
X
X while ((c = getopt (argc, argv, "p")) != EOF) {
X switch (c) {
X case 'p':
X paranoid = 1;
X break;
X default:
X fprintf (stderr, "Usage: %s [-p]\n", argv [0]);
X exit (1);
X }
X }
X
X /* get necessary uids
X */
X user = getuid ();
X euser = geteuid ();
X if ((pwe = getpwnam (SCCSACC)) == NULL) error (0, "%s: %s has no account: ", argv [0], SCCS);
X sccs = pwe->pw_uid;
X
X oldumask = umask (022);
X
X if (setuid (euser) == -1) error (0, "%s: cannot setuid to %d: ", argv [0], euser);
X
X /* set effective uid to that of the user
X * while making the directory.
X * This prevents the user from making SCCS subdirectories
X * in directories where he does not have write permissions.
X */
X
X if (seteuid (user) == -1) error (0, "%s: cannot seteuid to %d: ", argv [0], user);
X
X if (stat (".", &sb) < 0) error (0, "%s: cannot stat .: %s ", argv [0]);
X if (((sb.st_mode & 0222) >> 1) != (sb.st_mode & 0111)) {
X if (paranoid) {
X if (chmod (".", ((m = sb.st_mode & 0222) | (m << 1) | (m >> 1)) & sb.st_mode) < 0) {
X error (0, "%s: cannot chmod .: ", argv [0]);
X }
X } else {
X fprintf (stderr,
X "%s: Warning: mode %o of \".\" allows editing without write permission\n",
X argv [0], sb.st_mode);
X }
X }
X
X if ((scratchdir = tempnam (".", SCCS)) == NULL) error (0, "%s: cannot create scratch directory: ", argv [0]);
X if (mkdir (scratchdir, 0700) < 0) error (0, "%s: cannot mkdir %s: ", argv [0], SCCS);
X
X /* Ok. I now have a private directory in the CWD
X * So I do the rest as root.
X */
X if (seteuid (euser) == -1) error (1, "%s: cannot seteuid to %d: ", argv [0], user);
X /* Set the directory so that only root can do something in it
X */
X if (chown (scratchdir, 0, 0) < 0) error (1, "%s: cannot chown %s: ", argv [0], scratchdir);
X /* and set up the SCCS dir in this scratch dir
X */
X if (chdir (scratchdir) < 0) error (1, "%s: cannot chdir to %s: ", argv [0], SCCS);
X /* try to use existing SCCS dir
X */
X if (rename ("../" SCCS, SCCS) < 0) {
X if (mkdir (SCCS, PERM) < 0) error (2, "%s: cannot mkdir %s: ", argv [0], SCCS);
X } else {
X renflag = 1;
X }
X
X /* check if everything is ok
X */
X if (stat (SCCS, &sb) < 0) error (3, "%s: cannot stat %s: ", argv [0], SCCS);
X if (! (sb.st_mode & S_IFDIR)) error (3, "%s: %s is not a directory\n", argv [0], SCCS);
X if (renflag && sb.st_uid != user) error (3, "%s: Not owner of %s\n", argv [0], SCCS);
X /* give dir to sccs
X */
X if (chown (SCCS, sccs, sb.st_gid) < 0) error (3, "%s: cannot chown %s: ", argv [0], SCCS);
X /* now move it back where it belongs
X */
X if (rename (SCCS, "../" SCCS) < 0) error (2, "%s: cannot rename %s to %s: ", argv [0], SCCS, "../" SCCS);
X /* and erase all traces
X */
X if (chdir ("..") < 0) error (0, "%s: cannot chdir to ..: ", argv [0]);
X if (rmdir (scratchdir) < 0) error (0, "%s: cannot rmdir %s: ", argv [0], scratchdir);
X return 0;
X close (fd);
X}
END_OF_FILE
if test 4110 -ne `wc -c <'mkSCCS.c'`; then
echo shar: \"'mkSCCS.c'\" unpacked with wrong size!
fi
# end of 'mkSCCS.c'
fi
if test -f 'mkSCCS.1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mkSCCS.1'\"
else
echo shar: Extracting \"'mkSCCS.1'\" \(978 characters\)
sed "s/^X//" >'mkSCCS.1' <<'END_OF_FILE'
X.\= @(#) mkSCCS.1 1.3 10/10/91 hp@vmars.tuwien.ac.at
X.TH mkSCCS 1 "10/10/91"
X.SH NAME
mkSCCS \- make SCCS directory with owner sccs
X.SH SYNOPSIS
X\fImkSCCS\fR [\fI-p\fR]
X.SH DESCRIPTION
X\fImkSCCS\fR creates a directory SCCS with owner sccs and mode 0755 in
the current directory. If the directory does already exist and is owned
by the user its owner is just changed to sccs.
This program allows users without root privileges to create SCCS
directories.
Because any user who has access to the SCCS directory can add new
deltas, mkSCCS warns if the search permissions of the current directory
are less strict than the write permissions.
X.SH OPTIONS
X.IP -p
X(Paranoid) changes the read and execute permissions of the current
directory to match the write permissions.
X.SH NOTES
Care has been taken to eliminate all possible security
holes a setuid program opens. If you find any left, please report them
to me.
X.SH AUTHOR
Peter J. Holzer (hp@vmars.tuwien.ac.at)
X.SH SEE ALSO
sccs(1)
END_OF_FILE
if test 978 -ne `wc -c <'mkSCCS.1'`; then
echo shar: \"'mkSCCS.1'\" unpacked with wrong size!
fi
# end of 'mkSCCS.1'
fi
echo shar: End of shell archive.
exit 0
--
| _ | Peter J. Holzer | Think of it |
| |_|_) | Technical University Vienna | as evolution |
| | | | Dept. for Real-Time Systems | in action! |
| __/ | hp@vmars.tuwien.ac.at | Tony Rand |
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1992-07-07 15:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-07-06 7:52 Why is SCCS broken under Ultrix 4.2[ABC] and is there a fix? Mark Prior
1992-07-06 10:22 ` Wieland Eckert
1992-07-06 12:07 ` Michel Fingerhut
1992-07-06 14:55 ` Lance Juno
1992-07-06 18:41 ` Marcus J. "will do TCP/IP for food" Ranum
1992-07-06 19:19 ` Chris Petrilli
1992-07-07 15:31 ` Peter Holzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox