403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/x11/wdm/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/x11/wdm/files/patch-src__wdm__session.c
--- src/wdm/session.c.orig	Sat Mar 26 22:57:04 2005
+++ src/wdm/session.c	Sun Mar 27 09:22:42 2005
@@ -533,6 +533,7 @@
     int	pid;
 #ifdef HAS_SETUSERCONTEXT
     struct passwd* pwd;
+    extern char **environ;
 #endif
 #ifdef USE_PAM 
     pam_handle_t *pamh = thepamh();
@@ -562,6 +563,7 @@
 	/* Do system-dependent login setup here */
 
 #ifndef AIXV3
+#ifndef HAS_SETUSERCONTEXT
 	if (setgid(verify->gid) < 0)
 	{
 	    WDMError("setgid %d (user \"%s\") failed, errno=%d\n",
@@ -609,6 +611,31 @@
 		     verify->uid, name, errno);
 	    return (0);
 	}
+#else /* HAS_SETUSERCONTEXT */
+	/*
+	 * Set the user's credentials: uid, gid, groups,
+	 * environment variables, resource limits, and umask.
+	 */
+        /* destroy user environment before calling setusercontext */
+	environ = verify->userEnviron;
+	pwd = getpwnam(name);
+	if (pwd)
+	{
+	    if (setusercontext(NULL, pwd, pwd->pw_uid, LOGIN_SETALL) < 0)
+	    {
+		WDMError("setusercontext for \"%s\" failed, errno=%d\n", name,
+		    errno);
+		return (0);
+	    }
+            verify->userEnviron = environ;    
+	    endpwent();
+	}
+	else
+	{
+	    WDMError("getpwnam for \"%s\" failed, errno=%d\n", name, errno);
+	    return (0);
+	}
+#endif /* HAS_SETUSERCONTEXT */
 #else /* AIXV3 */
 	/*
 	 * Set the user's credentials: uid, gid, groups,

Youez - 2016 - github.com/yon3zu
LinuXploit