Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [66.206.205.2] X-Originating-Email: [vxj45 AT hotmail DOT com] From: "Vishal Jain" To: cygwin AT cygwin DOT com Subject: seteuid and file ownership Date: Thu, 20 Mar 2003 13:07:18 -0800 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 20 Mar 2003 21:07:18.0979 (UTC) FILETIME=[B1272930:01C2EF24] Hi, I am making a seteuid() call to impersonate user "shweta". Then I create a file. When I do ls -l on the file, it shows the owner as "vishalj" which was the user before doing impersonation. -rw-rw-rw- 1 vishalj mkgroup 0 Mar 20 12:50 shweta Is this expected behaviour in cygwin? I am attaching the code snippet- #include #include #include #include int main(int argc, char *argv[]){ HANDLE token = INVALID_HANDLE_VALUE; struct passwd *pw = NULL; FILE *fp = NULL; pw = getpwnam("shweta"); token = cygwin_logon_user(pw, "shweta"); if(token == INVALID_HANDLE_VALUE){ printf("Login failed\n"); } cygwin_set_impersonation_token(token); seteuid(pw->pw_uid); fp = fopen("shweta", "w"); if(fp == NULL){ printf("could not open file for writing\n"); } fclose(fp); } Thanks, Vishal _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/