Search:

Type: Posts; User: tnethaji

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    5,770

    Hi Laserlight, Thank you for sharing your...

    Hi Laserlight, Thank you for sharing your knowledge, much appreciated. Indeed this is a sample rough code to fit a bigger puzzle that will be further optimised. Passing of string is not the same...
  2. Replies
    7
    Views
    5,770

    working code

    My final working code below
    #include <stdio.h>
    #include <string.h>
    #include <strings.h>
    #include <stdlib.h>
    #include <malloc.h>

    char **teststr2 = NULL;
    char **testfn3(char **);
  3. Replies
    7
    Views
    5,770

    Thank you Malcolm. I did reasoned myself about...

    Thank you Malcolm. I did reasoned myself about assigning values to memory allocated variables, however, the memory allocation based on deferencing variable is something that I have not thought about...
  4. Replies
    7
    Views
    5,770

    Thank you John. The problem was at the memory...

    Thank you John.
    The problem was at the memory allocation and value assignment. I used the deferencing pointer in calloc as you showed in your example and value assignment worked just fine with...
  5. Replies
    7
    Views
    5,770

    C double pointer dumping core

    #include <stdio.h>
    #include <string.h>
    #include <strings.h>
    #include <stdlib.h>
    #include <malloc.h>

    char **teststr2 = NULL;
    char **testfn3(char **);

    int main()
  6. Replies
    4
    Views
    5,369

    Thanks John. It works now. Best regards...

    Thanks John. It works now.

    Best regards
    Nethaji
  7. Replies
    4
    Views
    5,369

    Hi John, I had no luck. Please see the code...

    Hi John,
    I had no luck. Please see the code below:

    This program when compiled will have the user and group assigned to the progusr whilst the x permission is set to others. Also, the executable...
  8. Replies
    4
    Views
    5,369

    setuid to switch user

    Hi,
    I have a program that sets the UID and GID of the user, however, after setting it is not running the expected program as the user it is supposed to be.

    For example,
    Program to be run only as...
  9. Replies
    8
    Views
    8,172

    Hi all, Thanks to laserlight. The code I...

    Hi all,

    Thanks to laserlight.

    The code I pasted in my earlier messages work. I have given complete test code below.

    I have two users - user1 and user2 and the condition for the program to...
  10. Replies
    8
    Views
    8,172

    Hi John, Thanks for the info and the link. I...

    Hi John,
    Thanks for the info and the link. I have already looked into what laserlight said and couldn't make it work.

    Nethaji
  11. Replies
    8
    Views
    8,172

    Hi christop, Apologies. I have a few global...

    Hi christop,
    Apologies. I have a few global variables and did not put the header files in the source. The following lines of codes go above the code I pasted in my earlier message.



    #include...
  12. Replies
    8
    Views
    8,172

    Hi, I tried without much success using setuid....

    Hi,
    I tried without much success using setuid.
    1. GTK+ applications does require a helper program to run setuid processes
    2. I created a helper program, but setuid doesn't work as I still have not...
  13. Replies
    8
    Views
    8,172

    Hi Laserlight, Thank you for the hint. I will...

    Hi Laserlight,
    Thank you for the hint. I will try and update my reply.
  14. Replies
    8
    Views
    8,172

    Execute program as another user

    Hello,
    I have written a C program in GTK+ with GUI support
    1. The administrator (root) can add specific programs to my program. At the time of installation of my program, it creates a user account...
  15. Replies
    6
    Views
    4,585

    Thank you very much for the explanation Salem....

    Thank you very much for the explanation Salem.
    Best regards
    Nethaji
  16. Replies
    6
    Views
    4,585

    Dear GReaper and Salem, Just an update. The...

    Dear GReaper and Salem,

    Just an update. The sizeof(int*) is needed only for the allocation call on line number 6, but not for the line 10. However, having sizeof(int*) for line 6 and 10 does not...
  17. Replies
    6
    Views
    4,585

    Dear GReaper and Salem, Thank you both for...

    Dear GReaper and Salem,

    Thank you both for your views.

    Salem, I tried your sizeof(int*) statement and the program does not dump core now. Everything is fine.

    Could you please explain what...
  18. Replies
    6
    Views
    4,585

    Double pointer to int for a dynamic array

    Dear C experts,

    The below program compiles without any error and prints values as expected.

    However, dumps core. I could do this without dumping core on a int *i, however, int **i is giving a...
Results 1 to 18 of 18