summaryrefslogtreecommitdiff
path: root/recipes/pdm/pdm-1.0/setuid.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/pdm/pdm-1.0/setuid.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/pdm/pdm-1.0/setuid.patch')
-rw-r--r--recipes/pdm/pdm-1.0/setuid.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes/pdm/pdm-1.0/setuid.patch b/recipes/pdm/pdm-1.0/setuid.patch
new file mode 100644
index 0000000000..17dbc00279
--- /dev/null
+++ b/recipes/pdm/pdm-1.0/setuid.patch
@@ -0,0 +1,42 @@
+--- pdm-1.0/main.c 2003-12-09 11:43:22.000000000 -0700
++++ pdm-1.0.new/main.c 2004-05-25 09:01:53.897999256 -0700
+@@ -80,10 +80,10 @@
+
+ /* spawn_session()
+ Spawns a new session based on the given name under the authority
+- of the given UID.
++ of the given UID/GID.
+ */
+
+-static pid_t spawn_session(char *app, uid_t uid) {
++static pid_t spawn_session(char *app, uid_t uid, gid_t gid) {
+
+ char *argv[2] = { 0, 0 };
+ pid_t pid = 0;
+@@ -103,10 +103,13 @@
+ /* If a different UID was specified, then try to change to that UID */
+
+ if (uid != getuid()) {
+- if (seteuid(uid) == -1) {
++ if (setresuid(uid, uid, uid) == -1) {
+ fprintf(stderr, "Error: Unable to set the UID of the process.\n");
+ exit(-1);
+ }
++ if (setresgid(gid,gid,gid) == -1) {
++ fprintf(stderr, "Error: Unable to set the GID of the process.\n");
++ }
+ }
+
+ argv[0] = app;
+@@ -319,7 +322,10 @@
+
+ /* Start the session */
+ VERBOSE("Spawning session '%s'\n", session);
+- session_pid = spawn_session(session, curuser ? curuser->pw_uid : getuid());
++
++ session_pid = spawn_session(session,
++ curuser ? curuser->pw_uid : getuid(),
++ curuser ? curuser->pw_gid : getgid());
+
+ if (session_pid == -1) {
+ fprintf(stderr, "Fatal: Unable to spawn the session '%s'.\n", session);