diff options
author | Michael Nottebrock <lofi@FreeBSD.org> | 2003-08-28 19:39:01 +0000 |
---|---|---|
committer | Michael Nottebrock <lofi@FreeBSD.org> | 2003-08-28 19:39:01 +0000 |
commit | 9683be5fc3a68dfd728c35da20a85d9de14a3323 (patch) | |
tree | c93721ec3b11bdd86c2a3dcac2a0b87fd7be1b41 /x11/kdebase4-workspace/files/patch-konsole-konsole-konsole_grantpty.c | |
parent | - Update to version 1.4.5 (diff) |
Multiple bugfixes and enhancements for kdebase.
- Add patches for konsole which enable konsole_grantpty to
properly change permissions on ttys and fix a bug which causes
konsole to crash on recent builds of -CURRENT.
- Add a patch for configure that fixes fontconfig detection.
- Add a patch submitted by Kaarthik Sivakumar <kaarthik@comcast.net>
which fixes the bug described in PR ports/48334.
- Add a pkg-message that notifies users about the fonts this port
installs.
- Use the USE_OPENLDAP macro.
PR: ports/48334
Approved by: arved (Mentor)
Diffstat (limited to 'x11/kdebase4-workspace/files/patch-konsole-konsole-konsole_grantpty.c')
-rw-r--r-- | x11/kdebase4-workspace/files/patch-konsole-konsole-konsole_grantpty.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/x11/kdebase4-workspace/files/patch-konsole-konsole-konsole_grantpty.c b/x11/kdebase4-workspace/files/patch-konsole-konsole-konsole_grantpty.c new file mode 100644 index 000000000000..5093a52d277b --- /dev/null +++ b/x11/kdebase4-workspace/files/patch-konsole-konsole-konsole_grantpty.c @@ -0,0 +1,62 @@ +--- konsole/konsole/konsole_grantpty.c 2 Sep 2002 01:09:24 -0000 1.7 ++++ konsole/konsole/konsole_grantpty.c 24 Aug 2003 21:44:01 -0000 +@@ -40,7 +40,9 @@ + # include <dirent.h> + #endif + +-#define PTY_FILENO 3 /* keep in sync with grantpty */ ++#define DEFAULT_PTY_FILENO 3 /* keep in sync with TEPty.cpp */ ++int PTY_FILENO = DEFAULT_PTY_FILENO; ++ + #define TTY_GROUP "tty" + + int main (int argc, char *argv[]) +@@ -52,11 +54,13 @@ int main (int argc, char *argv[]) + uid_t uid; + mode_t mod; + char* tty; ++ int command_fd; /* which fd to use? */ + + /* check preconditions **************************************************/ +- if (argc != 2 || (strcmp(argv[1],"--grant") && strcmp(argv[1],"--revoke"))) ++ if (( (argc != 3) && (argc != 2) /* optional third arg */ ) || ++ (strcmp(argv[1],"--grant") && strcmp(argv[1],"--revoke"))) + { +- printf("usage: %s (--grant|--revoke)\n",argv[0]); ++ printf("usage: %s (--grant|--revoke) [fd]\n",argv[0]); + printf("%s is a helper for\n",argv[0]); + printf("konsole and not intented to\n"); + printf("be called from the command\n"); +@@ -83,6 +87,22 @@ int main (int argc, char *argv[]) + uid = 0; /* root */ + mod = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; + } ++ ++ command_fd = DEFAULT_PTY_FILENO; ++ if (argv[2]) ++ { ++ command_fd = atoi(argv[2]); ++ } ++ if (command_fd > 2) /* must be out of stdin,stdout,stderr range */ ++ { ++ PTY_FILENO=command_fd; ++ } ++ else ++ { ++ fprintf(stderr,"%s: Bad command fd (seems to be %d)\n",argv[0],command_fd); ++ return 1; ++ } ++ + /* Get the group ID of the special `tty' group. */ + p = getgrnam(TTY_GROUP); /* posix */ + gid = p ? p->gr_gid : getgid (); /* posix */ +@@ -117,6 +137,9 @@ int main (int argc, char *argv[]) + if (dirp->d_fileno != dsb.st_ino) + continue; + { ++ /* Else this is the right device file .. any possible memory ++ ** leak here because two files match is unimportant? ++ */ + int pdlen = strlen(_PATH_DEV), namelen = strlen(dirp->d_name); + pty = malloc(pdlen + namelen + 1); + if (pty) {
\ No newline at end of file |