diff options
author | Darren Tucker <dtucker@zip.com.au> | 2008-07-17 19:03:49 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2008-07-17 19:03:49 +1000 |
commit | 9a3f2b4cc3f9eb03613e5fe022b7afa9d2fe950a (patch) | |
tree | 0ee54e4768fe48c03a4b77e2bcfadd3345de5aee | |
parent | a1d03a50692a2edbe5a6e1e652c5a12e1de07721 (diff) |
- (dtucker) [openbsd-compat/bsd-cygwin_util.c] Remove long-unneeded compat
code, replace with equivalent cygwin library call. Patch from vinschen
at redhat.comi, ok djm@.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 40 |
2 files changed, 5 insertions, 40 deletions
@@ -7,6 +7,9 @@ | |||
7 | [auth2-hostbased.c] | 7 | [auth2-hostbased.c] |
8 | strip trailing '.' from hostname when HostbasedUsesNameFromPacketOnly=yes | 8 | strip trailing '.' from hostname when HostbasedUsesNameFromPacketOnly=yes |
9 | report and patch from res AT qoxp.net (bz#1200); ok markus@ | 9 | report and patch from res AT qoxp.net (bz#1200); ok markus@ |
10 | - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Remove long-unneeded compat | ||
11 | code, replace with equivalent cygwin library call. Patch from vinschen | ||
12 | at redhat.comi, ok djm@. | ||
10 | 13 | ||
11 | 20080716 | 14 | 20080716 |
12 | - OpenBSD CVS Sync | 15 | - OpenBSD CVS Sync |
@@ -4694,4 +4697,4 @@ | |||
4694 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4697 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4695 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4698 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4696 | 4699 | ||
4697 | $Id: ChangeLog,v 1.5089 2008/07/17 08:57:19 djm Exp $ | 4700 | $Id: ChangeLog,v 1.5090 2008/07/17 09:03:49 dtucker Exp $ |
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index dbf8176b6..38be7e350 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c | |||
@@ -175,45 +175,7 @@ check_nt_auth(int pwd_authenticated, struct passwd *pw) | |||
175 | int | 175 | int |
176 | check_ntsec(const char *filename) | 176 | check_ntsec(const char *filename) |
177 | { | 177 | { |
178 | char *cygwin; | 178 | return (pathconf(filename, _PC_POSIX_PERMISSIONS)); |
179 | int allow_ntea = 0, allow_ntsec = 0; | ||
180 | struct statfs fsstat; | ||
181 | |||
182 | /* Windows 95/98/ME don't support file system security at all. */ | ||
183 | if (!is_winnt) | ||
184 | return (0); | ||
185 | |||
186 | /* Evaluate current CYGWIN settings. */ | ||
187 | cygwin = getenv("CYGWIN"); | ||
188 | allow_ntea = ntea_on(cygwin); | ||
189 | allow_ntsec = ntsec_on(cygwin) || | ||
190 | (has_capability(HAS_NTSEC_BY_DEFAULT) && !ntsec_off(cygwin)); | ||
191 | |||
192 | /* | ||
193 | * `ntea' is an emulation of POSIX attributes. It doesn't support | ||
194 | * real file level security as ntsec on NTFS file systems does | ||
195 | * but it supports FAT filesystems. `ntea' is minimum requirement | ||
196 | * for security checks. | ||
197 | */ | ||
198 | if (allow_ntea) | ||
199 | return (1); | ||
200 | |||
201 | /* | ||
202 | * Retrieve file system flags. In Cygwin, file system flags are | ||
203 | * copied to f_type which has no meaning in Win32 itself. | ||
204 | */ | ||
205 | if (statfs(filename, &fsstat)) | ||
206 | return (1); | ||
207 | |||
208 | /* | ||
209 | * Only file systems supporting ACLs are able to set permissions. | ||
210 | * `ntsec' is the setting in Cygwin which switches using of NTFS | ||
211 | * ACLs to support POSIX permissions on files. | ||
212 | */ | ||
213 | if (fsstat.f_type & FS_PERSISTENT_ACLS) | ||
214 | return (allow_ntsec); | ||
215 | |||
216 | return (0); | ||
217 | } | 179 | } |
218 | 180 | ||
219 | void | 181 | void |