~ubuntu-branches/ubuntu/saucy/pinentry/saucy

« back to all changes in this revision

Viewing changes to secmem/secmem.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2007-07-25 00:42:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070725004252-2l7i48jc31pjsjli
Tags: 0.7.3-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
* Remove pinentry-gtk binary package and gtk1 build-dep
  - Touches debian/control, Makefile, pinentry.prerm.in, rules, 
    pinentry.1.in, pinentry.postinst.in, and pinentry.README.Debian.in
  - Add pinentry-gtk2 provides/replaces pinentry-gtk in debian/control
* Add second leading space to start of home page line in package descriptions
* Change pinentry-doc to Section: doc
* Change maintainer to Ubuntu Core Developers

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
        else {
220
220
            pool = mmap( 0, poolsize, PROT_READ|PROT_WRITE,
221
221
                                      MAP_PRIVATE, fd, 0);
 
222
            close (fd);
222
223
        }
223
224
    }
224
225
# endif
280
281
secmem_init( size_t n )
281
282
{
282
283
    if( !n ) {
283
 
      #ifdef USE_CAPABILITIES
 
284
#ifdef USE_CAPABILITIES
284
285
        /* drop all capabilities */
285
286
        cap_set_proc( cap_from_text("all-eip") );
286
287
 
287
 
      #elif !defined(HAVE_DOSISH_SYSTEM)
 
288
#elif !defined(HAVE_DOSISH_SYSTEM)
288
289
        uid_t uid;
289
290
 
290
291
        disable_secmem=1;
293
294
            if( setuid( uid ) || getuid() != geteuid() )
294
295
                log_fatal("failed to drop setuid\n" );
295
296
        }
296
 
      #endif
 
297
#endif
297
298
    }
298
299
    else {
299
300
        if( n < DEFAULT_POOLSIZE )