summaryrefslogtreecommitdiff
path: root/desktop/slock/slock-use_shadow_group.patch
diff options
context:
space:
mode:
authorGrigorios Bouzakis <grbzks@gmail.com>2010-05-12 23:28:21 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-12 23:28:21 +0200
commit2b010ce19c23d3a16140c6e15ffc61ec781afcf2 (patch)
treebab9a903c40124325dee6bc25d13f5dc3189a601 /desktop/slock/slock-use_shadow_group.patch
parent1d0648b6256561d2c47d65644768de0dcb288100 (diff)
downloadslackbuilds-2b010ce19c23d3a16140c6e15ffc61ec781afcf2.tar.gz
desktop/slock: Added to 12.2 repository
Diffstat (limited to 'desktop/slock/slock-use_shadow_group.patch')
-rw-r--r--desktop/slock/slock-use_shadow_group.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/desktop/slock/slock-use_shadow_group.patch b/desktop/slock/slock-use_shadow_group.patch
new file mode 100644
index 0000000000..62bc1b8c03
--- /dev/null
+++ b/desktop/slock/slock-use_shadow_group.patch
@@ -0,0 +1,23 @@
+Patch by Robby Workman <rworkman@slackbuilds.org>
+This is trivial, and not really ideal, because it hardcodes our
+shadow group's guid (43), but oh well, it works for us. :-)
+
+diff -Nur a/slock.c b/slock.c
+--- a/slock.c 2008-07-29 13:22:46.000000000 -0500
++++ b/slock.c 2009-01-01 02:51:53.815701828 -0600
+@@ -34,12 +34,12 @@
+
+ #ifndef HAVE_BSD_AUTH
+ static const char *
+-get_password() { /* only run as root */
++get_password() { /* only run as shadow group - no need for suid root */
+ const char *rval;
+ struct passwd *pw;
+
+- if(geteuid() != 0)
+- die("slock: cannot retrieve password entry (make sure to suid slock)\n");
++ if(getegid() != 43)
++ die("slock: cannot retrieve password entry (make sure slock is sgid shadow)\n");
+ pw = getpwuid(getuid());
+ endpwent();
+ rval = pw->pw_passwd;