system-wide configuration file

Add options SYSCF (to add a system-wide configuration file) and SYSCF_FILE
(for a file-based implementation of SYSCF) - this allows a binary distribution
to be configured at install time.  The only option supported at this time is
WIZARDS - a list of usernames which can use -D; currently only for unix-likes
but should be extendable to anything that has a concept of multiple users.
Add mac tty multiuser config using sgid.
This commit is contained in:
keni
2008-01-09 01:57:41 +00:00
parent 9c3f6f78b9
commit f2d37bac2e
17 changed files with 269 additions and 26 deletions

View File

@@ -24,3 +24,5 @@ WINTTYLIB=-lcurses
CHOWN=true
CHGRP=true
VARDIRPERM = 0755

View File

@@ -26,6 +26,7 @@ VARDATND = x11tiles NetHack.ad pet_mark.xbm
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir)

View File

@@ -29,3 +29,4 @@ WINTTYLIB=-lncurses
CHOWN=true
CHGRP=true
VARDIRPERM = 0755

55
sys/unix/hints/macosx-mu Normal file
View File

@@ -0,0 +1,55 @@
#
# SCCS Id: @(#)macosx-mu 3.5 2007/12/12
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details.
#
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.4.10 (Darwin 8.10). If this doesn't work for some
# other version of either Darwin or Mac OS X, make a new file for that OS,
# don't change this one.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# This is a tty build for a system with multiple users (since it is a tty
# build it does not try to look like a .app application).
# NetHack will be owned by user "games" and group "bin" - change the next 2
# lines if this is a problem:
GAMEUID = games
GAMEGRP = bin
# NB: "make install" should be run as an admin user:
# sudo make install
# NB: do NOT use $(wildcard ~$(GAMEUID)) since the user may not exist yet.
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS=-g -I../include $(CFLAGS2) $(CFLAGS3)
CFLAGS2=-DNOCLIPPING -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS3=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
VARFILEPERM = 0664
VARDIRPERM = 0775
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user $(GAMEUID); . sys/unix/hints/macosx.sh group $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL= touch $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf
# notes:
#1) ~games/games is owned by root.
#2) group games exists because user games was created via Accounts pane.
#3) who should own/be able to run recover?

View File

@@ -32,6 +32,7 @@ CHGRP=true
WINSRC = $(WINX11SRC)
WINOBJ = $(WINX11OBJ)
WINLIB = $(WINX11LIB)
VARDIRPERM = 0755
VARDATND = x11tiles NetHack.ad pet_mark.xbm

57
sys/unix/hints/macosx.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/sh
# SCCS Id: @(#)macosx-mu.sh 3.5 2007/12/12
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details.
#
# hints helper script for macosx
# DO NOT invoke directly
cmd=$1
case "x$cmd" in
xuser)
user=$2
gotuser=`niutil -readval . /users/$user name 0 2>/dev/null`
[ -z $gotuser ] && (echo "User $user does not exist."
exit 1;
)
exit 0
;;
#name: dummy1
#_writers_passwd: dummy1
#_writers_tim_password: dummy1
#_writers_picture: dummy1
#home: /Users/dummy1
#gid: 504
#picture: /Library/User Pictures/Animals/Dragonfly.tif
#uid: 504
#hint: dummy1
#_writers_hint: dummy1
#sharedDir:
#_shadow_passwd:
#_writers_realname: dummy1
#shell: /bin/bash
#passwd: ********
#authentication_authority: ;ShadowHash;
#realname: dummyname1
#generateduid: F6D4991C-BDF5-481F-A407-D84C6A2D0E2A
xgroup)
group=$2
gotgrp=`niutil -readval . /groups/$group name 0 2>/dev/null`
[ -z $gotgrp ] && ( echo "Group $group does not exist."
exit 1
)
exit 0
;;
#niutil -read . /groups/bin name 0
#name: bin
#gid: 7
#passwd: *
#generateduid: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000007
#smb_sid: S-1-5-21-107
#realname: Binary
*) echo "Unknown command $cmd"
exit 1
;;
esac

View File

@@ -23,3 +23,10 @@ WINTTYLIB=-ltermlib
CHOWN=chown
CHGRP=chgrp
GAMEUID = games
GAMEGRP = bin
GAMEPERM = 04755
VARFILEPERM = 0644
VARDIRPERM = 0755