diff options
author | pav <pav@FreeBSD.org> | 2006-05-29 04:40:49 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2006-05-29 04:40:49 +0800 |
commit | 354296016df17bb0b9d42a25308bd2caa8a2ab68 (patch) | |
tree | 84e5eea33205bbcd8f32c6a14369d42c1c46c64c | |
parent | a65c11301aafe4c27b82df69637b36e73c2828c2 (diff) | |
download | freebsd-ports-gnome-354296016df17bb0b9d42a25308bd2caa8a2ab68.tar.gz freebsd-ports-gnome-354296016df17bb0b9d42a25308bd2caa8a2ab68.tar.zst freebsd-ports-gnome-354296016df17bb0b9d42a25308bd2caa8a2ab68.zip |
- Bail out gracefully when executed as non-root
PR: ports/98032
Submitted by: marko
-rw-r--r-- | ports-mgmt/portmanager/Makefile | 2 | ||||
-rw-r--r-- | ports-mgmt/portmanager/files/patch-portmanager.c | 17 | ||||
-rw-r--r-- | sysutils/portmanager/Makefile | 2 | ||||
-rw-r--r-- | sysutils/portmanager/files/patch-portmanager.c | 17 |
4 files changed, 36 insertions, 2 deletions
diff --git a/ports-mgmt/portmanager/Makefile b/ports-mgmt/portmanager/Makefile index c46e55219d20..5229ac7aba89 100644 --- a/ports-mgmt/portmanager/Makefile +++ b/ports-mgmt/portmanager/Makefile @@ -7,7 +7,7 @@ PORTNAME= portmanager PORTVERSION= 0.4.1 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= portmanager diff --git a/ports-mgmt/portmanager/files/patch-portmanager.c b/ports-mgmt/portmanager/files/patch-portmanager.c new file mode 100644 index 000000000000..a3a859cf802a --- /dev/null +++ b/ports-mgmt/portmanager/files/patch-portmanager.c @@ -0,0 +1,17 @@ +--- portmanager/portmanager.c.orig Tue Dec 13 00:20:58 2005 ++++ portmanager/portmanager.c Sat May 27 18:08:32 2006 +@@ -34,7 +34,13 @@ + int main( int argc, char** argv, char** argp) + { + int errorCode = 0; +- ++ ++ if ( getuid() != 0 ) ++ { ++ fprintf( stderr, "%s must be run as root\n", argv[0] ); ++ exit( 1 ); ++ } ++ + errorCode = MGPMrCommandLine( argc, (char**)argv, (char**)argp ); + exit( errorCode ); + } diff --git a/sysutils/portmanager/Makefile b/sysutils/portmanager/Makefile index c46e55219d20..5229ac7aba89 100644 --- a/sysutils/portmanager/Makefile +++ b/sysutils/portmanager/Makefile @@ -7,7 +7,7 @@ PORTNAME= portmanager PORTVERSION= 0.4.1 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= portmanager diff --git a/sysutils/portmanager/files/patch-portmanager.c b/sysutils/portmanager/files/patch-portmanager.c new file mode 100644 index 000000000000..a3a859cf802a --- /dev/null +++ b/sysutils/portmanager/files/patch-portmanager.c @@ -0,0 +1,17 @@ +--- portmanager/portmanager.c.orig Tue Dec 13 00:20:58 2005 ++++ portmanager/portmanager.c Sat May 27 18:08:32 2006 +@@ -34,7 +34,13 @@ + int main( int argc, char** argv, char** argp) + { + int errorCode = 0; +- ++ ++ if ( getuid() != 0 ) ++ { ++ fprintf( stderr, "%s must be run as root\n", argv[0] ); ++ exit( 1 ); ++ } ++ + errorCode = MGPMrCommandLine( argc, (char**)argv, (char**)argp ); + exit( errorCode ); + } |