[dovecot-cvs] dovecot/src/lib safe-mkdir.c,1.4,1.5
cras at procontrol.fi
cras at procontrol.fi
Wed Aug 27 02:15:39 EEST 2003
- Previous message: [dovecot-cvs]
dovecot/src/lib alarm-hup.c,1.5,1.6 buffer.c,1.10,1.11
compat.c,1.11,1.12 data-stack.c,1.18,1.19 env-util.c,1.8,1.9
failures.c,1.21,1.22 fd-close-on-exec.c,1.6,1.7 file-lock.c,1.6,1.7
file-set-size.c,1.3,1.4 hash.c,1.17,1.18 hex-binary.c,1.5,1.6
hostpid.c,1.4,1.5 imem.c,1.8,1.9 ioloop-poll.c,1.20,1.21
ioloop-select.c,1.15,1.16 ioloop.c,1.19,1.20 iostream.c,1.4,1.5
istream-data.c,1.5,1.6 istream-file.c,1.8,1.9
istream-mmap.c,1.5,1.6 istream.c,1.9,1.10 lib-signals.c,1.3,1.4
lib.c,1.9,1.10 mempool-alloconly.c,1.23,1.24
mempool-datastack.c,1.8,1.9 mempool-system.c,1.12,1.13
mmap-anon.c,1.13,1.14 mmap-util.c,1.9,1.10 network.c,1.19,1.20
ostream-file.c,1.20,1.21 ostream.c,1.7,1.8 process-title.c,1.5,1.6
randgen.c,1.11,1.12 restrict-access.c,1.11,1.12
restrict-process-size.c,1.5,1.6 safe-memset.c,1.1,1.2
safe-mkdir.c,1.3,1.4 sendfile-util.c,1.7,1.8 str.c,1.9,1.10
strescape.c,1.6,1.7 strfuncs.c,1.30,1.31
unlink-directory.c,1.9,1.10 unlink-lockfiles.c,1.6,1.7
utc-mktime.c,1.3,1.4 utc-offset.c,1.2,1.3 write-full.c,1.4,1.5
- Next message: [dovecot-cvs] dovecot/src/lib-settings settings.c,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv4405/lib
Modified Files:
safe-mkdir.c
Log Message:
comment updates. it's not possible to change the file mode if you're not the
owner..
Index: safe-mkdir.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/safe-mkdir.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- safe-mkdir.c 26 Aug 2003 21:18:16 -0000 1.4
+++ safe-mkdir.c 26 Aug 2003 22:15:36 -0000 1.5
@@ -35,6 +35,8 @@
if (!S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))
i_fatal("Not a directory %s", dir);
+ /* change the file owner first, since it's the only user one who
+ can mess up with the file mode. */
if (st.st_uid != uid || st.st_gid != gid) {
if (fchown(fd, uid, gid) < 0)
i_fatal("fchown() failed for %s: %m", dir);
@@ -50,9 +52,7 @@
if (close(fd) < 0)
i_fatal("close() failed for %s: %m", dir);
- /* make sure we succeeded in everything. chown() and chmod()
- are racy: user owned 0777 file - change either and the user
- can still change it back. */
+ /* paranoia: make sure we succeeded in everything. */
if (lstat(dir, &st) < 0)
i_fatal("lstat() check failed for %s: %m", dir);
- Previous message: [dovecot-cvs]
dovecot/src/lib alarm-hup.c,1.5,1.6 buffer.c,1.10,1.11
compat.c,1.11,1.12 data-stack.c,1.18,1.19 env-util.c,1.8,1.9
failures.c,1.21,1.22 fd-close-on-exec.c,1.6,1.7 file-lock.c,1.6,1.7
file-set-size.c,1.3,1.4 hash.c,1.17,1.18 hex-binary.c,1.5,1.6
hostpid.c,1.4,1.5 imem.c,1.8,1.9 ioloop-poll.c,1.20,1.21
ioloop-select.c,1.15,1.16 ioloop.c,1.19,1.20 iostream.c,1.4,1.5
istream-data.c,1.5,1.6 istream-file.c,1.8,1.9
istream-mmap.c,1.5,1.6 istream.c,1.9,1.10 lib-signals.c,1.3,1.4
lib.c,1.9,1.10 mempool-alloconly.c,1.23,1.24
mempool-datastack.c,1.8,1.9 mempool-system.c,1.12,1.13
mmap-anon.c,1.13,1.14 mmap-util.c,1.9,1.10 network.c,1.19,1.20
ostream-file.c,1.20,1.21 ostream.c,1.7,1.8 process-title.c,1.5,1.6
randgen.c,1.11,1.12 restrict-access.c,1.11,1.12
restrict-process-size.c,1.5,1.6 safe-memset.c,1.1,1.2
safe-mkdir.c,1.3,1.4 sendfile-util.c,1.7,1.8 str.c,1.9,1.10
strescape.c,1.6,1.7 strfuncs.c,1.30,1.31
unlink-directory.c,1.9,1.10 unlink-lockfiles.c,1.6,1.7
utc-mktime.c,1.3,1.4 utc-offset.c,1.2,1.3 write-full.c,1.4,1.5
- Next message: [dovecot-cvs] dovecot/src/lib-settings settings.c,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list