Skip to content

Commit

Permalink
Merge remote-tracking branch 'qubesos/pr/3'
Browse files Browse the repository at this point in the history
* qubesos/pr/3:
  Move /var/run/shm.id to /var/run/qubes/shm.id
  • Loading branch information
marmarek committed Nov 11, 2016
2 parents 8f097ec + 3c86bef commit b92c93e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions gui-daemon/xside.c
Original file line number Diff line number Diff line change
Expand Up @@ -3178,19 +3178,21 @@ int main(int argc, char **argv)

// inside the daemonized process...
if (!ghandles.invisible) {
f = fopen("/var/run/shm.id", "r");
f = fopen(GUID_SHMID_FILE, "r");
if (!f) {
fprintf(stderr,
"Missing /var/run/shm.id; run X with preloaded shmoverride\n");
"Missing %s; run X with preloaded shmoverride\n",
GUID_SHMID_FILE);
exit(1);
}
fscanf(f, "%d", &ghandles.cmd_shmid);
fclose(f);
ghandles.shmcmd = shmat(ghandles.cmd_shmid, NULL, 0);
if (ghandles.shmcmd == (void *) (-1UL)) {
fprintf(stderr,
"Invalid or stale shm id 0x%x in /var/run/shm.id\n",
ghandles.cmd_shmid);
"Invalid or stale shm id 0x%x in %s\n",
ghandles.cmd_shmid,
GUID_SHMID_FILE);
exit(1);
}
}
Expand Down
1 change: 1 addition & 0 deletions gui-daemon/xside.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define QREXEC_POLICY_PATH "/usr/lib/qubes/qrexec-policy"
#define GUID_CONFIG_FILE "/etc/qubes/guid.conf"
#define GUID_CONFIG_DIR "/etc/qubes"
#define GUID_SHMID_FILE "/var/run/qubes/shm.id"
/* this makes any X11 error fatal (i.e. cause exit(1)). This behavior was the
* case for a long time before introducing this option, so nothing really have
* changed */
Expand Down
2 changes: 1 addition & 1 deletion shmoverride/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ instead of attaching regular shared memory, memory from a foreign domain is
attached via xc_map_foreign_pages. This mechanism is used to map composition
buffers from a foreign domain into Xorg server.
During its init, shmoverride.so creates a shared memory segment
(cmd_pages) and writes its shmid to /var/run/shm.id. All instances of
(cmd_pages) and writes its shmid to /var/run/qubes/shm.id. All instances of
qubes_guid map this segment and communicate with shmoverride.so code by
setting its fields. When qubes_guid wants its
XShmAttach(...synth_shmid...) call to be handled by shmoverride.so, it sets the
Expand Down
2 changes: 1 addition & 1 deletion shmoverride/shmoverride.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf)
return 0;
}

#define SHMID_FILENAME "/var/run/shm.id"
#define SHMID_FILENAME "/var/run/qubes/shm.id"
int __attribute__ ((constructor)) initfunc()
{
int idfd, len;
Expand Down

0 comments on commit b92c93e

Please sign in to comment.