Add /etc/passwd support
Fix slock to work with /etc/passwd without /etc/shadow. while we're at it, remove an occurence of trailing whitespace.
This commit is contained in:
		
							parent
							
								
									6a55128354
								
							
						
					
					
						commit
						9db14b10dd
					
				
							
								
								
									
										2
									
								
								slock.c
								
								
								
								
							
							
						
						
									
										2
									
								
								slock.c
								
								
								
								
							| 
						 | 
					@ -75,7 +75,7 @@ getpw(void) { /* only run as root */
 | 
				
			||||||
	rval =  pw->pw_passwd;
 | 
						rval =  pw->pw_passwd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if HAVE_SHADOW_H
 | 
					#if HAVE_SHADOW_H
 | 
				
			||||||
	if (strlen(rval) >= 1) { /* kludge, assumes pw placeholder entry has len >= 1 */
 | 
						if (rval[0] == 'x' && rval[1] == '\0') {
 | 
				
			||||||
		struct spwd *sp;
 | 
							struct spwd *sp;
 | 
				
			||||||
		sp = getspnam(getenv("USER"));
 | 
							sp = getspnam(getenv("USER"));
 | 
				
			||||||
		if(!sp)
 | 
							if(!sp)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue