Mercurial > hg
comparison mcabber/src/utils.c @ 1459:d76eff4ed71d
Use stat() to check permissions in checkset_perm() (Dave Holland)
Patch from Dave Holland in the Debian BTS (#475182).
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 11 Apr 2008 21:55:11 +0200 |
parents | 17e95be6c39b |
children | af54d33facd0 |
comparison
equal
deleted
inserted
replaced
1458:17e95be6c39b | 1459:d76eff4ed71d |
---|---|
137 #ifdef __CYGWIN__ | 137 #ifdef __CYGWIN__ |
138 // Permission checking isn't efficent on Cygwin | 138 // Permission checking isn't efficent on Cygwin |
139 return 0; | 139 return 0; |
140 #endif | 140 #endif |
141 | 141 |
142 fd = lstat(name, &buf); | 142 fd = stat(name, &buf); |
143 if (fd == -1) return -1; | 143 if (fd == -1) return -1; |
144 | 144 |
145 if (buf.st_uid != geteuid()) { | 145 if (buf.st_uid != geteuid()) { |
146 scr_LogPrint(LPRINT_LOGNORM, "Wrong file owner [%s]", name); | 146 scr_LogPrint(LPRINT_LOGNORM, "Wrong file owner [%s]", name); |
147 return 1; | 147 return 1; |