~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to openbsd-compat/bsd-cygwin_util.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
int
176
176
check_ntsec(const char *filename)
177
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
179
}
218
180
 
219
181
void