aboutsummaryrefslogtreecommitdiff
path: root/src/connection/setuid.lisp
Commit message (Collapse)AuthorAge
* wrap OSICAT:USER-INFO with getent(1) fallbackSean Whitton2022-06-17
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* REHOME-CONNECTION: rename slot DATADIR -> REHOME-DATADIRSean Whitton2022-04-13
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* connection chain specs.: consistently use :USER for the target userSean Whitton2022-04-01
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: pass target uid to POSIX-LOGIN-ENVIRONMENT for correct PATHSean Whitton2021-11-01
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add & propagate :NO-SERVICES connattr and respect in LIBVIRT:STARTEDSean Whitton2021-10-29
| | | | | | | | | | | | | | | | | This change was prompted by the realisation that RECONNECTS nullifies any enclosing SERVICE:WITHOUT-STARTING-SERVICES because *HOST* during RECONNECTS is a distinct HOST value, computed at hostattrs time, which can't be affected by an enclosing combinator that works by temporarily pushing hostattrs at :APPLY time. So, for example, if we chroot and subsequently establish a :SETUID connection, properties might try to start services as the non-root user and there is no way for them to know they shouldn't. We can avoid this problem by using a connattr instead because we have a mechanism for propagating connattrs to subsequently established connections. And as in most cases the reason for not starting services is solely due to the way in which we're connecting to the host, a connattr is more appropriate. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: avoid creating user's ~/.cache/consfigurator/ owned by rootSean Whitton2021-10-28
| | | | | | This reverts and replaces commit b4eb20904aa8f4ea7ec0ef58eac7889b4b864277. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename :XDG-CACHE-HOME connattr to :XDG_CACHE_HOMESean Whitton2021-10-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: error when OSICAT:USER-INFO failsSean Whitton2021-10-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: ensure that the data directory actually existsSean Whitton2021-10-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: use OSICAT:USER-INFO rather than parsing id(1) outputSean Whitton2021-09-09
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* use CFFI, mostly via Osicat, for all syscalls/libc except fork(2)Sean Whitton2021-09-09
| | | | | | | | | | Also replace some calls to chmod(1) with calls to chmod(2). Using CFFI rather than implementation-specific wrappers should be better for portability. Also with this commit we stop hard coding types like uid_t as :UNSIGNED-INT, which was less portable. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* cache XDG_CACHE_HOME as a connattrSean Whitton2021-08-31
| | | | | | This should provide a performance improvement. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* fix comments about -c argument to su(1)Sean Whitton2021-07-24
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* return type in FOREIGN-FUNCALL of geteuid(2) is unsignedSean Whitton2021-07-24
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: ensure we chdir(2) before we setuid(2)Sean Whitton2021-07-24
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID connection: also call initgroups(3)Sean Whitton2021-07-24
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add POSIX-LOGIN-ENVIRONMENT and use in :SETUID connectionSean Whitton2021-07-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add TODOs about non-portable uses of su(1)Sean Whitton2021-05-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* convert CONNECTION slots to connattrs & fix finding homedirsSean Whitton2021-05-23
| | | | | | | | | | | | HOME does not take into account /etc/passwd inside the chroot, even when starting a login shell with, e.g., "chroot /chroot sh -lc 'echo $HOME'" -- we would need something which emulates login(1), like su(1), but the -c argument to su(1) is not portable. getent(1) is not POSIX. So use tilde expansion. Additionally, avoid having UPLOAD-ALL-PREREQUISITE-DATA store values for the remote UID, remote homedir etc. from *before* the chroot/setuid operation. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* replace some (REQUIRE "sb-posix") calls with conditional dependencySean Whitton2021-04-01
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rework fork(2) connectionsSean Whitton2021-03-27
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID: check for Lisp-type connection and rootSean Whitton2021-03-27
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* fix setting HOME in :SETUIDSean Whitton2021-03-25
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* :SETUID connection type: set HOMESean Whitton2021-03-25
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add :SETUID connection typeSean Whitton2021-03-23
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>