bsd-cygwin_util.c (181110) | bsd-cygwin_util.c (181111) |
---|---|
1/* 2 * Copyright (c) 2000, 2001, Corinna Vinschen <vinschen@cygnus.com> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 161 unchanged lines hidden (view full) --- 170 return (0); 171 } 172 return (1); 173} 174 175int 176check_ntsec(const char *filename) 177{ | 1/* 2 * Copyright (c) 2000, 2001, Corinna Vinschen <vinschen@cygnus.com> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 161 unchanged lines hidden (view full) --- 170 return (0); 171 } 172 return (1); 173} 174 175int 176check_ntsec(const char *filename) 177{ |
178 char *cygwin; 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); | 178 return (pathconf(filename, _PC_POSIX_PERMISSIONS)); |
217} 218 219void 220register_9x_service(void) 221{ 222 HINSTANCE kerneldll; 223 DWORD (*RegisterServiceProcess)(DWORD, DWORD); 224 --- 69 unchanged lines hidden --- | 179} 180 181void 182register_9x_service(void) 183{ 184 HINSTANCE kerneldll; 185 DWORD (*RegisterServiceProcess)(DWORD, DWORD); 186 --- 69 unchanged lines hidden --- |