pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/runas



Module Name:    pkgsrc
Committed By:   bacon
Date:           Mon Sep 11 14:01:39 UTC 2023

Added Files:
        pkgsrc/sysutils/runas: DESCR Makefile PLIST distinfo
        pkgsrc/sysutils/runas/patches: patch-runas.c

Log Message:
sysutils/runas: Run a command as another user

Runas is a tool for running commands as another user.  It is an
alternative to "sudo", which has a history of serious security issues,
and "su", which is inconvenient for anything but running a shell.

The runas command is a simple wrapper around "su" to streamline its
use.  It differs from "sudo" in that it requires the password of the
target user rather than the calling user, and it requires no SUID
permissions or configuration.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/runas/DESCR \
    pkgsrc/sysutils/runas/Makefile pkgsrc/sysutils/runas/PLIST \
    pkgsrc/sysutils/runas/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/runas/patches/patch-runas.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/sysutils/runas/DESCR
diff -u /dev/null pkgsrc/sysutils/runas/DESCR:1.1
--- /dev/null   Mon Sep 11 14:01:39 2023
+++ pkgsrc/sysutils/runas/DESCR Mon Sep 11 14:01:39 2023
@@ -0,0 +1,8 @@
+Runas is a tool for running commands as another user.  It is an
+alternative to "sudo", which has a history of serious security issues,
+and "su", which is inconvenient for anything but running a shell.
+
+The runas command is a simple wrapper around "su" to streamline its
+use.  It differs from "sudo" in that it requires the password of the
+target user rather than the calling user, and it requires no SUID
+permissions or configuration.
Index: pkgsrc/sysutils/runas/Makefile
diff -u /dev/null pkgsrc/sysutils/runas/Makefile:1.1
--- /dev/null   Mon Sep 11 14:01:39 2023
+++ pkgsrc/sysutils/runas/Makefile      Mon Sep 11 14:01:39 2023
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2023/09/11 14:01:39 bacon Exp $
+
+DISTNAME=      runas-0.1.1
+CATEGORIES=    sysutils
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=outpaddling/}
+GITHUB_PROJECT=        runas
+
+MAINTAINER=    bacon%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/outpaddling/runas
+COMMENT=       Wrapper around su for running a command as another user
+LICENSE=       2-clause-bsd
+
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/sysutils/runas/PLIST
diff -u /dev/null pkgsrc/sysutils/runas/PLIST:1.1
--- /dev/null   Mon Sep 11 14:01:39 2023
+++ pkgsrc/sysutils/runas/PLIST Mon Sep 11 14:01:39 2023
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2023/09/11 14:01:39 bacon Exp $
+bin/runas
+man/man1/runas.1
Index: pkgsrc/sysutils/runas/distinfo
diff -u /dev/null pkgsrc/sysutils/runas/distinfo:1.1
--- /dev/null   Mon Sep 11 14:01:39 2023
+++ pkgsrc/sysutils/runas/distinfo      Mon Sep 11 14:01:39 2023
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2023/09/11 14:01:39 bacon Exp $
+
+BLAKE2s (runas-0.1.1.tar.gz) = 243575aeb11ee27d883adb023410f1934633478da8e093fd7e1136e1e7b78306
+SHA512 (runas-0.1.1.tar.gz) = 1eca9dbf5bfe805a4902542a4f556a632ab6cc0a807245cea5c56d606174e705fa6e4d2558b5f31c8b1242fabcfcf17740ad8a13cf1ff8d0681f1c001b0c1527
+Size (runas-0.1.1.tar.gz) = 4084 bytes
+SHA1 (patch-runas.c) = d0a50e953b76e535cb7a209614411341fa47631b

Index: pkgsrc/sysutils/runas/patches/patch-runas.c
diff -u /dev/null pkgsrc/sysutils/runas/patches/patch-runas.c:1.1
--- /dev/null   Mon Sep 11 14:01:39 2023
+++ pkgsrc/sysutils/runas/patches/patch-runas.c Mon Sep 11 14:01:39 2023
@@ -0,0 +1,45 @@
+$NetBSD: patch-runas.c,v 1.1 2023/09/11 14:01:39 bacon Exp $
+
+# Linux missing strl*()
+
+--- runas.c.orig       2021-02-04 13:39:53.796790582 +0000
++++ runas.c
+@@ -18,6 +18,11 @@
+ #include <unistd.h>
+ #include <limits.h>
+ 
++#ifdef __linux__
++#define ARG_MAX       2097152 // getconf ARG_MAX CentOS 7
++#endif
++
++// Remove usage() from libbacon?
+ void    usage(char *argv[])
+ 
+ {
+@@ -25,6 +30,26 @@ void    usage(char *argv[])
+     exit(EX_USAGE);
+ }
+ 
++#ifdef __linux__
++size_t  strlcat(char *dest,const char *src,size_t maxlen)
++
++{
++    char    *dp,*sp;
++    
++    /* Find end of first string */
++    for (dp=dest; (*dp != '\0') && --maxlen; ++dp)
++      ;
++    
++    /* Concetanate second string */
++    for (sp=(char *)src; (*sp != '\0') && --maxlen; )
++      *dp++ = *sp++;
++    
++    /* Null terminate */
++    *dp = '\0';
++    return dp-dest;
++}
++#endif
++
+ int     main(int argc,char *argv[])
+ 
+ {



Home | Main Index | Thread Index | Old Index