comparison loginrec.c @ 782:e0084f136cb8

If running as non-root only allow that user to log in
author Matt Johnston <matt@ucc.asn.au>
date Wed, 17 Apr 2013 22:29:18 +0800
parents ada77f43c79a
children 1ed6f39e8aa4
comparison
equal deleted inserted replaced
781:f110d321fe7a 782:e0084f136cb8
327 int 327 int
328 login_write (struct logininfo *li) 328 login_write (struct logininfo *li)
329 { 329 {
330 #ifndef HAVE_CYGWIN 330 #ifndef HAVE_CYGWIN
331 if ((int)geteuid() != 0) { 331 if ((int)geteuid() != 0) {
332 dropbear_log(LOG_WARNING,
333 "Attempt to write login records by non-root user (aborting)");
334 return 1; 332 return 1;
335 } 333 }
336 #endif 334 #endif
337 335
338 /* set the timestamp */ 336 /* set the timestamp */