chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9b4f818
)
machine-id: generate /etc/machine-id 0444 by default
author
Lennart Poettering
<lennart@poettering.net>
Fri, 4 Mar 2011 21:50:56 +0000
(22:50 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 4 Mar 2011 21:50:56 +0000
(22:50 +0100)
src/machine-id-setup.c
patch
|
blob
|
history
diff --git
a/src/machine-id-setup.c
b/src/machine-id-setup.c
index 0ec61924492e3060321f4e745243264f29de0c8c..65792e9b842357b2f0b87e1f08403a64a094ddb4 100644
(file)
--- a/
src/machine-id-setup.c
+++ b/
src/machine-id-setup.c
@@
-91,7
+91,12
@@
int machine_id_setup(void) {
m = umask(0000);
m = umask(0000);
- if ((fd = open("/etc/machine-id", O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0644)) >= 0)
+ /* We create this 0444, to indicate that this isn't really
+ * something you should ever modify. Of course, since the file
+ * will be owned by root it doesn't matter much, but maybe
+ * people look. */
+
+ if ((fd = open("/etc/machine-id", O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444)) >= 0)
writable = true;
else {
if ((fd = open("/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY)) < 0) {
writable = true;
else {
if ((fd = open("/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY)) < 0) {